Question: Difference between samtools cat and the unix command cat?
1
gravatar for yh362
11 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 • 289 views
ADD COMMENTlink modified 11 months ago by benformatics1.6k • written 11 months ago by yh36230
2
gravatar for RamRS
11 months ago by
RamRS27k
Houston, TX
RamRS27k 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 11 months ago by RamRS27k
0
gravatar for benformatics
11 months ago by
benformatics1.6k
ETH Zurich
benformatics1.6k 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 11 months ago • written 11 months ago by benformatics1.6k
1

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

ADD REPLYlink written 11 months ago by RamRS27k
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: 1379 users visited in the last hour