This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Can't add read group correctly to minimap2 sam alignmnet

Hello I am running minimap2 in a pipeline with GATK that needs read group data @RG with sample information. minimap2 -ax sr -t 20 -I 100G -R @RG\\tID:A00253_251_HTN2JDSXY.2\\tPL:ILLUMINA\tLB:LB1\\tSM:TA90 ref.mmi reads_1.fq.gz reads_2.fq.gz | samtools view -bh -F 260 -T ref.fa >out.bam

I see in the bam file only the ID part of the read group like this:

 RG:Z:A00253_251_HTN2JDSXY.2

How do I fix this? Thank you

group read gatk minimap2

From an old bwa script, I see I don't use double backslashes. Try with:

-R "@RG\tID:A00253_251_HTN2JDSXY.2\tPL:ILLUMINA\tLB:LB1\tSM:TA90"

1 answer

Eventually I got an answer from the developer of minimap2 saying that I did it correctly and the output in the bam file is in the format is should be. The sample information is given only in the bam/sam header and not in each read. I used the bam file in GATK and there was no problem.

Log in to answer this question.