I would like to add read group info (
-R) during the mapping/alignment stage as part of my variant calling gatk pipeline.
I am doing something like this:
bwa mem \ -M \ -t 8 \ -v 3 \ -R <(sh a-illumina-read-group.sh $1) \ "$path_dr_bwaindex_genome" \ $1 $2
where the read group string is generated automatically from the fastq file by the shell script
a-illumina-read-group.sh. It produces a string like:
but, when I run bwa, it fails with this error:
[E::bwa_set_rg] the read group line is not started with @RG
I have tried excluding the single quotes (
'') around read group info, but that didn't change anything. I also tried variations in how the variable is passed.
-R=$(sh a-illumina-read-group.sh $1) \
-R=$(echo $(sh a-illumina-read-group.sh $1)) \
Just as a test, I tried:
-R <(echo $rg) \
But, they all produce the same error. I would appreciate any solutions to this issue.
I understand that I can add read groups later on using PicardTools
AddOrReplaceReadGroup, but I thought it might be convenient doing it here in one step.