Skip to content

Commit

Permalink
reheader FP vcfs from full hg38 to no_alt (#344)
Browse files Browse the repository at this point in the history
  • Loading branch information
SHuang-Broad authored Apr 11, 2023
1 parent 5d900f1 commit 0197e4a
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 3 deletions.
4 changes: 3 additions & 1 deletion wdl/pipelines/TechAgnostic/Utility/FindBamIdentity.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ workflow FindBamIdentity {
call FPUtils.PickGenotypeVCF { input: fingerprinting_vcf_gs_paths = ListGenotypedVCFs.vcf_gs_paths, vcf_name = vcf_filter_expression }

scatter (vcf in PickGenotypeVCF.vcfs) {
call FPUtils.ReheaderFullGRCh38VCFtoNoAlt {input: full_GRCh38_vcf = vcf}

call FPUtils.FilterGenotypesVCF {
input:
fingerprint_vcf = vcf
fingerprint_vcf = ReheaderFullGRCh38VCFtoNoAlt.reheadered_vcf
}
call FPUtils.ExtractGenotypingSites {
input:
Expand Down
5 changes: 3 additions & 2 deletions wdl/pipelines/TechAgnostic/Utility/VerifyFingerprint.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,16 @@ workflow VerifyFingerprint {
}

File gt_vcf = if (defined(use_this_fp_vcf)) then select_first([use_this_fp_vcf]) else select_first([PickGenotypeVCF.vcfs])[0]
call FPUtils.ReheaderFullGRCh38VCFtoNoAlt as reheader {input: full_GRCh38_vcf = gt_vcf}

call VariantUtils.GetVCFSampleName {
input:
fingerprint_vcf = gt_vcf
fingerprint_vcf = reheader.reheadered_vcf
}

call FPUtils.FilterGenotypesVCF {
input:
fingerprint_vcf = gt_vcf
fingerprint_vcf = reheader.reheadered_vcf
}

call FPUtils.ExtractGenotypingSites {
Expand Down
33 changes: 33 additions & 0 deletions wdl/tasks/QC/Fingerprinting.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -468,3 +468,36 @@ task CheckCLRFingerprint {
docker: select_first([runtime_attr.docker, default_attr.docker])
}
}
task ReheaderFullGRCh38VCFtoNoAlt {
meta {
desciption:
"Reheader the fingperint VCF that's generated with full GRCh38 reference to the no_alt header; project specific."
}

input {
File full_GRCh38_vcf
}

command <<<
set -eux

GREPCMD="grep"
if [[ ~{full_GRCh38_vcf} =~ \.gz$ ]]; then
GREPCMD="zgrep"
fi
"${GREPCMD}" -vF "_decoy,length=" ~{full_GRCh38_vcf} | \
grep -vF "_alt,length=" | \
grep -v "^##contig=<ID=HLA-" \
> "reheadered.fp.vcf"
>>>

output {
File reheadered_vcf = "reheadered.fp.vcf"
}

runtime {
disks: "local-disk 100 HDD"
docker: "gcr.io/cloud-marketplace/google/ubuntu2004:latest"
}
}

0 comments on commit 0197e4a

Please sign in to comment.