I have bam files, created by bowtie2, to which I need to add read group information. The obvious tool is samtools addreplacerg from samtools v1.3.1 , but I always get an error. Below is the simplest command I tried, with the error. I have tried single quotes, double quotes, adding "@RG\t" to the text, and too many other variants to mention. All give the same message. Can anyone tell me what I am doing wrong?
samtools addreplacerg -r ID:S1 -o 3D7-D3-B3_S1_RGID.bam 3D7-D3-B3_S1_s.bam
[parse_args] The supplied RG line lacks an ID tag.
Try this command it will surely work
oh sure, thanks
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