This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Samtools merge Failed to open file BAMT error

I have bam files that I have split into unmapped, uniquely mapped and multimapped bam files from HISAT2 alignment. I am trying to merge the sorted unmapped and uniquely mapped bam files with the command

samtools merge A1_merged.bam -b A1_unmapped.bam A1_unique.bam

and am getting an error

[E::hts_open_format] Failed to open file BAMT
samtools merge: fail to open "BAMT": No such file or directory

the square actually has a question mark in it but that didn't copy across. Anyone have any ideas on why this error is coming up and how to fix it?

rna-seq samtools merge

1 answer

  -b FILE    List of input BAM filenames, one per line [null]

-b would be necessary if the file names were in a separate text file.

It is simply

samtools merge A1_merged.bam A1_unmapped.bam A1_unique.bam

Log in to answer this question.