gpsea.analysis.temporal.endpoint package

The gpsea.analysis.temporal.endpoint package provides endpoints for comparing survivals between genotype groups.

gpsea.analysis.temporal.endpoint.death(timeline: Literal['gestational', 'postnatal'] = 'postnatal') Endpoint[source]

Get Endpoint for computing time until death of an individual or until the individual is lost from the study without knowing about the time of death.

The time of death is computed from individual’s vital status with the following rules:

  • If the individual is labeled as DECEASED, we compute the survival from the age of death.

  • If the individual is ALIVE or the status is missing, we use the age at last encounter as the censored survival.

  • If the age at last encounter is missing or if the age does not match the target timeline (e.g. timeline==postnatal but the individual has gestational age) then we cannot compute the survival and the endpoint returns None.

gpsea.analysis.temporal.endpoint.disease_onset(disease_id: str | TermId, timeline: Literal['gestational', 'postnatal'] = 'postnatal') Endpoint[source]

Get Endpoint to compute time until onset of a disease or until the individual is lost from the study.

The onset of diagnosis is computed from the onset field of a Disease with the following rules:

  • If the individual is diagnosed with the target disease and its onset is known, then the survival is computed from the disease onset.

  • If the individual is not diagnosed with the disease and the age at last encounter is known, this age is used as censored survival.

  • If the age at last encounter is missing or if the age does not match the target timeline (e.g. timeline==postnatal but the individual’s age is on gestational timeline) then we cannot compute the time until disease onset and the endpoint returns None.

gpsea.analysis.temporal.endpoint.hpo_onset(hpo: MinimalOntology, term_id: str | TermId, timeline: Literal['gestational', 'postnatal'] = 'postnatal') Endpoint[source]

Get Endpoint to compute time until onset of an HPO term or until the individual is lost from the study.

The HPO term onset is computed from the onset field of a Phenotype with the following rules:

  • If the individual is annotated with the target HPO term and its onset is known, then the survival is computed from the term’s onset.

  • If the individual is not diagnosed with the term and the age at last encounter is known, this age is used as censored survival.

  • If the age at last encounter is missing or if the age does not match the target timeline (e.g. timeline==postnatal but the individual has gestational age) then we cannot compute time until phenotype onset and the endpoint returns None.