Skip to content

Commit

Permalink
Merge pull request #278 from openvar/features
Browse files Browse the repository at this point in the history
Update liftover.py
  • Loading branch information
Peter J. Freeman authored Apr 7, 2021
2 parents 10923fa + 63a5d7c commit 11651a2
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions VariantValidator/modules/liftover.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,42 +158,43 @@ def liftover(hgvs_genomic, build_from, build_to, hn, reverse_normalizer, evm, va
# identify the first transcript if any
options = validator.hdp.get_tx_mapping_options(tx)
for op in options:
sfm = None
sff = None
sft = None
if op[1].startswith('NC_'):
if build_to.startswith('GRC'):
sfm = seq_data.to_chr_num_refseq(op[1], build_to)
sft = seq_data.to_chr_num_refseq(op[1], build_to)
if build_to.startswith('hg'):
sfm = seq_data.to_chr_num_ucsc(op[1], build_to)
sft = seq_data.to_chr_num_ucsc(op[1], build_to)
if build_from.startswith('GRC'):
sfm = seq_data.to_chr_num_refseq(op[1], build_from)
sff = seq_data.to_chr_num_refseq(op[1], build_from)
if build_from.startswith('hg'):
sfm = seq_data.to_chr_num_ucsc(op[1], build_from)
if sfm is not None:
sff = seq_data.to_chr_num_ucsc(op[1], build_from)
if sff is not None and sft is not None:
selected.append([op[0], op[1]])
if liftover_level == 'primary':
continue
else:
if op[1].startswith('NT_'):
if build_to.startswith('GRC'):
sfm = seq_data.to_chr_num_refseq(op[1], build_to)
sft = seq_data.to_chr_num_refseq(op[1], build_to)
if build_to.startswith('hg'):
sfm = seq_data.to_chr_num_ucsc(op[1], build_to)
sft = seq_data.to_chr_num_ucsc(op[1], build_to)
if build_from.startswith('GRC'):
sfm = seq_data.to_chr_num_refseq(op[1], build_from)
sff = seq_data.to_chr_num_refseq(op[1], build_from)
if build_from.startswith('hg'):
sfm = seq_data.to_chr_num_ucsc(op[1], build_from)
if sfm is not None:
sff = seq_data.to_chr_num_ucsc(op[1], build_from)
if sff is not None and sft is not None:
selected.append([op[0], op[1]])
if op[1].startswith('NW_'):
if build_to.startswith('GRC'):
sfm = seq_data.to_chr_num_refseq(op[1], build_to)
sft = seq_data.to_chr_num_refseq(op[1], build_to)
if build_to.startswith('hg'):
sfm = seq_data.to_chr_num_ucsc(op[1], build_to)
sft = seq_data.to_chr_num_ucsc(op[1], build_to)
if build_from.startswith('GRC'):
sfm = seq_data.to_chr_num_refseq(op[1], build_from)
sff = seq_data.to_chr_num_refseq(op[1], build_from)
if build_from.startswith('hg'):
sfm = seq_data.to_chr_num_ucsc(op[1], build_from)
if sfm is not None:
sff = seq_data.to_chr_num_ucsc(op[1], build_from)
if sff is not None and sft is not None:
selected.append([op[0], op[1]])

# remove duplicate chroms
Expand Down

0 comments on commit 11651a2

Please sign in to comment.