Clinical-Genomics / genmod

Annotate models of genetic inheritance patterns in variant files (vcf files)
http://Clinical-Genomics.github.io/genmod/
MIT License
78 stars 19 forks source link

Add parameters for penalty and threshold #138

Closed Jakob37 closed 1 month ago

Jakob37 commented 1 month ago

Description

This addresses two issues in Lund with using Genmod compounds.

  1. We use different threshold and score from those hard-coded here.
  2. For single cases, we do not want to apply a penalty (i.e. we would use --penalty 0 here).

Close #137

Further discussed with @dnil and @northwestwitch in: https://github.com/Clinical-Genomics/scout/issues/4823

Added

Changed

-

Fixed

-

How to prepare for test

How to test

Expected test outcome

Review

This version is a

Implementation Plan

Jakob37 commented 1 month ago

Parameters are tested such that they respond.

First no penalty is applied, yielding score -6 (which matches the RankResult).

Then a penalty of 5 is applied, changing the score to -6.

Finally, the threshold for penalty is lowered below the low scoring compound, thus avoiding the penalty by having a passing compound variant. Score going back to -6.

jakob@laptop:~/src/genmod$ /usr/bin/python3 -m genmod.commands.base compound -p 1 test/3_scored.vcf --penalty 0 | grep Compounds | tail -1 | cut -f8 | sed "s/.*;Compounds=/Compounds=/" | tr ";" "\n" | cat -n
     1  Compounds=SAMPLE_ID:21_46602317_C_G>-11.0
     2  GeneticModels=SAMPLE_ID:AD|AR_comp
     3  ModelScore=SAMPLE_ID:99
     4  RankScore=SAMPLE_ID:-6.0
     5  RankScoreNormalized=SAMPLE_ID:0.3037974683544304
     6  RankScoreMinMax=SAMPLE_ID:-30.0:49.0
     7  RankResult=-12|0|0|1|1|0|3|0|0|0|1
     8  CompoundsNormalized=SAMPLE_ID:21_46602317_C_G>0.620253164556962
jakob@laptop:~/src/genmod$ /usr/bin/python3 -m genmod.commands.base compound -p 1 test/3_scored.vcf --penalty 5 | grep Compounds | tail -1 | cut -f8 | sed "s/.*;Compounds=/Compounds=/" | tr ";" "\n" | cat -n
     1  Compounds=SAMPLE_ID:21_46602317_C_G>-16.0
     2  GeneticModels=SAMPLE_ID:AD|AR_comp
     3  ModelScore=SAMPLE_ID:99
     4  RankScore=SAMPLE_ID:-11.0
     5  RankScoreNormalized=SAMPLE_ID:0.24050632911392406
     6  RankScoreMinMax=SAMPLE_ID:-30.0:49.0
     7  RankResult=-12|0|0|1|1|0|3|0|0|0|1
     8  CompoundsNormalized=SAMPLE_ID:21_46602317_C_G>0.5569620253164558
jakob@laptop:~/src/genmod$ /usr/bin/python3 -m genmod.commands.base compound -p 1 test/3_scored.vcf --penalty 5 --threshold -20 | grep Compounds | tail -1 | cut -f8 | sed "s/.*;Compounds=/Compounds=/" | tr ";" "\n" | cat -n
     1  Compounds=SAMPLE_ID:21_46602317_C_G>-11.0
     2  GeneticModels=SAMPLE_ID:AD|AR_comp
     3  ModelScore=SAMPLE_ID:99
     4  RankScore=SAMPLE_ID:-6.0
     5  RankScoreNormalized=SAMPLE_ID:0.3037974683544304
     6  RankScoreMinMax=SAMPLE_ID:-30.0:49.0
     7  RankResult=-12|0|0|1|1|0|3|0|0|0|1
     8  CompoundsNormalized=SAMPLE_ID:21_46602317_C_G>0.620253164556962
Jakob37 commented 1 month ago

Not sure how to turn to with reviewing here. Maybe @dnil , @northwestwitch or @torbjorgen could give this a look?

Jakob37 commented 1 month ago

Thanks for the review @torbjorgen !

I don't have merge-access to the repo. Maybe someone else could help me merge this PR?

Jakob37 commented 1 month ago

I don't have access to this repo, so I am unable to merge / release.

Not sure who to ask. Could maybe @torbjorgen or @dnil help me out here? With merging or giving me access to the repo so I can do it myself.

dnil commented 1 month ago

I would call this a minor, since it adds functionality in a completely backwards compatible manner. It does not correct a bug per se, but almost. ;)

Jakob37 commented 1 month ago

Thanks for the review 🙏