Skip to content

Commit

Permalink
use quality_scores or qualityscore_* from latest-flat to compute "suf…
Browse files Browse the repository at this point in the history
…ficiently evaluated" flag
  • Loading branch information
tomclegg committed Jun 29, 2012
1 parent a45a541 commit ba5dafe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion public_html/lib/evidence.php
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ function evidence_get_assoc_flat_summary ($snap, $variant_id)
{
$nonflat =& evidence_get_assoc ($snap, $variant_id);
$flat = array ();
foreach (array ("gene", "aa_change", "aa_change_short", "rsid", "impact", "qualified_impact", "inheritance", "quality_scores") as $k)
foreach (array ("gene", "aa_change", "aa_change_short", "rsid", "impact", "qualified_impact", "inheritance", "quality_scores", "variant_quality") as $k)
if (isset ($nonflat[$k]))
$flat[$k] = $nonflat[$k];
$flat["dbsnp_id"] = "";
Expand Down
22 changes: 14 additions & 8 deletions server/gff_getevidence_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def read_getev_flat(getev_flatfile):
# Pull only these items from the GET-Evidence json data:
items_wanted = ['gene', 'aa_change_short', 'summary_short', 'impact', \
'inheritance', 'dbsnp_id', 'in_omim', 'in_gwas', 'in_pharmgkb', \
'quality_scores', \
'variant_quality', 'overall_frequency_n', 'overall_frequency_d', \
'pph2_score', 'n_articles', 'variant_id']

Expand Down Expand Up @@ -110,8 +111,8 @@ def copy_output_data(getev_data, output_data):
'overall_frequency_d': 'denom',
'pph2_score': 'pph2_score',
'impact': 'variant_impact',
'quality': 'variant_quality',
'summary_short': 'summary_short',
'quality_scores': 'quality_scores',
'variant_quality': 'variant_quality',
'inheritance': 'variant_dominance',
'variant_id': 'variant_id',
Expand Down Expand Up @@ -237,14 +238,19 @@ def suff_eval(variant_data):
6 - disease penetrance
"""
# Check that we have the data we need, else return "False"
if "variant_quality" in variant_data:
quality_scores = variant_data["variant_quality"]
if "quality_scores" in variant_data:
quality_scores = variant_data["quality_scores"]
if (not quality_scores) or len(quality_scores) < 7:
return False
else:
return False
impact = variant_data["variant_impact"]
quality_scores = []
for k in ['in_silico', 'in_vitro', 'case_control', 'familial', 'severity', 'treatability', 'penetrance']:
if ('qualityscore_' + k) in variant_data:
quality_scores.append(variant_data['qualityscore_'+k])
else:
quality_scores.append('-')

impact = variant_data["variant_impact"]
# Must have either case_control or familial data
if quality_scores[2] == "-" and quality_scores[3] == "-":
return False
Expand All @@ -263,8 +269,8 @@ def suff_eval(variant_data):
return False
return True

def eval_scores(variant_quality):
scores = list(variant_quality)
def eval_scores(quality_scores):
scores = list(quality_scores)
for i in range(len(scores)):
if scores[i] == '-':
scores[i] = 0
Expand Down Expand Up @@ -295,7 +301,7 @@ def impact_rank(variant):
# combine for gene level ranking. -- MPB 5/11
impact_rank = 0
if suff_eval(variant):
evidence_eval, clin_importance = eval_scores(variant['variant_quality'])
evidence_eval, clin_importance = eval_scores(variant['quality_scores'])
if evidence_eval == 'Well-established':
impact_rank += 2
elif evidence_eval == 'Likely':
Expand Down

0 comments on commit ba5dafe

Please sign in to comment.