Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix in hsMetrics + copying original vcf from DRAGEN to results folder #336

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion parameters.csv
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ sampleMergedBamIdx,${samplePrefix}.merged.bam.bai
dedupBam,${projectResultsDir}/alignment/${externalSampleID}.merged.dedup.bam
dedupBamIdx,${projectResultsDir}/alignment/${externalSampleID}.merged.dedup.bam.bai
dedupBamMetrics,${projectResultsDir}/qc/statistics/${externalSampleID}.merged.dedup.bam
dedupBamChrXMetrics,${projectResultsDir}/qc/${externalSampleID}.merged.dedup.bam
dedupBamCram,${projectResultsDir}/alignment/${externalSampleID}.merged.dedup.bam.cram
dedupBamCramIdx,${projectResultsDir}/alignment/${externalSampleID}.merged.dedup.bam.cram.crai
dedupBamCramBam,${projectResultsDir}/alignment/${externalSampleID}.merged.dedup.bam.cram.bam
Expand Down Expand Up @@ -176,7 +177,7 @@ gcBiasMetricsJar,CollectGcBiasMetrics
insertSizeMetrics,${dedupBamMetrics}.insert_size_metrics
hsMetricsJar,CalculateHsMetrics
hsMetrics,${dedupBamMetrics}.hs_metrics
hsMetricsNonAutosomalRegionChrX,${dedupBamMetrics}.nonAutosomalRegionChrX_hs_metrics
hsMetricsNonAutosomalRegionChrX,${dedupBamChrXMetrics}.nonAutosomalRegionChrX_hs_metrics
recreateInsertSizePdfR,createInsertSizePlot_c5.R
projectDellyAnnotatorOutputVcf,${samplePrefix}.delly.snpeff.hpo.vcf
collectBamMetricsPrefix,${intermediateDir}/${externalSampleID}.merged.dedup
Expand Down
3 changes: 3 additions & 0 deletions protocols/PrepareDragenData.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ combinedIdentifier=$(basename "${combinedIdentifier}")
echo "${combinedIdentifier}" > "${intermediateDir}/${externalSampleID}.txt"
rsync -av "${tmpDataDir}/${gsBatch}/Analysis/${combinedIdentifier}/${combinedIdentifier}.hard-filtered"*"vcf.gz"* "${intermediateDir}"


## rename (g)VCF files
rename "${combinedIdentifier}" "${externalSampleID}" "${intermediateDir}/${combinedIdentifier}.hard-filtered."*"vcf.gz"*

Expand All @@ -43,6 +44,8 @@ bgzip -c -f "${intermediateDir}/${externalSampleID}.variant.calls.genotyped.vcf.
echo "start indexing ${intermediateDir}/${externalSampleID}.variant.calls.genotyped.vcf.gz"
tabix -p vcf "${intermediateDir}/${externalSampleID}.variant.calls.genotyped.vcf.gz"

rsync -av "${intermediateDir}/${externalSampleID}.variant.calls.genotyped.vcf.gz" "${projectResultsDir}/variants/"

rename 'gvcf.gz' 'g.vcf.gz' "${intermediateDir}/${externalSampleID}.hard-filtered.gvcf.gz"*
rsync -av "${intermediateDir}/${externalSampleID}.hard-filtered.g.vcf.gz"* "${projectResultsDir}/variants/gVCF/"

Expand Down
5 changes: 5 additions & 0 deletions protocols/ReheaderVCF.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,23 @@ set -o pipefail
#string projectResultsDir
#string capturingKit
#string dataDir
#string concordanceCheckCallsVcf

module load "${bcfToolsVersion}"
module load "${htsLibVersion}"

##new prefix will be externalSampleID + sampleProcessStepIDwith new sample identifier --> familyname+umcgnumber
newGVCFSampleIdentifier=$(echo "${externalSampleID}" | awk 'BEGIN {FS="_"}{print $1"_"$2}')

oldIdentifier=$(cat "${intermediateDir}/${externalSampleID}.txt")
echo -e "old:${oldIdentifier}, new:${newGVCFSampleIdentifier}"
echo -e "${oldIdentifier} ${newGVCFSampleIdentifier}" > "${intermediateDir}/${externalSampleID}.newVCFHeader.txt"
echo -e "${oldIdentifier} ${externalSampleID}" > "${intermediateDir}/${externalSampleID}.newConcordanceCheckHeader.txt"

echo "##intervals=[${dataDir}/${capturingKit}/human_g1k_v37/captured.merged.bed]" > "${intermediateDir}/bedfile.txt"
bcftools reheader -s "${intermediateDir}/${externalSampleID}.newVCFHeader.txt" "${gavinOutputFinalMergedRLV}.gz" -o "${gavinOutputFinalMergedRLV}.gz.tmp"
bcftools reheader -s "${intermediateDir}/${externalSampleID}.newConcordanceCheckHeader.txt" "${concordanceCheckCallsVcf}" -o "${concordanceCheckCallsVcf}.tmp"
mv "${concordanceCheckCallsVcf}.tmp" "${concordanceCheckCallsVcf}"
bcftools annotate -h "${intermediateDir}/bedfile.txt" -O v -o "${gavinOutputFinalMergedRLV}.tmp.vcf.gz" "${gavinOutputFinalMergedRLV}.gz.tmp"
mv -v "${gavinOutputFinalMergedRLV}.tmp.vcf.gz" "${gavinOutputFinalMergedRLV}.gz"
tabix -f -p vcf "${gavinOutputFinalMergedRLV}.gz"
Expand Down