dae.pheno_tool package

Submodules

dae.pheno_tool.tool module

class dae.pheno_tool.tool.PhenoResult[source]

Bases: object

Represents a result of PhenoTool calculation.

set_negative_stats(n_count: int, n_mean: float, n_std: float) None[source]
set_positive_stats(p_count: int, p_mean: float, p_std: float) None[source]
class dae.pheno_tool.tool.PhenoTool(phenotype_data: PhenotypeData, measure_id: str, person_ids: list[str] | None = None, family_ids: list[str] | None = None, normalize_by: list[dict[str, str]] | None = None)[source]

Bases: object

Tool to estimate dependency between variants and phenotype measrues.

Arguments of the constructor are:

phenotype_data – an instance of PhenotypeData

measure_id – a phenotype measure ID

person_ids – an optional list of person IDs to filter the phenotype database with

normalize_by – list of continuous measure names. Default value is an empty list

calc(variants: Counter, sex_split: bool = False) dict[str, dae.pheno_tool.tool.PhenoResult] | PhenoResult[source]

Perform calculation.

variants – an instance of Counter, matching personIds to an amount of variants

sex_split – should we split the result by sex or not. Default is False.

static join_pheno_df_with_variants(pheno_df: DataFrame, variants: Counter) DataFrame[source]

Join phenotype dataframe with variants.

class dae.pheno_tool.tool.PhenoToolHelper(genotype_data: GenotypeData, phenotype_data: PhenotypeData)[source]

Bases: object

Helper class for PhenoTool.

Collects variants and person ids from genotype data.

Arguments of the constructor are:

genotype_data – an instance of StudyWrapper

genotype_data_persons(family_ids: list[str] | None = None, roles: list[dae.variants.attributes.Role] | None = None) set[str][source]

Collect person ids from genotype data.

genotype_data_variants(data: dict, effect_groups: list[str]) dict[str, collections.Counter][source]

Collect effect groups variants.

Module contents