Skip to content

Commit

Permalink
Updated header of output VCF to include all required fields
Browse files Browse the repository at this point in the history
  • Loading branch information
kjaisingh committed Jan 6, 2025
1 parent 0edef35 commit a2e7381
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
6 changes: 3 additions & 3 deletions inputs/values/dockers.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"samtools_cloud_docker": "us.gcr.io/broad-dsde-methods/gatk-sv/samtools-cloud:2024-10-25-v0.29-beta-5ea22a52",
"sv_base_docker": "us.gcr.io/broad-dsde-methods/gatk-sv/sv-base:2024-10-25-v0.29-beta-5ea22a52",
"sv_base_mini_docker": "us.gcr.io/broad-dsde-methods/gatk-sv/sv-base-mini:2024-10-25-v0.29-beta-5ea22a52",
"sv_pipeline_docker": "us-central1-docker.pkg.dev/talkowski-training/kj-development/sv-pipeline:kj-clean-vcf-c75c86a03011a1a29cd1b1445c6ec8df91aeee11",
"sv_pipeline_qc_docker": "us-central1-docker.pkg.dev/talkowski-training/kj-development/sv-pipeline:kj-clean-vcf-c75c86a03011a1a29cd1b1445c6ec8df91aeee11",
"sv_pipeline_docker": "us-central1-docker.pkg.dev/talkowski-training/kj-development/sv-pipeline:kj-clean-vcf-0edef35fe4b3020cab020dd59fdd23d2620f4be9",
"sv_pipeline_qc_docker": "us-central1-docker.pkg.dev/talkowski-training/kj-development/sv-pipeline:kj-clean-vcf-0edef35fe4b3020cab020dd59fdd23d2620f4be9",
"wham_docker": "us.gcr.io/broad-dsde-methods/gatk-sv/wham:2024-10-25-v0.29-beta-5ea22a52",
"igv_docker": "us.gcr.io/broad-dsde-methods/gatk-sv/igv:mw-xz-fixes-2-b1be6a9",
"duphold_docker": "us.gcr.io/broad-dsde-methods/gatk-sv/duphold:mw-xz-fixes-2-b1be6a9",
Expand All @@ -28,5 +28,5 @@
"sv_utils_docker": "us.gcr.io/broad-dsde-methods/gatk-sv/sv-utils:2024-10-25-v0.29-beta-5ea22a52",
"gq_recalibrator_docker": "us.gcr.io/broad-dsde-methods/markw/gatk:mw-tb-form-sv-filter-training-data-899360a",
"str": "us.gcr.io/broad-dsde-methods/gatk-sv/str:2023-05-23-v0.27.3-beta-e537bdd6",
"denovo": "us-central1-docker.pkg.dev/talkowski-training/kj-development/denovo:kj-clean-vcf-c75c86a03011a1a29cd1b1445c6ec8df91aeee11"
"denovo": "us-central1-docker.pkg.dev/talkowski-training/kj-development/denovo:kj-clean-vcf-0edef35fe4b3020cab020dd59fdd23d2620f4be9"
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ def process_record(record):


def process_svtype(record):
if record.info.get('SVTYPE') == 'DUP':
if not any(':ME' in alt for alt in record.alts):
record.alts = ('<DUP>',)
if not any(':ME' in alt for alt in record.alts):
record.alts = ('<' + record.info.get('SVTYPE') + '>',)
return record


Expand Down
9 changes: 8 additions & 1 deletion wdl/CleanVcfChromosome.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -579,8 +579,15 @@ task CleanVcfPostprocess {
bcftools annotate -x INFO/MULTIALLELIC,INFO/UNRESOLVED,INFO/EVENT,INFO/REVISED_EVENT,INFO/MULTI_CNV,INFO/varGQ processed.vcf.gz -o processed.annotated.vcf.gz -O z
bcftools view -h processed.annotated.vcf.gz | grep -v -E "CIPOS|CIEND|RMSSTD|source|bcftools|GATKCommandLine|##FORMAT=<ID=EV>|##ALT=<ID=UNR>|##INFO=<ID=(MULTIALLELIC|UNRESOLVED|EVENT|REVISED_EVENT|MULTI_CNV|varGQ)" > header.txt
bcftools view -h processed.annotated.vcf.gz | grep "^##" | \
grep -v -E "CIPOS|CIEND|RMSSTD|source|bcftools|GATKCommandLine|##FORMAT=<ID=EV>|##ALT=<ID=UNR>|##INFO=<ID=(MULTIALLELIC|UNRESOLVED|EVENT|REVISED_EVENT|MULTI_CNV|varGQ)" > temp_header.txt
echo '##INFO=<ID=UNRESOLVED_TYPE,Number=1,Type=String,Description="Class of unresolved variant.">' >> temp_header.txt
echo '##ALT=<ID=CNV,Description="Copy Number Polymorphism">' >> temp_header.txt
bcftools view -h processed.annotated.vcf.gz | grep "^#CHROM" > chrom_header.txt
cat temp_header.txt chrom_header.txt > header.txt
bcftools reheader -h header.txt processed.annotated.vcf.gz -o ~{output_vcf}
tabix -p vcf ~{output_vcf}
Expand Down

0 comments on commit a2e7381

Please sign in to comment.