title: BWA-mem and sambamba read group line error
body: <p>This is a two-part question:</p>
  <ol>
  <li>help interpreting an error;</li>
  <li>help with coding.</li>
  </ol>
  <hr />
  <ol>
  <li>I'm trying to run <code>bwa-mem</code> and <code>sambamba</code> to aling raw reads to a reference genome and to sort by position. These are the commands I'm using:</li>
  </ol>
  <pre><code>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
  </code></pre>
  <p>This is the error message I'm getting: <code>[E::bwa_set_rg] the read group line is not started with @RG</code>.</p>
  <p>My sequences were generated with an MGI sequencer and the readgroups are identified like this <code>@S200031047L1C001R0020000243/1</code>, i.e., they don't beging with an @RG. How can I specify to <code>sambamba</code> that my readgroups start with @S and not @RG?</p>
  <hr />
  <ol start="2">
  <li>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: <code>--out host_removal/${SAMPLE}/${SAMPLE}.hybrid.sorted.bam</code> (I'm referring to ${SAMPLE}). Any insights?</li>
  </ol>
  <p>Thank you very much!</p>