I sequenced a mito genome using paired end method on the mi-seq I mapped all the reads back to reference gnome using BWA and got output of a Sam file I want to convert to BAM format but I am getting errors. This first line of my sam file is "@SQ SN:TAC111F LN:16753" all my following lines do not have the @ sign. This is the out put I get [samopen] SAM header is present: 1 sequences. Im using this comand $ samtools view -bT reference.fa test.sam > test.bam can any one help me
Read the samtools manual carefully. Your command usage shows that you haven't done your homework properly before asking the question.
FIrst of all there is no "-T" (capital T) parameter that I know of. The "-t" (small t) parameter is used when your aligner hasn't generated header for sam file. But as you have used BWA, header should be present in the SAM file. All you need is: samtools view -bhS your.sam > your.bam