Skip to content

Commit

Permalink
change documentation for scoring (#78)
Browse files Browse the repository at this point in the history
* scoring and documentation
  • Loading branch information
rannick authored Oct 4, 2024
1 parent a0a10d3 commit 7562368
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 9 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.1.0]

### Changed

- Scoring formula changed to:
$$
score = 0.8 * \sum_{tool}^{tools provided} f(fusion, tool) + 0.2 * \sum_{db}^{dbs provided} g(fusion, db)*w(db)
$$

Weights for databases are as follows:

* COSMIC (50)
* MITELMAN (50)
* FusionGDB2 (0)

## [3.0.0]

### Added
Expand Down
12 changes: 9 additions & 3 deletions docs/score.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ report different results, for example FusionCatcher will work best on somatic sa
You can customize weight of individual tool by specific parameter `<tool-name>_weight 30`.
The sum of the weights has to be 100!

Currently weights for databases are not adjustable. The weights for databases are as follows:
Weights for databases are as follows:

* COSMIC (50)
* MITELMAN (50)
Expand All @@ -24,5 +24,11 @@ Currently weights for databases are not adjustable. The weights for databases ar
The final formula for calculating score is:

$$
score = 0.5 * \sum_{tool}^{tools} f(fusion, tool)*w(tool) + 0.5 * \sum_{db}^{dbs} g(fusion, db)*w(db)
$$
score = 0.8 * \sum_{tool}^{tools provided} f(fusion, tool) + 0.2 * \sum_{db}^{dbs provided} g(fusion, db)*w(db)
$$

Weights for databases are as follows:

* COSMIC (50)
* MITELMAN (50)
* FusionGDB2 (0)
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 7562368

Please sign in to comment.