<div dir="ltr"><div dir="ltr">Hi all,<div>In order to determine the Read Groups from FASTQ files for BWA I used to do:</div><div><br></div><div><div><i>#Get read group infomration:</i></div><div><i>#Source: <a href="https://www.biostars.org/p/280837/#310132">https://www.biostars.org/p/280837/#310132</a></i></div><div><i>header=$(zcat $r1 | head -n 1)</i></div><div><i>id=$(echo $header | head -n 1 | cut -f 1-4 -d":" | sed 's/@//' | sed 's/:/_/g')</i></div><div><i>sm=$(echo $header | head -n 1 | grep -Eo "[ATGCN]+$")</i></div><div><i>echo "Read Group @RG\tID:$id\tSM:$id"_"$sm\tLB:$id"_"$sm\tPL:ILLUMINA"</i></div><div><i>...</i></div><div><i>bwa mem \</i></div><div><i>$2 $r1 $r2 \</i></div><div><i>-t 12 \</i></div><div><i>-R "$(echo "@RG\tID:$id\tSM:$id"_"$sm\tLB:$id"_"$sm\tPL:ILLUMINA")" | samblaster -r | samtools view -@ 12 -bSh -f 0x2 -F 2316 - | samtools fixmate - - | samtools sort -@ 12 - -o ${3}/${output}.sorted.dedup.bam</i></div></div><div><br></div><div><div>I just wonder whether BIopython has a function to determine the Read Groups?</div><div><br></div><div>Thank you in advance,</div><div><br></div><div>Best wishes,</div><div><br></div><div>Michal</div></div></div></div>