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.
Seqanswers Leaderboard Ad
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
Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...-
Channel: Articles
04-04-2024, 04:25 PM -
-
by seqadmin
Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...-
Channel: Articles
03-22-2024, 06:39 AM -
ad_right_rmr
Collapse
News
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by seqadmin, 04-11-2024, 12:08 PM
|
0 responses
30 views
0 likes
|
Last Post
by seqadmin
04-11-2024, 12:08 PM
|
||
Started by seqadmin, 04-10-2024, 10:19 PM
|
0 responses
32 views
0 likes
|
Last Post
by seqadmin
04-10-2024, 10:19 PM
|
||
Started by seqadmin, 04-10-2024, 09:21 AM
|
0 responses
28 views
0 likes
|
Last Post
by seqadmin
04-10-2024, 09:21 AM
|
||
Started by seqadmin, 04-04-2024, 09:00 AM
|
0 responses
52 views
0 likes
|
Last Post
by seqadmin
04-04-2024, 09:00 AM
|
Comment