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

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

ADD REPLYlink written 4 weeks ago by RamRS23k
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: 821 users visited in the last hour