I recently sorted a bunch of BAMs that are about 400 MB in size each. After sorting with samtools the output sorted BAMs are about 3-4 MB smaller than the unsorted originals. Does anyone know why this is? My understanding of a sort is that it simply rearranges the available reads inside a BAM, and I don't see why this would create a smaller file.
Header Leaderboard Ad
Collapse
sorting a BAM produces a smaller file than the original
Collapse
Announcement
Collapse
No announcement yet.
X
-
Sorting does not remove duplicate reads.
I seem to recall this same question asked previously on Seqanswers but my search skills are lacking this morning so I can't find the thread. If you were to compare an unsorted vs. sorted SAM file the sizes should be identical because, as oiiio said, the information content is the same, it has simply been rearranged. SAM files are plain text files so provided the content is the same the file size will be the same regardless of order. BAM files are compressed; the order of the information in the file can have an effect on the compression of that data. This was the explanation I recall from that earlier thread. (Once the caffeine fully kicks in I'll see if I can find that thread.)
Comment
-
I know this thread has been inactive for a while, but my question is basically the same.
I have a 120GB bam file from RNA-Seq data and used the samtools sort function with compression level 1 (so meaning the least compression).
I ended up with a file of only ~30GB size.
Now this is the first time I am working with this and I have no idea if this is a normal range for reduction in size, but my feeling is something went wrong.
Could anyone with experience tell me if the result is expected or not?
thanks,
Florian
Comment
-
RNA-Seq contains a greater fraction of duplicate reads due to highly expressed genes, so sorting reduces the size more than DNA-Seq. If you want to check that nothing was lost, use 'samtools view' to compare the number of reads before/after sorting.
Comment
-
Originally posted by HESmith View PostIf you want to check that nothing was lost, use 'samtools view' to compare the number of reads before/after sorting.
Comment
Latest Articles
Collapse
-
by seqadmin
Cancer research has been transformed through numerous molecular techniques, with RNA sequencing (RNA-seq) playing a crucial role in understanding the complexity of the disease. Maša Ivin, Ph.D., Scientific Writer at Lexogen, and Yvonne Goepel Ph.D., Product Manager at Lexogen, remarked that “The high-throughput nature of RNA-seq allows for rapid profiling and deep exploration of the transcriptome.” They emphasized its indispensable role in cancer research, aiding in biomarker...-
Channel: Articles
09-07-2023, 11:15 PM -
-
by seqadmin
Ribonucleic acid (RNA) represents a range of diverse molecules that play a crucial role in many cellular processes. From serving as a protein template to regulating genes, the complex processes involving RNA make it a focal point of study for many scientists. This article will spotlight various methods scientists have developed to investigate different RNA subtypes and the broader transcriptome.
Whole Transcriptome RNA-seq
Whole transcriptome sequencing...-
Channel: Articles
08-31-2023, 11:07 AM -
ad_right_rmr
Collapse
News
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by seqadmin, 09-22-2023, 09:05 AM
|
0 responses
14 views
0 likes
|
Last Post
by seqadmin
09-22-2023, 09:05 AM
|
||
Started by seqadmin, 09-21-2023, 06:18 AM
|
0 responses
12 views
0 likes
|
Last Post
by seqadmin
09-21-2023, 06:18 AM
|
||
Started by seqadmin, 09-20-2023, 09:17 AM
|
0 responses
13 views
0 likes
|
Last Post
by seqadmin
09-20-2023, 09:17 AM
|
||
Started by seqadmin, 09-19-2023, 09:23 AM
|
0 responses
28 views
0 likes
|
Last Post
by seqadmin
09-19-2023, 09:23 AM
|
Comment