Difference between samtools cat and the unix command cat?
2
1
Entering edit mode
4.8 years ago
yh362 ▴ 50

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

samtools unix • 1.3k views
ADD COMMENT
2
Entering edit mode
4.8 years ago
Ram 43k

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

ADD COMMENT
0
Entering edit mode
4.8 years ago

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 COMMENT
1
Entering edit mode

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

ADD REPLY

Login before adding your answer.

Traffic: 2916 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6