Skip to content

Commit

Permalink
Merge ccae7fa into 1b3fa5f
Browse files Browse the repository at this point in the history
  • Loading branch information
susannasiebert committed Oct 14, 2020
2 parents 1b3fa5f + ccae7fa commit 91d2047
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions lib/proximal_variant.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,20 @@ def find_phased_somatic_variant_and_potential_proximal_variants(self, somatic_va
print("Warning: Proximal variant does not contain any VEP annotations for alternate allele and will be skipped: {}".format(entry))
continue

#We assume that there is only one CSQ entry because the PICK option was used but we should double check that
if len(csq_entries) > 1:
print("Warning: There are multiple CSQ entries (consequences) for proximal variant {} and alternate allele {}. Using the first one.".format(entry, proximal_alt))

csq_entry = csq_entries[0]
picked_csq_entry = None
for csq_entry in csq_entries:
if csq_entry['Feature'] == transcript:
picked_csq_entry = csq_entry
if picked_csq_entry is None:
print("Warning: Proximal variant has no transcript annotation for somatic variant of interest transcript {} and will be skipped: {}".format(transcript, entry))
continue

consequences = {consequence.lower() for consequence in csq_entry['Consequence'].split('&')}
consequences = {consequence.lower() for consequence in picked_csq_entry['Consequence'].split('&')}
if 'missense_variant' not in consequences:
print("Warning: Proximal variant is not a missense mutation and will be skipped: {}".format(entry))
continue

if csq_entry['Feature'] != transcript:
print("Warning: Proximal variant transcript is not the same as the somatic variant transcript. Proximal variant will be skipped: {}".format(entry))
continue

potential_proximal_variants.append([entry, csq_entry])
potential_proximal_variants.append([entry, picked_csq_entry])

return (phased_somatic_variant, potential_proximal_variants)

Expand Down

0 comments on commit 91d2047

Please sign in to comment.