Mapping

Intro

The two sets (R1 and R2) of paired-end reads are mapped by BWA-mem.

Handling

As a first indication on mapping performance, mean coverage and standard deviation are listed - in case of poor coverage (below 50) in red.

Next, all the reads mapping at a particular position of the genome are shown (samtools tview). Please use the "Other position" button at the right upper corner to zap through any positions of interest. Matches and mismatches are displayed according to the legend on top of the page, in the upper part color-coded due to mapping quality, in the lower part according to base quality (phred scores).

A third (bottom) part summarizes the mapping (mapping statistics by QualiMap). This summary is shown in a separate frame just as in the previous step. In contrast to the previous step, the links under CONTENTS will take you to the according name tags in any browser (probably because this time there is only one frame on the page).

Export

The numbers are entirely located on top (Summary) of the frame and thus easily exported by one copy/paste action.

Computational steps

/usr/local/bin/bwa mem -R "@RG\tID:${bamfile}\tSM:${bamfile}\tPL:ILLUMINA\tLB:NexteraXT" -t4 -v2 ${h37}bwai.fasta ${dir}$file1 ${dir}$file2 | /usr/local/bin/samtools import ${h37}sami.fasta.fai - - | /usr/local/bin/samtools sort -@4 -m5G - ${dir}processed/$bamfile

/usr/local/bin/samtools index ${dir}processed/${bamfile}.bam

cd /usr/share/qualimap_v0.7.1; ./qualimap bamqc --java-mem-size=4G -bam ${dir}processed/${bamfile}.bam > /dev/null

/usr/local/bin/samtools rmdup ${dir}processed/${bamfile}.bam ${dir}processed/${bamfile}_nodup.bam; mv ${dir}processed/${bamfile}_nodup.bam ${dir}processed/${bamfile}.bam; /usr/local/bin/samtools index ${dir}processed/${bamfile}.bam

/usr/bin/java -Xmx24g -jar /usr/local/share/GenomeAnalysisTK.jar -T RealignerTargetCreator -R ${h37}sami.fasta -I ${dir}processed/${bamfile}.bam -o ${dir}processed/${bamfile}.bam.intervals -rf BadCigar -nt 12

/usr/bin/java -Xmx4g -jar /usr/local/share/GenomeAnalysisTK.jar -T IndelRealigner -R ${h37}sami.fasta -I ${dir}processed/${bamfile}.bam -targetIntervals ${dir}processed/${bamfile}.bam.intervals -o ${dir}processed/${bamfile}_realigned.bam --defaultBaseQualities 12

/usr/bin/java -Xmx4g -jar /usr/local/share/GenomeAnalysisTK.jar -T BaseRecalibrator -I ${dir}processed/${bamfile}_realigned.bam -R ${h37}sami.fasta --knownSites ${h37}Resi-List-16-12-2013.vcf -o ${dir}processed/${bamfile}_Resilist.grp -nct 8 -rf BadCigar

rm ${dir}processed/${bamfile}.bam ${dir}processed/${bamfile}.bam.bai

/usr/bin/java -Xmx4g -jar /usr/local/share/GenomeAnalysisTK.jar -T PrintReads -R ${h37}sami.fasta -I ${dir}processed/${bamfile}_realigned.bam -BQSR ${dir}processed/${bamfile}_Resilist.grp -o ${dir}processed/${bamfile}.bam -rf BadCigar -nct 8

rm ${dir}processed/${bamfile}_realigned.bam ${dir}processed/${bamfile}_realigned.bai; cp ${dir}processed/${bamfile}.bai ${dir}processed/${bamfile}.bam.bai

Versions
Ref. Genome: NC_000962.3
QualiMap v2.2.1
BWA v0.7.17
SAMtools v1.9
Genome Analysis TK 3.3