I'm trying to use samtools cat to merge a bunch of smaller bam files. I need them unsorted so I can't use samtools merge. I used samtools view -h 1_R1.bam > header.bam
to get the header file it requires. Then I ran samtools cat -h header.bam -o catR1.bam -b 1_R1.bam -b 2_R1.bam
. However, it doesn't seem to like my header file because it gives me an error
Failed to open file @SQ SN:R=9:L2_5_GA::chrI:539055-539154() LN:99 samtools cat: failed to open file '@SQ SN:R=9:L2_5_GA::chrI:539055-539154() LN:99': No such file or directory
Which is the first line in the header file. The first few lines of my header file look like this
@SQ SN:R=9:L2_5_GA::chrI:539055-539154() LN:99
@SQ SN:R=47:Helitron_1_GA::chrI:537338-537433() LN:95
@SQ SN:R=47:Helitron_1_GA::chrI:537344-537428() LN:84
@SQ SN:R=52:REX1_1_GA::chrI:536673-536882() LN:209
@SQ SN:R=47:Helitron_1_GA::chrI:534938-534978() LN:40
@SQ SN:R=122:L2_1_GA::chrI:534773-534936() LN:163
@SQ SN:R=2229:L2_1_GA::chrI:534633-534768() LN:135
@SQ SN:R=47:Helitron_1_GA::chrI:534562-534625() LN:63
@SQ SN:R=11:SINE_FR2::chrI:533571-533726() LN:155
@SQ SN:R=85:Unknown::chrI:533414-533572() LN:158
I'm not quite sure what's going on here
Are you sure that there is
-b
option?