Question: How Is -U Flag(Compressed) Different From -B Flag In Samtools?
2
gravatar for lwc628
5.2 years ago by
lwc628200
United States
lwc628200 wrote:

My confusion arose because both b and u flag seem to do the same task, except one outputs the compressed and the other uncompressed bam.

It says samtools view -u outputs bam file in uncompressed. Is this just for performance, or if I fail to give this flag, would this cause any problem?

For example, what is the difference between other than the computing time?

samtools view -bS some.sam | samtools sort - some_sort
samtools view -uS some.sam | samtools sort - some_sort

Most importantly, If u flag just for performance, why is it not default? what is the purpose having b flag?

samtools • 1.9k views
ADD COMMENTlink modified 5.2 years ago by lomereiter430 • written 5.2 years ago by lwc628200
7
gravatar for lomereiter
5.2 years ago by
lomereiter430
Russian Federation
lomereiter430 wrote:

b flag is when you need to store file on disk, -u is for piping purposes. If you have plenty of disk space and the disk is fast, there's indeed no reason to store BAMs compressed (unless you run a FTP server which provides access to these files). But usually disk performance is not that great, and it's faster to read compressed file and unpack it on the fly, than to read uncompressed file. Plus, as I mentioned, if BAMs are to be accessible via HTTP/FTP, traffic becomes another reason.

ADD COMMENTlink modified 5.2 years ago • written 5.2 years ago by lomereiter430
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: 717 users visited in the last hour