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
Can you try quoting the
@RG....
argument passed to bwa mem?thanks for the reply. I thought the I have quoted it when I assign TAG variable. should I do
"${TAG}"
?Yeah, I'd quote the shell variable as well.
I have tried the following but if gave me the same error:
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.
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!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?Hi, I met the same error when send this to PBS. Have you solved the problem? How did it work?
Hi, I replaced
\t
with\\t
and it worked. Hope this would be helpful.Thanks! This worked for me, something like this:
TAG="@RG\\tID:${id}\\tSM:${id}\\tLB:${id}\\tPL:ILLUMINA"
Thank you anyway for the suggest
Yes I did try '@RG\tID:{1}\tSM:{1}\tLB:{1}'. Did not work. Did you put
"${TAG}"
as well asTAG= "@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.