Skip to content

Commit

Permalink
export variant info for debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
RoriCremer committed Jun 10, 2024
1 parent 75e78e2 commit ddd1141
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/variantstore/wdl/extract/hail_create_vat_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ def write_sites_only_vcf(ac_an_af_split, sites_only_vcf_path):
# create a filtered sites only VCF
hl.export_vcf(ht, sites_only_vcf_path)


+def add_variant_tracking_info(mt):
mt.rows() # only need the table of row fields
.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
.export('var_ids.tsv.bgz', parallel='header_per_shard')

def main(vds, ancestry_file_location, sites_only_vcf_path):
transforms = [
Expand All @@ -146,6 +149,9 @@ def main(vds, ancestry_file_location, sites_only_vcf_path):

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

# for debugging information
add_variant_tracking_info(mt)

# 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
write_sites_only_vcf(mt, sites_only_vcf_path)

Expand Down

0 comments on commit ddd1141

Please sign in to comment.