Graph Scoring¶
compute_networkin_score(motif_likelihood: float, context_likelihood: float) -> float
¶
Combine motif and STRING context likelihoods into the final NetworKIN score.
The NetworKIN score is defined as the product of the motif likelihood (from pynetphorest sequence scoring) and the STRING network context likelihood (derived from graph-based shortest-path distance).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
motif_likelihood
|
float
|
Likelihood ratio from the motif scoring step (>= 0). |
required |
context_likelihood
|
float
|
Likelihood ratio from the STRING network context scoring step (>= 0). |
required |
Returns:
| Type | Description |
|---|---|
float
|
NetworKIN score = motif_likelihood × context_likelihood. |
Examples:
Source code in src/pynetworkin/graph_scoring.py
filter_and_rank_predictions(predictions: list[dict[str, Any]], min_networkin: float = 2.0, min_motif: float = 0.05, top_k: int = 5) -> list[dict[str, Any]]
¶
Filter and rank kinase–substrate predictions by NetworKIN score.
Removes predictions below minimum score thresholds, then keeps only the top-k kinase candidates per (target protein, phosphosite position) pair, sorted by descending NetworKIN score.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
predictions
|
list of dict
|
Raw prediction rows as returned by |
required |
min_networkin
|
float
|
Minimum NetworKIN score to retain a prediction. Default is |
2.0
|
min_motif
|
float
|
Minimum motif probability to retain a prediction. Default is |
0.05
|
top_k
|
int
|
Maximum number of kinase predictions to keep per (protein, position)
pair. Default is |
5
|
Returns:
| Type | Description |
|---|---|
list of dict
|
Filtered and ranked prediction rows in the same format as the input.
The list is sorted by ( |
Notes
Predictions recovered by the false-negative recovery step
(recovered = True) may have "Motif probability" set to -1.0
as a sentinel value. Such rows will be excluded by the min_motif
filter unless you set min_motif to a negative value.