gpsea.analysis.temporal package
The gpsea.analysis.temporal package implements comparison of survivals between genotype groups.
See Survival analysis for an example.
- class gpsea.analysis.temporal.Endpoint[source]
Bases:
ContinuousPartitioning
Endpoint computes survival for the analyzed individual.
An example endpoint includes
death()
,disease_onset()
, or onset of a phenotypic feature (hpo_onset()
).
- class gpsea.analysis.temporal.SurvivalAnalysis(statistic: SurvivalStatistic)[source]
Bases:
object
SurvivalAnalysis compares the survivals of genotype groups with respect to an
Endpoint
.The cohort is partitioned into groups using a genotype predicate and survival is computed for each cohort member. The difference between survivals is tested with selected
SurvivalStatistic
.- compare_genotype_vs_survival(cohort: Iterable[Patient], gt_predicate: GenotypePolyPredicate, endpoint: Endpoint) SurvivalAnalysisResult [source]
Execute the survival analysis on a given cohort.
- class gpsea.analysis.temporal.SurvivalAnalysisResult(gt_predicate: GenotypePolyPredicate, endpoint: Endpoint, statistic: SurvivalStatistic, data: DataFrame, pval: float)[source]
Bases:
MonoPhenotypeAnalysisResult
SurvivalAnalysisResult includes the results of a
SurvivalAnalysis
.The genotype categories and survival are reported in the data data frame with the following structure:
patient_id
genotype
phenotype
patient_1
0
Survival(value=123.4, is_censored=False)
patient_2
0
None
patient_3
None
Survival(value=456.7, is_censored=True)
patient_4
1
None
…
…
…
The index includes the individual IDs (patient_id), and then there are 2 columns with the genotype group id (
cat_id
) and the phenotype with the survival represented asSurvival
object.A genotype value may be missing (None) if the individual cannot be assigned into a genotype category. Similarly, a survival is None if computing the survival for an individual is impossible.
- class gpsea.analysis.temporal.Survival(value: float, is_censored: bool)[source]
Bases:
object
Information regarding individual’s survival.