Question: Using Samtools to convert bam to sam file
0
gravatar for gerritvanderende
3.6 years ago by
United States
gerritvanderende0 wrote:

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 • 8.7k views
ADD COMMENTlink modified 3.6 years ago • written 3.6 years ago by gerritvanderende0

what did you try so far ?....

ADD REPLYlink written 3.6 years ago by Pierre Lindenbaum118k

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 REPLYlink modified 3.6 years ago • written 3.6 years ago by gerritvanderende0
2
gravatar for skbrimer
3.6 years ago by
skbrimer530
United States
skbrimer530 wrote:

Hi, 

To include the header you can use this

samtools view -h -o yourDir/test.sam test.bam 
ADD COMMENTlink written 3.6 years ago by skbrimer530
1
gravatar for Aurélien Guy-Duché
3.6 years ago by
France
Aurélien Guy-Duché30 wrote:

Hello,

samtools view test.bam > yourDir/test.sam
ADD COMMENTlink written 3.6 years ago by Aurélien Guy-Duché30
2

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

ADD REPLYlink written 3.6 years ago by Pierre Lindenbaum118k
1

Now, this is cyberbullying !! :-)

ADD REPLYlink written 3.6 years ago by Ashutosh Pandey11k
1

Sir, yes Sir ! :-)

ADD REPLYlink written 3.6 years ago by Aurélien Guy-Duché30
0
gravatar for gerritvanderende
3.6 years ago by
United States
gerritvanderende0 wrote:

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

ADD COMMENTlink written 3.6 years ago by gerritvanderende0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1072 users visited in the last hour