This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Using Samtools to convert bam to sam file

I am trying to convert a bam file to sam file in samtools and I need to designate the directory where the sam file is saved to. How would this be accomplished in samtools?

next-gen

i just tried view and the bam file name, view and the bam file directory location. I'm new to all of this so I apologize if I am asking annoying or obvious questions.

Thank you all for your help. I am learning programming languages so hopefully I won't have to ask continual questions.

2 answers

Hi,

To include the header you can use this

samtools view -h -o yourDir/test.sam test.bam

Hello,

samtools view test.bam > yourDir/test.sam

what about the BAM header. Aurelien, now, go back writing your internship report :-)

Log in to answer this question.