Question: Difference between samtools cat and the unix command cat?
1
gravatar for yh362
16 months ago by
yh36230
yh36230 wrote:

I am wondering, if I want to concatenate several .bam files, what's the difference between using samtools cat and the unix command cat?

unix samtools • 370 views
ADD COMMENTlink modified 16 months ago by benformatics2.0k • written 16 months ago by yh36230
2
gravatar for _r_am
16 months ago by
_r_am31k
Baylor College of Medicine, Houston, TX
_r_am31k wrote:

I think samtools cat would treat the body and the header differently, whereas cat would just concatenate them, breaking the SAM format.

ADD COMMENTlink written 16 months ago by _r_am31k
0
gravatar for benformatics
16 months ago by
benformatics2.0k
ETH Zurich
benformatics2.0k wrote:

Using samtools will allow you to use -hwhich will copy the header from a selected bam file (default: first file) into the resulting file (regardless of the number of total files merged). 'Cat'ing a bunch of BAMs together with their headers using normal cat would not be pretty. You can also use lists of input files with the -b option.

ADD COMMENTlink modified 16 months ago • written 16 months ago by benformatics2.0k
1

You don't need -h to copy header from file1 - that is the default behavior without -h.

ADD REPLYlink written 16 months ago by _r_am31k
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: 2047 users visited in the last hour