Convert .sam to .bam without producing writing .sam file to storage space
1
0
Entering edit mode
4.4 years ago
Ada ▴ 10

How do I convert .sam to .bam without producing writing .sam file to storage space?

alignment • 692 views
ADD COMMENT
1
Entering edit mode

without producing writing .sam file to storage space?

what does that mean ?

ADD REPLY
2
Entering edit mode
4.4 years ago
biofalconch ★ 1.3k

I think he means if there is a way of piping it to generate a bam file directly without going through a sam file intermidiate. Something like this would be my guess:

bowtie2 -x Index -1 Reads1.fq -2 Reads2.fq | samtools view -b -h -o output.bam
ADD COMMENT
1
Entering edit mode

With the recent samtools versions you can even shorten it to (...) | samtools view -o output.bam. It autodetects the format on the suffix, and the header is always written if writing bam.

ADD REPLY

Login before adding your answer.

Traffic: 1395 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