this question has been asked [and answered] on Stack Overflow
This is a two-part question:
- help interpreting an error;
- help with coding.
- I'm trying to run
bwa-mem
andsambamba
to align raw reads to a reference genome and to sort by position. These are the commands I'm using:
bwa mem \
-K 100000000 -v 3 -t 6 -Y \
-R '\@S200031047L1C001R002\S*[1-2]' \
/path/to/reference/GCF_009858895.2_ASM985889v3_genomic.fna \
/path/to/raw-fastq/'S\S[^_]*_L01_[0-9]+-[0-9]+'_1.fq.gz \
/path/to/raw-fastq/'S\S[^_]*_L01_[0-9]+-[0-9]+'_2.fq.gz | \
/path/to/genomics/sambamba-0.8.2 view -S -f bam \
/dev/stdin | \
/path/to/genomics/sambamba-0.8.2 sort \
/dev/stdin \
--out host_removal/${SAMPLE}/${SAMPLE}.hybrid.sorted.bam
This is the error message I'm getting: [E::bwa_set_rg] the read group line is not started with @RG
.
My sequences were generated with an MGI sequencer and the readgroups are identified like this @S200031047L1C001R0020000243/1
, i.e., they don't begin with an @RG. How can I specify to sambamba that my readgroups start with @S and not @RG?
- The commands written above are a published pipeline I'm modifying for my own research. However, among several changes, I'm not confident on how to define sample id as such stated in the last line of the code:
--out host_removal/${SAMPLE}/${SAMPLE}.hybrid.sorted.bam
(I'm referring to ${SAMPLE}). Any insights?
Thank you very much!