BWA error: no ID within the read group line
0
2
Entering edit mode
4 months ago
whb ▴ 20

Hi,

I am trying to use parallel and bwa men to align fastqs in batch but it kept giving me the same error [E::bwa_set_rg] no ID within the read group line . I have tried different combination e.g. ' ' instead of " " or no quotes but none of them worked.

My fastq files names are:

153_D1_S9_R1_001.1607214816484_Cut_0.fastq.gz 
153_D1_S9_R3_001.1607214816484_Cut_0.fastq.gz 
153_ND1_S11_R1_001.1607216304845_Cut_0.fastq.gz 
153_ND1_S11_R3_001.1607216304845_Cut_0.fastq.gz

I have two text files TrimmedMeta.txt and TrimIDs.txt that contain the sample names and ID respectively as below:

TrimmedMeta.txt:

153_D1_S9
153_ND1_S11

TrimIDs.txt

1607214816484 
1607216304845

Code in bash script bwa_align.sh:

outdrive=/SAMs/
ref=/ref/GRCm39/GCF_000001635.27_GRCm39_genomic.fna
TAG="@RG\tID:{1}\tSM:{1}\tLB:{1}"

parallel --link -a TrimmedMeta.txt -a TrimIDs.txt bwa mem -R ${TAG} ${ref} {1}_R1_001.{2}_Cut_0.fastq.gz {1}_R3_001.{2}_Cut_0.fastq.gz '>'${outdrive}/{1}_output.sam

Did a --dry-run gave me what I expected:

bwa mem -R @RG\tID:153_D1_S9\tSM:153_D1_S9\tLB:153_D1_S9 ref/GRCm39/GCF_000001635.27_GRCm39_genomic.fna 153_D1_S9_R1_001.1607214816484_Cut_0.fastq.gz 153_D1_S9_R3_001.1607214816484_Cut_0.fastq.gz > /SAMs/153_D1_S9_output.sam
bwa mem -R @RG\tID:153_ND1_S11\tSM:153_ND1_S11\tLB:153_ND1_S11 ref/GRCm39/GCF_000001635.27_GRCm39_genomic.fna 153_ND1_S11_R1_001.1607216304845_Cut_0.fastq.gz 153_ND1_S11_R3_001.1607216304845_Cut_0.fastq.gz >/SAMs/153_ND1_S11_output.sam

However, when I submit the script gave me the error [E::bwa_set_rg] no ID within the read group line

What is the problem? Thanks

bwa readgroups RG parallel • 799 views
ADD COMMENT
0
Entering edit mode

Can you try quoting the @RG.... argument passed to bwa mem?

ADD REPLY
0
Entering edit mode

thanks for the reply. I thought the I have quoted it when I assign TAG variable. should I do "${TAG}"?

parallel --link -a TrimmedMeta.txt -a TrimIDs.txt bwa mem -R "${TAG}" ${ref} {1}_R1_001.{2}_Cut_0.fastq.gz {1}_R3_001.{2}_Cut_0.fastq.gz '>'${outdrive}/{1}_output.sam
ADD REPLY
0
Entering edit mode

Yeah, I'd quote the shell variable as well.

ADD REPLY
0
Entering edit mode

I have tried the following but if gave me the same error:

parallel --jobs -1 --link -a TtrimmedMeta.txt -a TtrimIDs.txt bwa mem -R "@RG\tID:{1}\tSM:{1}\tLB:{1}" ${ref} {1}_R1_001.{2}_Cut_0.fastq.gz {1}_R3_001.{2}_Cut_0.fastq.gz '>'${outdrive}/{1}_output.sam
ADD REPLY
0
Entering edit mode

I met the same error when send this to PBS. I think something's going wrong with the quote, or @, or some special letter that PBS cannot recognize.

ADD REPLY
0
Entering edit mode

Hi @chenyangkang24 I keep trying different combinations and this seems to work for me: "@RG'\'tID:{1}'\'tSM:{1}'\'tLB:{1}" instead of "@RG\tID:{1}\tSM:{1}\tLB:{1}" i.e. ticks around \ . Hope this helps!

ADD REPLY
0
Entering edit mode

Well that didn't work for me. I think we face different issue. In your case, maybe you can try '@RG\tID:{1}\tSM:{1}\tLB:{1}' as well?

ADD REPLY
0
Entering edit mode

Thank you anyway for the suggest

ADD REPLY
0
Entering edit mode

Yes I did try '@RG\tID:{1}\tSM:{1}\tLB:{1}'. Did not work. Did you put "${TAG}"as well as TAG= "@RG'\'tID:{1}'\'tSM:{1}'\'tLB:{1}" or just ${TAG}? only "${TAG}" worked for me. But if it doesn't... I am not sure sorry.

ADD REPLY

Login before adding your answer.

Traffic: 1232 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6