Skip to content

Commit

Permalink
feat: store memote score for annotation and consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
mihai-sysbio committed Mar 6, 2023
1 parent 4dcc451 commit 0e238cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def validate(nameWithOwner):
test_results.update(tests.yaml.validate(model))
test_results.update(tests.cobra.load(model))
test_results.update(tests.cobra.validateSBML(model))
test_results.update(tests.memote.get_consistency(model))
test_results.update(tests.memote.scoreAnnotationAndConsistency(model))
else:
print('is not following standard')
release_data = { 'standard-GEM' : [ { standard_version : gem_is_standard }, { 'test_results' : test_results} ] }
Expand Down
18 changes: 9 additions & 9 deletions tests/memote.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import memote
import cobra
import json
from memote.support import consistency
# needed by memote.support.consitency
from memote.support import consistency_helpers as con_helpers
import memote

def get_consistency(model_filename):
def scoreAnnotationAndConsistency(model_filename):
print(' memote scoring)
memote_score = 'Scoring failed'
errors = ''
is_consistent = 'Not tested'
try:
model = cobra.io.read_sbml_model(model_filename + '.xml')
is_consistent = consistency.check_stoichiometric_consistency(model)
_, results = memote.suite.api.test_model(model, None, True, None, {"basic", "annotation", "consistency"})
processed_results = memote.suite.api.snapshot_report(results, None, False)
results_json = json.loads(processed_results)
memote_score = results_json['score']['total_score']
except Exception as e:
errors = json.dumps(str(e))
print(e)

return {'memote-tests': { memote.__version__ : is_consistent, 'errors': errors } }
return {'memote-score': { memote.__version__ : is_consistent, 'errors': errors } }

0 comments on commit 0e238cc

Please sign in to comment.