dae.enrichment_tool package
Submodules
dae.enrichment_tool.background module
dae.enrichment_tool.background_facade module
dae.enrichment_tool.event_counters module
- class dae.enrichment_tool.event_counters.CounterBase(counter_id: str)[source]
Bases:
ABC
Class to represent enrichement events counter object.
- event_counts(variant_events: list[dae.enrichment_tool.genotype_helper.VariantEvent], children_by_sex: ChildrenBySex, effect_types: Iterable[str]) EventCountersResult [source]
Calculate the event counts from the given variant events.
- Args:
- variant_events (list[VariantEvent]):
A list of variant events.
- children_by_sex (dict[str, set[tuple[str, str]]]):
A dictionary mapping sex to a set of child IDs.
- effect_types (Iterable[str]):
An iterable of effect types.
- Returns:
EventCountersResult: An object containing the event counters.
- abstract events(variant_events: list[dae.enrichment_tool.genotype_helper.VariantEvent], children_by_sex: ChildrenBySex, effect_types: Iterable[str]) EventsResult [source]
- select_events_in_person_set(variant_events: list[dae.enrichment_tool.genotype_helper.VariantEvent], persons: set[tuple[str, str]]) list[dae.enrichment_tool.genotype_helper.VariantEvent] [source]
Select variant events that occur in the passed persons.
- split_events(variant_events: list[dae.enrichment_tool.genotype_helper.VariantEvent], children_by_sex: ChildrenBySex) VariantEventsResult [source]
Split the passed variant events based on the children’s sex.
- Args:
- variant_events (list[VariantEvent]): The list of variant events
to be split.
- children_by_sex (dict[str, set[tuple[str, str]]]): A dictionary
containing children grouped by sex.
- Returns:
VariantEventsResult: An object containing the split variant events.
- class dae.enrichment_tool.event_counters.EnrichmentResult(all: EnrichmentSingleResult, rec: EnrichmentSingleResult, male: EnrichmentSingleResult, female: EnrichmentSingleResult, unspecified: EnrichmentSingleResult, rec_genes: set[str] | None = None)[source]
Bases:
object
Represents result of calculating enrichment test.
- female: EnrichmentSingleResult
- male: EnrichmentSingleResult
- rec_genes: set[str] | None = None
- unspecified: EnrichmentSingleResult
- class dae.enrichment_tool.event_counters.EnrichmentSingleResult(name: str, events: int, overlapped: int, expected: float, pvalue: float, overlapped_genes: set[str] | None = None)[source]
Bases:
object
Represents result of enrichment tool calculations.
Supported fields are:
name
events – list of events found
overlapped – list of overlapped events
expected – number of expected events
pvalue
- class dae.enrichment_tool.event_counters.EventCountersResult(all: int, rec: int, male: int, female: int, unspecified: int, rec_genes: set[str] | None = None)[source]
Bases:
object
Represents result of event counting.
- all: int
- female: int
- static from_events_result(events: EventsResult) EventCountersResult [source]
- male: int
- rec: int
- rec_genes: set[str] | None = None
- unspecified: int
- class dae.enrichment_tool.event_counters.EventsCounter[source]
Bases:
CounterBase
Events counter class.
- events(variant_events: list[dae.enrichment_tool.genotype_helper.VariantEvent], children_by_sex: ChildrenBySex, effect_types: Iterable[str]) EventsResult [source]
- class dae.enrichment_tool.event_counters.EventsResult(all: 'list[list[str]]', rec: 'list[list[str]]', male: 'list[list[str]]', female: 'list[list[str]]', unspecified: 'list[list[str]]')[source]
Bases:
object
- all: list[list[str]]
- female: list[list[str]]
- male: list[list[str]]
- rec: list[list[str]]
- unspecified: list[list[str]]
- class dae.enrichment_tool.event_counters.GeneEventsCounter[source]
Bases:
CounterBase
Counts events in genes.
- events(variant_events: list[dae.enrichment_tool.genotype_helper.VariantEvent], children_by_sex: ChildrenBySex, effect_types: Iterable[str]) EventsResult [source]
Count the events by sex and effect type.
- class dae.enrichment_tool.event_counters.VariantEventsResult(all: 'list[VariantEvent]', rec: 'list[VariantEvent]', male: 'list[VariantEvent]', female: 'list[VariantEvent]', unspecified: 'list[VariantEvent]')[source]
Bases:
object
- female: list[dae.enrichment_tool.genotype_helper.VariantEvent]
- unspecified: list[dae.enrichment_tool.genotype_helper.VariantEvent]
- dae.enrichment_tool.event_counters.filter_denovo_one_event_per_family(variant_events: list[dae.enrichment_tool.genotype_helper.VariantEvent], requested_effect_types: Iterable[str]) list[list[str]] [source]
For each variant returns list of affected gene syms.
vs - generator for variants.
This functions receives a generator for variants and transforms each variant into list of gene symbols, that are affected by the variant.
The result is represented as list of lists.
- dae.enrichment_tool.event_counters.filter_denovo_one_gene_per_events(variant_events: list[dae.enrichment_tool.genotype_helper.VariantEvent], requested_effect_types: Iterable[str]) list[list[str]] [source]
- dae.enrichment_tool.event_counters.filter_denovo_one_gene_per_recurrent_events(variant_events: list[dae.enrichment_tool.genotype_helper.VariantEvent], requsted_effect_types: Iterable[str]) list[list[str]] [source]
Collect only events that occur in more than one family.
- dae.enrichment_tool.event_counters.filter_overlapping_events(events: list[list[str]], gene_syms: list[str]) list[list[str]] [source]
- dae.enrichment_tool.event_counters.get_sym_2_fn(variant_events: list[dae.enrichment_tool.genotype_helper.VariantEvent], requested_effect_types: Iterable[str]) dict[str, int] [source]
Count the number of requested effect types events in genes.
- dae.enrichment_tool.event_counters.overlap_enrichment_result_dict(events_counts: EventsResult, gene_syms: Iterable[str]) EventsResult [source]
Calculate the overlap between all events and requested gene syms.
- dae.enrichment_tool.event_counters.overlap_event_counts(events_counts: EventsResult, gene_syms: Iterable[str]) EventCountersResult [source]
dae.enrichment_tool.genotype_helper module
- class dae.enrichment_tool.genotype_helper.AlleleEvent(persons: set[tuple[str, str]], effect_genes: set[dae.enrichment_tool.genotype_helper.GeneEffect])[source]
Bases:
object
- effect_genes: set[dae.enrichment_tool.genotype_helper.GeneEffect]
- persons: set[tuple[str, str]]
- class dae.enrichment_tool.genotype_helper.GeneEffect(gene: str, effect: str)[source]
Bases:
object
- effect: str
- gene: str
- class dae.enrichment_tool.genotype_helper.GenotypeHelper(genotype_data: GenotypeData, person_set_collection: PersonSetCollection, effect_types: list[str] | None = None, genes: list[str] | None = None)[source]
Bases:
object
Genotype helper for enrichment tools.
- static collect_denovo_events(denovo_variants: Iterable[FamilyVariant]) list[dae.enrichment_tool.genotype_helper.VariantEvent] [source]
Collect denovo events.
- get_denovo_events() list[dae.enrichment_tool.genotype_helper.VariantEvent] [source]
- class dae.enrichment_tool.genotype_helper.VariantEvent(family_id: str, fvuid: str, allele_events: list[dae.enrichment_tool.genotype_helper.AlleleEvent])[source]
Bases:
object
- allele_events: list[dae.enrichment_tool.genotype_helper.AlleleEvent]
- family_id: str
- fvuid: str