Skip to content

Commit

Permalink
Final small fix for EI-CoreBioinformatics#154
Browse files Browse the repository at this point in the history
  • Loading branch information
lucventurini committed Mar 22, 2019
1 parent 2a62165 commit 00d4bd8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Mikado/loci/abstractlocus.py
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,9 @@ def _calculate_score(self, param):
if not rhasattr(self.transcripts[tid], metric_key):
raise KeyError("Asked for an invalid metric in filter: {}".format(metric_key))
metric_to_evaluate = rgetattr(self.transcripts[tid], metric_key)
if "external" in metric_key:
metric_to_evaluate = metric_to_evaluate[0]

check = self.evaluate(metric_to_evaluate, self.json_conf["scoring"][param]["filter"])
if not check:
del metrics[tid]
Expand Down
3 changes: 3 additions & 0 deletions Mikado/loci/locus.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,9 @@ def __check_as_requirements(self, transcript: Transcript) -> bool:
for key in self.json_conf["as_requirements"]["parameters"]:
value = rgetattr(transcript,
self.json_conf["as_requirements"]["parameters"][key]["name"])
if "external" in key:
value = value[0]

evaluated[key] = self.evaluate(
value,
self.json_conf["as_requirements"]["parameters"][key])
Expand Down

0 comments on commit 00d4bd8

Please sign in to comment.