You don't need -h to copy header from file1 - that is the default behavior without -h.
Difference between samtools cat and the unix command cat?
I am wondering, if I want to concatenate several .bam files, what's the difference between using samtools cat and the unix command cat?
• 1,952 views
•
link
2 answers
I think samtools cat would treat the body and the header differently, whereas cat would just concatenate them, breaking the SAM format.
• 0 views
•
link
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.
• 0 views
•
link
• 0 views
•
link
Log in to answer this question.