Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
rannick committed Oct 4, 2024
1 parent 7a1b7be commit 961ff91
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions fusion_report/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,16 @@ def score(self, params: Namespace) -> None:
at https://github.com/matq007/fusion-report/docs/scoring-fusion
"""
tools_provided = 0
for tool in ['ericscript', 'fusioncatcher', 'starfusion', 'arriba', 'pizzly', "squid", "dragen", 'jaffa']:
for tool in [
"ericscript",
"fusioncatcher",
"starfusion",
"arriba",
"pizzly",
"squid",
"dragen",
"jaffa",
]:
if getattr(params, tool) is not None:
tools_provided += 1

Expand All @@ -224,14 +233,13 @@ def score(self, params: Namespace) -> None:

# database estimation
db_hits: float = sum(
float(Settings.FUSION_WEIGHTS[db_name.lower()]) for db_name in fusion.dbs)
float(Settings.FUSION_WEIGHTS[db_name.lower()]) for db_name in fusion.dbs
)

db_score: float = db_hits/db_provided
db_score: float = db_hits / db_provided

score: float = float("%0.3f" % (0.8 * tool_score + 0.2 * db_score))
score_explained = (
f'0.8 * ({len(fusion.tools)} / {tools_provided}) + 0.2 * ({(db_hits)} / {db_provided})'
)
score_explained = f"0.8 * ({len(fusion.tools)} / {tools_provided}) + 0.2 * ({(db_hits)} / {db_provided})"
fusion.score, fusion.score_explained = score, score_explained

@staticmethod
Expand Down

0 comments on commit 961ff91

Please sign in to comment.