Skip to content

Tcs and implied loss scores - #93

Open
alpae wants to merge 5 commits into
devfrom
tcs-and-implied-loss-scores
Open

Tcs and implied loss scores#93
alpae wants to merge 5 commits into
devfrom
tcs-and-implied-loss-scores

Conversation

@alpae

@alpae alpae commented Aug 26, 2026

Copy link
Copy Markdown
Member

attempt to include two more scores into the orthoxml:

ImpliedLosses: number of implied gene loss for the subhog underneath the which stores the score.
TCSScore: Taxonomic congruence score as defined in the FoldTree publication. As taxonomy, the species tree given to FastOMA is used. We normalize the score with the number of genes. However, this does NOT mean the score is in the (0,1) range. This is also reflected when you run the example data. The TCS score can be <1 for a perfectly congruent HOG without any loss/gains.

alpae added 2 commits August 26, 2026 09:27
adds TCS score according to reference implementation.
adds implied loss score computing the nr of implied loss of a (sub)HOG.
adds unittests about the score calculation and update
the nf-test output with the addtional score lines
@alpae
alpae force-pushed the tcs-and-implied-loss-scores branch from a03c7d1 to b6bceaf Compare August 26, 2026 09:11
@alpae

alpae commented Aug 26, 2026

Copy link
Copy Markdown
Member Author

@sinamajidian what do you think about the tcs score? should we include it like this? (see my comment in the toplevel description.)

@sinamajidian

Copy link
Copy Markdown
Collaborator

looks useful! Thanks. would it be easy to have a flag to activate it or its computation and the increase in the orthoxml file size would be negligible?

@alpae

alpae commented Aug 27, 2026

Copy link
Copy Markdown
Member Author

extra size is quite fine: 2 additional lines per sub-hog (one for tcs score, on for implied loss). for the computation, I think I can benchmark this on a medium size dataset. will let you know. having a flag to active/deactivate would certainly be possible.

alpae added 2 commits August 29, 2026 07:05
Adds --store-completeness-score/--store-implied-losses-score/--store-tcs-score
options to fastoma-infer-subhogs (wired through FastOMA.nf as
store_completness_score/store_implied_losses_score/store_tcs_score params) so
score computation can be toggled per run.

collect_subhogs now looks ahead at the first HOG in the pickle folder to
only write scoreDef entries for scores actually present in the run's
output, instead of always writing all three.

compute time for score computation is tracked during the to_orthoxml()
call. Serialization is generally quick, score computation uses roughly
40% of the time.
The previous --store_*_score params (default true) were missing from
nextflow_schema.json, so nf-schema parsed CLI-supplied values as plain
strings instead of booleans -- a non-empty string is truthy in Groovy,
so --store_tcs_score false never actually disabled anything.

Switch to --disable_*_score (default false): setting the flag means
the user actively wants to disable the score, so bare presence of the
flag conveys the intent without needing a boolean value at all.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants