This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Merging BAM file with Samtools

Hi everybody,

I'm trying to merge 2 bam files using samtools (1.9), but it give me th error "Tag PG:fastq2bam_damp_1-7-29 not found in @PG records". I didn't find any useful information about the error on net! Could you please let me know how I can solve the error?

Thanks

samtools merge bam

1 answer

That's probably a warning (it's written as such, but I haven't looked through the repercussions) and can be ignored. There's a nice comment in the samtools source code about this:

/*
 * Common code for completing RG and PG record translation.
 *
 * Input is a list of header lines, and the mapping from input to
 * output @PG record IDs.
 *
 * RG and PG records can contain tags that cross-reference to other @PG
 * records.  This fixes the tags to contain the new IDs before adding
 * them to the output header text.
 */

So, basically it's trying to ensure that PG record cross-references don't get broken by the merge. Unless you get a non-zero return code the resulting file should be fine.

Log in to answer this question.