Skip to content

Commit

Permalink
Merge pull request #444 from molgenis/3.2.3
Browse files Browse the repository at this point in the history
3.2.3
  • Loading branch information
Gerbenvandervries committed Mar 1, 2016
2 parents 6788d56 + 9322ffd commit 63ea21d
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 30 deletions.
2 changes: 1 addition & 1 deletion compute5/NGS_DNA/parameters.csv
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ MillsGoldStandardChr1Intervals,${MillsGoldStandardDir}/1000G_phase1.indels_Mills
### Protocols 11, 12, 13 and 14 (CheckSex, Delly, CoveragePerBase, SequonomConcordanceCheck, CollectBamMetrics) ###
whichSex,${sampleNameID}.chosenSex.txt
checkSexMeanCoverage,${sampleNameID}.checkSex.filter.meancoverage.txt
capturedIntervals_nonAutoChrX,${intermediateDir}/${nameBed}.nonAutosomalChrX.interval_list
capturedIntervals_nonAutoChrX,${intermediateDir}/${sampleNameID}.${nameBed}.nonAutosomalChrX.interval_list
familyList,${sampleNameID}.familylist.txt
arrayMapFile,${sampleNameID}.concordance.map
sampleConcordanceFile,${sampleNameID}.concordance.ngsVSarray.txt
Expand Down
25 changes: 12 additions & 13 deletions compute5/NGS_DNA/protocols/CollectHSMetrics.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ makeTmpDir ${hsMetrics}
tmpHsMetrics=${MC_tmpFile}

#Run Picard HsMetrics if capturingKit was used
if [ "${capturingKit}" != "UMCG\/wgs" ]
if [ "${capturingKit}" == "UMCG\/wgs" ] || [ "${capturingKit}" == "None" ]
then
java -jar -Xmx4g ${EBROOTPICARD}/${picardJar} ${hsMetricsJar} \
INPUT=${dedupBam} \
Expand All @@ -33,8 +33,17 @@ then
TARGET_INTERVALS=${capturedExomeIntervals} \
VALIDATION_STRINGENCY=LENIENT \
TMP_DIR=${tempDir}
elif [ "${capturingKit}" != "None" ]
then
#elif [ "${capturingKit}" == "None" ]
#then
# echo "## net.sf.picard.metrics.StringHeader" > ${tmpHsMetrics}
# echo "#" >> ${tmpHsMetrics}
# echo "## net.sf.picard.metrics.StringHeader" >> ${tmpHsMetrics}
# echo "#" >> ${tmpHsMetrics}
# echo "" >> ${tmpHsMetrics}
# echo "## METRICS CLASS net.sf.picard.analysis.directed.HsMetrics" >> ${tmpHsMetrics}
# echo "BAIT_SET GENOME_SIZE BAIT_TERRITORY TARGET_TERRITORY BAIT_DESIGN_EFFICIENCY TOTAL_READS PF_READS PF_UNIQUE_READS PCT_PF_READS PCT_PF_UQ_READS PF_UQ_READS_ALIGNED PCT_PF_UQ_READS_ALIGNED PF_UQ_BASES_ALIGNED ON_BAIT_BASES NEAR_BAIT_BASES OFF_BAIT_BASES ON_TARGET_BASES PCT_SELECTED_BASES PCT_OFF_BAIT ON_BAIT_VS_SELECTED MEAN_BAIT_COVERAGE MEAN_TARGET_COVERAGE PCT_USABLE_BASES_ON_BAIT PCT_USABLE_BASES_ON_TARGET FOLD_ENRICHMENT ZERO_CVG_TARGETS_PCT FOLD_80_BASE_PENALTY PCT_TARGET_BASES_2X PCT_TARGET_BASES_10X PCT_TARGET_BASES_20X PCT_TARGET_BASES_30X HS_LIBRARY_SIZE HS_PENALTY_10X HS_PENALTY_20X HS_PENALTY_30X AT_DROPOUT GC_DROPOUT SAMPLE LIBRARY READ_GROUP" >> ${tmpHsMetrics}
# echo "NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA" >> ${tmpHsMetrics}
else
java -jar -Xmx4g ${EBROOTPICARD}/${picardJar} ${hsMetricsJar} \
INPUT=${dedupBam} \
OUTPUT=${tmpHsMetrics} \
Expand All @@ -43,16 +52,6 @@ then
VALIDATION_STRINGENCY=LENIENT \
TMP_DIR=${tempDir}

else
echo "## net.sf.picard.metrics.StringHeader" > ${tmpHsMetrics}
echo "#" >> ${tmpHsMetrics}
echo "## net.sf.picard.metrics.StringHeader" >> ${tmpHsMetrics}
echo "#" >> ${tmpHsMetrics}
echo "" >> ${tmpHsMetrics}
echo "## METRICS CLASS net.sf.picard.analysis.directed.HsMetrics" >> ${tmpHsMetrics}
echo "BAIT_SET GENOME_SIZE BAIT_TERRITORY TARGET_TERRITORY BAIT_DESIGN_EFFICIENCY TOTAL_READS PF_READS PF_UNIQUE_READS PCT_PF_READS PCT_PF_UQ_READS PF_UQ_READS_ALIGNED PCT_PF_UQ_READS_ALIGNED PF_UQ_BASES_ALIGNED ON_BAIT_BASES NEAR_BAIT_BASES OFF_BAIT_BASES ON_TARGET_BASES PCT_SELECTED_BASES PCT_OFF_BAIT ON_BAIT_VS_SELECTED MEAN_BAIT_COVERAGE MEAN_TARGET_COVERAGE PCT_USABLE_BASES_ON_BAIT PCT_USABLE_BASES_ON_TARGET FOLD_ENRICHMENT ZERO_CVG_TARGETS_PCT FOLD_80_BASE_PENALTY PCT_TARGET_BASES_2X PCT_TARGET_BASES_10X PCT_TARGET_BASES_20X PCT_TARGET_BASES_30X HS_LIBRARY_SIZE HS_PENALTY_10X HS_PENALTY_20X HS_PENALTY_30X AT_DROPOUT GC_DROPOUT SAMPLE LIBRARY READ_GROUP" >> ${tmpHsMetrics}
echo "NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA" >> ${tmpHsMetrics}

fi

mv ${tmpHsMetrics} ${hsMetrics}
Expand Down
8 changes: 1 addition & 7 deletions compute5/NGS_DNA/protocols/GenderCalculate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,8 @@ sleep 5
makeTmpDir ${hsMetricsNonAutosomalRegionChrX}
tmpHsMetricsNonAutosomalRegionChrX=${MC_tmpFile}

#make intervallist
if [ -f ${capturedIntervals_nonAutoChrX} ]
then
rm ${capturedIntervals_nonAutoChrX}
fi

cp ${indexFileDictionary} ${capturedIntervals_nonAutoChrX}
awk '{if ($0 ~ /^X/){print $0}}' ${capturedIntervals} >> ${capturedIntervals_nonAutoChrX}
awk '{if ($0 ~ /^X/){print $0}}' ${capturedIntervals} > ${capturedIntervals_nonAutoChrX}

#Calculate coverage chromosome X
java -jar -XX:ParallelGCThreads=2 -Xmx4g ${EBROOTPICARD}/${picardJar} CalculateHsMetrics \
Expand Down
51 changes: 42 additions & 9 deletions compute5/NGS_DNA/protocols/QCReport.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,12 @@ do
sampleHsMetrics+=("${intermediateDir}/${sample}.merged.dedup.bam.hs_metrics")
sampleAlignmentMetrics+=("${intermediateDir}/${sample}.merged.dedup.bam.alignment_summary_metrics")
sampleInsertMetrics+=("${intermediateDir}/${sample}.merged.dedup.bam.insert_size_metrics")
sampleDedupMetrics_folded+=("${intermediateDir}/${sample}.merged.dedup.metrics")
sampleDedupMetrics+=("${intermediateDir}/${sample}.merged.dedup.metrics")
sampleConcordance+=("${intermediateDir}/${sample}.concordance.ngsVSarray.txt")
sampleInsertSizePDF+=("images/${sample}.merged.dedup.bam.insert_size_histogram.pdf")

done

#unfolded dor dedupMatrics per lane,flowcell.
for sample in "${externalSampleID[@]}"
do
sampleDedupMetrics+=("${intermediateDir}/${sample}.merged.dedup.metrics")
done


#
## Gather QC statistics
#
Expand All @@ -100,7 +93,7 @@ Rscript ${EBROOTNGSMINUTILS}/getStatistics/${getStatisticsScript} \
--hsmetrics $(bashArrayToCSV sampleHsMetrics[@]) \
--alignment $(bashArrayToCSV sampleAlignmentMetrics[@]) \
--insertmetrics $(bashArrayToCSV sampleInsertMetrics[@]) \
--dedupmetrics $(bashArrayToCSV sampleDedupMetrics_folded[@]) \
--dedupmetrics $(bashArrayToCSV sampleDedupMetrics[@]) \
--concordance $(bashArrayToCSV sampleConcordance[@]) \
--sample $(bashArrayToCSV INPUTS[@]) \
--colnames ${EBROOTNGSMINUTILS}/getStatistics/NiceColumnNames.csv \
Expand All @@ -114,6 +107,46 @@ Rscript ${EBROOTNGSMINUTILS}/getStatistics/${getStatisticsScript} \
qcReportTemplate=${EBROOTNGS_DNA}/report/qc_report_template.Rmd
qcHelperFunctionsR=${EBROOTNGS_DNA}/report/knitr_helper_functions.R

count="0"
FIRSTLINE=""
SECONDLINE=""
thisSample=""

if [ -f ${qcDedupMetricsOut}.tmp ]
then
rm ${qcDedupMetricsOut}.tmp
fi

for i in $(ls ${intermediateDir}/*.merged.dedup.metrics)
do
tail -1 ${i} | awk '{OFS="\n"} {print $1,$2}' >> ${qcDedupMetricsOut}.tmp
done

while read line
do
if [ $count == "0" ]
then
FIRSTLINE+=$(echo "${line},")
count="1"
elif [ $count == "1" ]
then
SECONDLINE+=$(echo "${line},")
count="0"
fi
done<${qcDedupMetricsOut}.tmp
FIRST=${FIRSTLINE%?}
SECOND=${SECONDLINE%?}

for sa in "${INPUTS[@]}"
do
thisSample+=$(echo "${sa},")
done

sam=${thisSample%?}
echo -e "Sample,${sam}" > ${qcDedupMetricsOut}
echo -e "READ_PAIR_DUPLICATES,${FIRST}\nPERCENT_DUPLICATION,${SECOND}" >> ${qcDedupMetricsOut}


#
## Run R script to knitr your report
#
Expand Down
1 change: 1 addition & 0 deletions compute5/NGS_DNA/report/qc_report_template.Rmd
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

#NGS QC report
##Next Generation Sequencing report
##Genome Analysis Facility (GAF), Genomics Coordination Centre (GCC) University Medical Centre Groningen
Expand Down

0 comments on commit 63ea21d

Please sign in to comment.