I'm struggling to merge many bam files respecting the original read groups with samtools. Some of the input files have the same read group, other files have others. If I don't use "-c" each "duplicate" RGs are assigned a random suffix (which I don't want to, they are the same RG). If I use "-c", RGs are not altered, but then only one RG line is printed in the header.
Does any one have a clue on how to solve this?
Ideally, with "-c" samtools should print any RG header line that is different from the others in the merged bam.
Many thanks Federico