Skip to content

Commit ddd1141

Browse files
committed
export variant info for debugging
1 parent 75e78e2 commit ddd1141

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scripts/variantstore/wdl/extract/hail_create_vat_inputs.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,10 @@ def write_sites_only_vcf(ac_an_af_split, sites_only_vcf_path):
127127
# create a filtered sites only VCF
128128
hl.export_vcf(ht, sites_only_vcf_path)
129129

130-
130+
+def add_variant_tracking_info(mt):
131+
mt.rows() # only need the table of row fields
132+
.select(var_origin_id=hl.format('%s-%s-%s-%s', mt.locus.contig, mt.locus.position, mt.alleles[0], mt.alleles[1])) # leaves this as the only field
133+
.export('var_ids.tsv.bgz', parallel='header_per_shard')
131134

132135
def main(vds, ancestry_file_location, sites_only_vcf_path):
133136
transforms = [
@@ -146,6 +149,9 @@ def main(vds, ancestry_file_location, sites_only_vcf_path):
146149

147150
# potentially in the future: merge AC, AN, AF back to the original VDS with: vds = vds_ac_an_af(mt, vds)
148151

152+
# for debugging information
153+
add_variant_tracking_info(mt)
154+
149155
# create a sites only VCF (that is hard filtered!) and that can be made into a custom annotations TSV for Nirvana to use with AC, AN, AF, SC for all subpopulations and populations
150156
write_sites_only_vcf(mt, sites_only_vcf_path)
151157

0 commit comments

Comments
 (0)