Question: Size of BAM file reduces after sorting with samtools
0
gravatar for shakeelbiochemist
3.9 years ago by
Pakistan
shakeelbiochemist0 wrote:

I have 3 BAM files of the same specie, each of ~7GB, from three experimental runs. I merged the three BAM files to produce a single 22 GB bam file, using samtools merge -r option. Then I sorted this merged bam file with samtools sort, and i got 11 GB merged bam. Is is possible to reduce the size of merged bam file by 50%??

ADD COMMENTlink modified 3.9 years ago by Sean Davis25k • written 3.9 years ago by shakeelbiochemist0
2

yes         .

ADD REPLYlink written 3.9 years ago by Pierre Lindenbaum120k
2

You can use samtools flagstat .bam to check read counts etc. for the different files.
 

ADD REPLYlink written 3.9 years ago by thackl2.6k
3
gravatar for Sean Davis
3.9 years ago by
Sean Davis25k
National Institutes of Health, Bethesda, MD
Sean Davis25k wrote:

When you sort by coordinate, you bring reads with similar sequences next to each other, allowing the compression algorithm to see more compressible content.  It is worth checking, though, that the number of sequences is what you expect using `samtools flagstat` or simply `samtools view` and a `wc -l`.

 

 

ADD COMMENTlink written 3.9 years ago by Sean Davis25k
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: 1618 users visited in the last hour