Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Commit

Permalink
Catching absence of MAF info in VEP response
Browse files Browse the repository at this point in the history
  • Loading branch information
dzerbino committed Jul 31, 2017
1 parent 63040d0 commit 8f0af33
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 24 deletions.
7 changes: 0 additions & 7 deletions lib/postgap/Cisreg.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,12 +306,6 @@ def run(self, snps, tissues):
res = []
for hit in transcript_consequences:
for consequence in hit['transcript_consequences']:
MAFs = None
for variant in hit['colocated_variants']:
if variant['id'] == hit['id']:
MAFs = variant
break

res.append(Cisregulatory_Evidence(
snp = snp_hash[hit['input']],
gene = postgap.Ensembl_lookup.get_ensembl_gene(consequence['gene_id']),
Expand All @@ -321,7 +315,6 @@ def run(self, snps, tissues):
tissue = None,
info = {
'consequence_terms': consequence['consequence_terms'],
'MAFs': MAFs
}
))

Expand Down
31 changes: 14 additions & 17 deletions lib/postgap/Reg.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,23 +178,20 @@ def run(self, snps, tissues):
snp_hash = dict( (snp.rsID, snp) for snp in snps)
res = []
for hit in list:
MAFs = None
for variant in hit['colocated_variants']:
if variant['id'] == hit['id']:
MAFs = variant
break

if MAFs is not None:
res.append(Regulatory_Evidence(
snp = snp_hash[hit['input']],
score = 0,
source = self.display_name,
study = None,
tissue = None,
info = {
'MAFs': MAFs
}
))
if 'colocated_variants' in hit:
for variant in hit['colocated_variants']:
if variant['id'] == hit['id']:
res.append(Regulatory_Evidence(
snp = snp_hash[hit['input']],
score = 0,
source = self.display_name,
study = None,
tissue = None,
info = {
'MAFs': variant
}
))
break

self.logger.info("\tFound %i interactions in VEP" % (len(res)))

Expand Down

0 comments on commit 8f0af33

Please sign in to comment.