Risk predictions for involvement patterns, given personalized diagnoses.
The predictions displayed in the risk predictor are not actually computed by the web
app. Instead, LyProX reconstructs one of the lymph.models
with the help of config
files - parsed by the lyscripts package - that can be found in any repos that define
a DVC pipeline.
This is probably the most complex interplay between the different libraries, so we will try to break it down as complrehensively as possible:
- The lymph Models
- The code implementing the mathematical models for lymphatic tumor progression are
provided by the lymph library. They implement the different
lymph.models
.
- DVC Pipelines in Paper Repos
- Our research group has, in the past, published a number of papers where we inferred the optimal parameters of various such models, given a cohort of patients. These sets of inferred parameter samples are referenced by a tool called DVC in different repositories with instructions on how to fetch them from a remote storage container.
- Reproducing Models with lyscripts
- However, these references are worthless without unambiguous instructions on how to
reconstruct the exact model that was used for inference. For this, we use the
lyscripts package. Its module
lyscripts.configs
provides a bunch ofpydantic.BaseModel
subclasses for defining basically every important aspect of the modelling process.
What happens in this "little" app now, is that one defines where it should look for
the YAML files that define a model and a sampling pipeline. This definition is stored
as a CheckpointModel
in the SQLite database. From instances of this class, one
can then validate the config files, fetch the samples from the remote storage using
DVC, and precompute prior state distributions from the trained model. See the docs
of the CheckpointModel
for a list of all the available methods and how they cache
their intermediate results using joblib
.
Consequently, a user can then head to the risk predictor's dashboard, select a
CheckpointModel
and have the web app compute specific risks defined via the
RiskpredictorForm
from the precomputed quantities. This actual risk predictions
happens in the predict
module of the app.
Module | admin |
Boilerplate code to register the CheckpointModel with the Django admin interface. |
Module | apps |
Boilerplate Django configuration for the riskpredictor app. |
Module | forms |
Forms used in the riskpredictor app. |
Package | management |
Undocumented |
Package | migrations |
Undocumented |
Module | models |
Models for the riskpredictor Django app. |
Module | predict |
Module for functions to predict the risk of lymphatic progression. |
Module | tests |
Undocumented |
Module | urls |
URLs related to the riskpredictor prediction app. |
Module | views |
Module for the views of the riskpredictor app. |