Using Samtools to convert bam to sam file
2
1
Entering edit mode
8.7 years ago

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 • 17k views
ADD COMMENT
0
Entering edit mode

what did you try so far ?....

ADD REPLY
0
Entering edit mode

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.

ADD REPLY
0
Entering edit mode

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

ADD REPLY
3
Entering edit mode
8.7 years ago
skbrimer ▴ 740

Hi,

To include the header you can use this

samtools view -h -o yourDir/test.sam test.bam
ADD COMMENT
1
Entering edit mode
8.7 years ago

Hello,

samtools view test.bam > yourDir/test.sam
ADD COMMENT
2
Entering edit mode

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

ADD REPLY
1
Entering edit mode

Now, this is cyberbullying !! :-)

ADD REPLY
1
Entering edit mode

Sir, yes Sir ! :-)

ADD REPLY

Login before adding your answer.

Traffic: 2179 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6