Hello,
I want to convert my .sam files into .bam files with Samtools. Samtools view functioned well, here's my code: (My sam files have the @ indicator, indicating the header. If I use head on my files:
@SQ SN:NC_000067.7 LN:195154279
@SQ SN:NT_166280.1 LN:169725
@SQ SN:NT_166281.1 LN:241735
@SQ SN:NT_166282.1 LN:153618 )
ls *.sam | parallel 'samtools view -bS {} > /media/bam_files/v2/{.}.bam -@ 15'
When I try to use samtools sort
, it's stuck on the pretty header part, here the command line:
samtools sort aln-pe_RNA-Exo-Mouse-F1_S1.bam -o aln-RNA_EXO-Mouse-F1_S1.sorted.bam
Error obtained:
[bam_sort_core] merging from 45 files...
[pretty_header] invalid header
Here's my version of samtools:
samtools --version
samtools 1.1
Using htslib 1.1
Copyright (C) 2014 Genome Research Ltd.
Installed through conda.
How can I correct this error? Is something wrong with my code?
I'm aware of it but conda doesn't seem to want to upgrade it more, maybe I should install it manually.
Here's my alignment command with BWA:
I have 12 fastq files, they're paired end. I didn't modified the sam at all, it's how it was generated by bwa.
I confess I only used bwa and samtools once during a course but it's been a while, I probably messed up somewhere.
Okay, thank you for your recommendations!
I've updated samtools to
I'll keep you updated to see if the error still occurs
Your
~/.condarc
file should look like:That's the recommended order of channels for conda to get software well-going. This compensates the problem of samtools not upgrading properly.
Perfect, I updated the .condarc file, indeed I didn't had any order setted up on my environnement so that's why it failed. Thank you!
So, I used samtools 1.17 and I don't have the error anymore. The old version was the problem.
Now I'm regenerating the raw .bam files with the new version.