Thanks! I originally had:
samtools addreplacerg -r ID:S1 SM:S1 PL:ILLUMINA -o out.bam in.bam
without the repeated "-r", which gives the same "The supplied RG line lacks an ID tag", and that error message had me trying all sorts of incorrect fixes, including stripping down to just the ID tag
In the meantime I created a header file for each bam file and used samtools merge -rh tempheader_S1 ... which worked fine. So the task is done, but I would still like to know why I couldn't use the more obvious command, which gives me other options for the ID flag than the input bam filename
Try this command it will surely work
oh sure, thanks