From 3a41016265744b3f96c25bccb7511a79e6fc2998 Mon Sep 17 00:00:00 2001 From: Brandi Cantarel <brandi.cantarel@utsouthwestern.edu> Date: Wed, 25 Jul 2018 16:54:57 -0500 Subject: [PATCH] qc ontarget --- alignment/bamqc.sh | 4 ++-- alignment/dnaseqalign.sh | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/alignment/bamqc.sh b/alignment/bamqc.sh index bc7894d..86d1643 100644 --- a/alignment/bamqc.sh +++ b/alignment/bamqc.sh @@ -46,9 +46,9 @@ if [[ $nuctype == 'dna' ]]; then module load bedtools/2.26.0 picard/2.10.3 samtools view -b --threads $SLURM_CPUS_ON_NODE -L ${bed} -o ${pair_id}.ontarget.bam ${sbam} samtools index ${pair_id}.ontarget.bam - samtools flagstat ${pair_id}.ontarget.bam > ${pair_id}.ontarget.flagstat.txt + #samtools flagstat ${pair_id}.ontarget.bam > ${pair_id}.ontarget.flagstat.txt java -Xmx64g -jar $PICARD/picard.jar CollectInsertSizeMetrics INPUT=${sbam} HISTOGRAM_FILE=${pair_id}.hist.ps REFERENCE_SEQUENCE=${index_path}/genome.fa OUTPUT=${pair_id}.hist.txt - java -Xmx64g -jar $PICARD/picard.jar CollectAlignmentSummaryMetrics R=${index_path}/genome.fa I=${sbam} OUTPUT=${pair_id}.alignmentsummarymetrics.txt + java -Xmx64g -jar $PICARD/picard.jar CollectAlignmentSummaryMetrics R=${index_path}/genome.fa I=${pair_id}.ontarget.bam OUTPUT=${pair_id}.alignmentsummarymetrics.txt java -Xmx64g -jar $PICARD/picard.jar EstimateLibraryComplexity I=${sbam} OUTPUT=${pair_id}.libcomplex.txt samtools view -b -q 1 ${sbam} | bedtools coverage -sorted -hist -g ${index_path}/genomefile.txt -b stdin -a ${bed} > ${pair_id}.mapqualcov.txt bedtools coverage -sorted -g ${index_path}/genomefile.txt -a ${bed} -b ${sbam} -hist > ${pair_id}.covhist.txt diff --git a/alignment/dnaseqalign.sh b/alignment/dnaseqalign.sh index 26a546a..c0a24a6 100644 --- a/alignment/dnaseqalign.sh +++ b/alignment/dnaseqalign.sh @@ -50,12 +50,14 @@ else bwa mem -M -t $SLURM_CPUS_ON_NODE -R "@RG\tID:${pair_id}\tLB:tx\tPL:illumina\tPU:barcode\tSM:${pair_id}" ${index_path}/genome.fa ${fq1} > out.sam fi -if [[ $umi == 'umi' ]] +if [[ $umi == 'umi' ]] && [[ $index_path == '/project/shared/bicf_workflow_ref/GRCh38' ]] then k8 /cm/shared/apps/bwakit/0.7.15/bwa-postalt.js -p tmphla ${index_path}/genome.fa.alt out.sam | python ${baseDir}/add_umi_sam.py -s - -o output.unsort.bam elif [[ $index_path == '/project/shared/bicf_workflow_ref/GRCh38' ]] then k8 /cm/shared/apps/bwakit/0.7.15/bwa-postalt.js -p tmphla ${index_path}/genome.fa.alt out.sam| samtools view -1 - > output.unsort.bam +elif [[ $umi == 'umi' ]] + python ${baseDir}/add_umi_sam.py -s out.sam -o output.unsort.bam else samtools view -1 -o output.unsort.bam out.sam fi -- GitLab