dae.gene_sets package

Subpackages

Submodules

dae.gene_sets.denovo_gene_set_collection module

class dae.gene_sets.denovo_gene_set_collection.DenovoGeneSetCollection(study_id: str, study_name: str, dgsc_config: DenovoGeneSetsConfig, pscs: dict[str, PersonSetCollection])[source]

Bases: object

Class representing a study’s denovo gene sets.

add_gene(gene_effects: list[tuple[str, str]], persons: list[Person]) None[source]

Add a gene to the cache.

static build_collection(genotype_data: GenotypeData) DenovoGeneSetCollection | None[source]

Generate a denovo gene set collection for a study.

static create_empty_collection(study: GenotypeData) DenovoGeneSetCollection | None[source]

Create an empty denovo gene set collection for a genotype data.

classmethod get_all_gene_sets(denovo_gene_sets: list[DenovoGeneSetCollection], denovo_gene_set_spec: dict[str, dict[str, list[str]]]) list[dict[str, Any]][source]

Return all gene sets from provided denovo gene set collections.

get_gene_set(dgsc_query: str | DGSCQuery) GeneSet | None[source]

Return a gene set from the collection.

classmethod get_gene_set_from_collections(gene_set_id: str, denovo_gene_set_collections: list[DenovoGeneSetCollection], denovo_gene_set_spec: dict[str, dict[str, list[str]]]) dict[str, Any] | None[source]

Return a single set from provided denovo gene set collections.

get_gene_sets_types_legend() dict[str, Any][source]

Return dict with legends for each collection.

get_person_set_collection_legend(psc_id: str) list[dict[str, Any]][source]

Return the domain (used as a legend) of a person set collection.

is_cached(cache_dir: str) bool[source]

Check if all the cache files exist.

load(cache_dir: str) None[source]

Load cached denovo gene set collection from a cache files.

save(cache_dir: str) None[source]

Save the denovo gene set collection to a cache files.

dae.gene_sets.denovo_gene_set_helpers module

class dae.gene_sets.denovo_gene_set_helpers.DenovoGeneSetHelpers[source]

Bases: object

Helper functions for creation of denovo gene sets.

classmethod build_collection(study: GenotypeData, *, force: bool = False) DenovoGeneSetCollection | None[source]

Build a denovo gene set collection for a study and save it.

classmethod load_collection(study: GenotypeData) DenovoGeneSetCollection | None[source]

Load a denovo gene set collection for a given study.

classmethod load_collection_from_dict(study: GenotypeData, cache: dict) DenovoGeneSetCollection | None[source]

Load a denovo gene set collection for a given study.

dae.gene_sets.denovo_gene_sets_config module

class dae.gene_sets.denovo_gene_sets_config.DGSCQuery(*, gene_set_id: str, psc_id: str, selected_person_sets: set[str], effects: list[EffectsCriteria], sex: list[SexesCriteria], recurrency: SingleCriteria | RecurrentCriteria | TripleCriteria | None)[source]

Bases: BaseModel

Query for de novo gene set collection.

effects: list[EffectsCriteria]
gene_set_id: str
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'effects': FieldInfo(annotation=list[EffectsCriteria], required=True), 'gene_set_id': FieldInfo(annotation=str, required=True), 'psc_id': FieldInfo(annotation=str, required=True), 'recurrency': FieldInfo(annotation=Union[SingleCriteria, RecurrentCriteria, TripleCriteria, NoneType], required=True), 'selected_person_sets': FieldInfo(annotation=set[str], required=True), 'sex': FieldInfo(annotation=list[SexesCriteria], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

psc_id: str
recurrency: RecurrencyCriteria | None
selected_person_sets: set[str]
sex: list[SexesCriteria]
class dae.gene_sets.denovo_gene_sets_config.DGSSpec(*, gene_set_id: str, criterias: dict[str, EffectsCriteria | SexesCriteria | SingleCriteria | RecurrentCriteria | TripleCriteria])[source]

Bases: BaseModel

De novo gene set specification.

criterias: dict[str, EffectsCriteria | SexesCriteria | RecurrencyCriteria]
gene_set_id: str
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'criterias': FieldInfo(annotation=dict[str, Union[EffectsCriteria, SexesCriteria, SingleCriteria, RecurrentCriteria, TripleCriteria]], required=True), 'gene_set_id': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class dae.gene_sets.denovo_gene_sets_config.DenovoGeneSetsConfig(*, enabled: bool, selected_person_set_collections: list[str], effect_types: dict[str, EffectsCriteria], sexes: dict[str, SexesCriteria], recurrency: dict[str, SingleCriteria | RecurrentCriteria | TripleCriteria], gene_sets_ids: list[str])[source]

Bases: BaseModel

Configuration for de novo gene sets.

effect_types: dict[str, EffectsCriteria]
enabled: bool
gene_sets_ids: list[str]
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'effect_types': FieldInfo(annotation=dict[str, EffectsCriteria], required=True), 'enabled': FieldInfo(annotation=bool, required=True), 'gene_sets_ids': FieldInfo(annotation=list[str], required=True), 'recurrency': FieldInfo(annotation=dict[str, Union[SingleCriteria, RecurrentCriteria, TripleCriteria]], required=True), 'selected_person_set_collections': FieldInfo(annotation=list[str], required=True), 'sexes': FieldInfo(annotation=dict[str, SexesCriteria], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

recurrency: dict[str, RecurrencyCriteria]
selected_person_set_collections: list[str]
sexes: dict[str, SexesCriteria]
class dae.gene_sets.denovo_gene_sets_config.EffectsCriteria(*, name: str, effects: list[str])[source]

Bases: BaseModel

Criteria for filtering effect types.

effects: EffectTypes
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'effects': FieldInfo(annotation=list[str], required=True, metadata=[AfterValidator(func=<function _validate_effect_types>)]), 'name': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: str
class dae.gene_sets.denovo_gene_sets_config.RecurrentCriteria(*, name: Literal['Recurrent'], start: Literal[2], end: Literal[-1])[source]

Bases: BaseModel

Recurrent recurrency criteria.

end: Literal[-1]
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'end': FieldInfo(annotation=Literal[-1], required=True), 'name': FieldInfo(annotation=Literal['Recurrent'], required=True), 'start': FieldInfo(annotation=Literal[2], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: Literal['Recurrent']
start: Literal[2]
class dae.gene_sets.denovo_gene_sets_config.SexesCriteria(*, name: str, sexes: list[Sex])[source]

Bases: BaseModel

Criteria for filtering sexes.

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'name': FieldInfo(annotation=str, required=True), 'sexes': FieldInfo(annotation=list[Sex], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: str
sexes: list[Sex]
class dae.gene_sets.denovo_gene_sets_config.SingleCriteria(*, name: Literal['Single'], start: Literal[1], end: Literal[2])[source]

Bases: BaseModel

Single recurrency criteria.

end: Literal[2]
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'end': FieldInfo(annotation=Literal[2], required=True), 'name': FieldInfo(annotation=Literal['Single'], required=True), 'start': FieldInfo(annotation=Literal[1], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: Literal['Single']
start: Literal[1]
class dae.gene_sets.denovo_gene_sets_config.TripleCriteria(*, name: Literal['Triple'], start: Literal[3], end: Literal[-1])[source]

Bases: BaseModel

Triple recurrency criteria.

end: Literal[-1]
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'end': FieldInfo(annotation=Literal[-1], required=True), 'name': FieldInfo(annotation=Literal['Triple'], required=True), 'start': FieldInfo(annotation=Literal[3], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

name: Literal['Triple']
start: Literal[3]
dae.gene_sets.denovo_gene_sets_config.create_denovo_gene_set_spec(gene_set_id: str, config: DenovoGeneSetsConfig) DGSSpec[source]

Create de novo gene set specification from name.

dae.gene_sets.denovo_gene_sets_config.parse_denovo_gene_sets_config(config: dict[str, Any], *, study_person_set_collections: dict[str, Any] | None = None, has_denovo: bool = False) DenovoGeneSetsConfig | None[source]

Parse de novo gene sets configuration.

dae.gene_sets.denovo_gene_sets_config.parse_denovo_gene_sets_study_config(study_config: dict[str, Any], *, has_denovo: bool = False) DenovoGeneSetsConfig | None[source]

Parse de novo gene sets study configuration.

dae.gene_sets.denovo_gene_sets_config.parse_dgsc_query(gene_set_spec: str, dgsc_config: DenovoGeneSetsConfig) DGSCQuery[source]

Parse de novo gene set collection query.

dae.gene_sets.denovo_gene_sets_config.parse_recurrency_criteria(name: str, recurrency_criteria: dict[str, Any]) SingleCriteria | RecurrentCriteria | TripleCriteria[source]

Parse recurrency criteria.

dae.gene_sets.denovo_gene_sets_db module

class dae.gene_sets.denovo_gene_sets_db.DenovoGeneSetsDb(gpf_instance: Any)[source]

Bases: object

Class to manage available de Novo gene sets.

build_cache(genotype_data_ids: list[str], *, force: bool = False) None[source]

Build cache for de Novo gene sets for specified genotype data IDs.

property collections_descriptions: list[dict[str, Any]]

Return gene set descriptions.

property denovo_gene_sets_types: list[dict[str, Any]]

Return denovo gene sets types descriptions.

get_all_gene_sets(denovo_gene_set_spec: dict[str, dict[str, list[str]]], collection_id: str = 'denovo') list[dict[str, Any]][source]

Return all de Novo gene sets matching the spec for permitted DS.

get_collection_types_legend(gs_collection_id: str) dict[str, Any][source]
get_gene_set(gene_set_id: str, gene_set_spec: dict[str, dict[str, list[str]]], collection_id: str = 'denovo') dict[str, Any] | None[source]

Return de Novo gene set matching the spec for permitted datasets.

get_gene_set_ids(genotype_data_id: str) list[str][source]
get_genotype_data_ids() set[str][source]

Return list of genotype data IDs with denovo gene sets.

has_gene_sets() bool[source]
reload() None[source]
update_cache(db_cache: dict[str, Any]) None[source]

Load a dictionary of caches.

dae.gene_sets.gene_sets_db module

Classes for handling of gene sets.

class dae.gene_sets.gene_sets_db.BaseGeneSetCollection(collection_id: str)[source]

Bases: ABC

Base class for gene set collections.

abstract get_all_gene_sets() list[GeneSet][source]

Return list of all gene sets in the collection.

abstract get_gene_set(gene_set_id: str) GeneSet | None[source]

Return the gene set if found; returns None if not found.

class dae.gene_sets.gene_sets_db.BaseResourceSchema(*, type: str | None = None, meta: MetaSchema | None = None)[source]

Bases: BaseModel

meta: MetaSchema | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'meta': FieldInfo(annotation=Union[MetaSchema, NoneType], required=False, default=None), 'type': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

type: str | None
class dae.gene_sets.gene_sets_db.CategoricalHistogramSchema(*, type: Literal['categorical'], displayed_values_count: int | None = None, displayed_values_percent: float | None = None, value_order: list[str | int] | None = None, y_log_scale: bool | None = None, label_rotation: int | None = None, plot_function: str | None = None, enforce_type: bool | None = None, natural_order: bool | None = None)[source]

Bases: BaseModel

displayed_values_count: int | None
displayed_values_percent: float | None
enforce_type: bool | None
label_rotation: int | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'displayed_values_count': FieldInfo(annotation=Union[int, NoneType], required=False, default=None), 'displayed_values_percent': FieldInfo(annotation=Union[float, NoneType], required=False, default=None), 'enforce_type': FieldInfo(annotation=Union[bool, NoneType], required=False, default=None), 'label_rotation': FieldInfo(annotation=Union[int, NoneType], required=False, default=None), 'natural_order': FieldInfo(annotation=Union[bool, NoneType], required=False, default=None), 'plot_function': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'type': FieldInfo(annotation=Literal['categorical'], required=True), 'value_order': FieldInfo(annotation=Union[list[Union[str, int]], NoneType], required=False, default=None), 'y_log_scale': FieldInfo(annotation=Union[bool, NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

natural_order: bool | None
plot_function: str | None
type: Literal['categorical']
value_order: list[str | int] | None
y_log_scale: bool | None
class dae.gene_sets.gene_sets_db.GeneSet(name: str, desc: str, syms: list[str])[source]

Bases: object

Class representing a set of genes.

count: int
desc: str
name: str
syms: list[str]
class dae.gene_sets.gene_sets_db.GeneSetCollection(resource: GenomicResource)[source]

Bases: BaseGeneSetCollection

Class representing a collection of gene sets in a resource.

add_statistics_build_tasks(task_graph: TaskGraph, **kwargs: Any) list[Task][source]
calc_info_hash() bytes[source]
calc_statistics_hash() bytes[source]
property files: set[str]

Return a list of resource files the implementation utilises.

get_all_gene_sets() list[GeneSet][source]

Return list of all gene sets in the collection.

get_gene_set(gene_set_id: str) GeneSet | None[source]

Return the gene set if found; returns None if not found.

get_gene_sets_per_gene_hist_filename() str[source]
get_genes_per_gene_set_hist_filename() str[source]
load_gene_sets() dict[str, GeneSet][source]

Build a gene set collection from a given GenomicResource.

class dae.gene_sets.gene_sets_db.GeneSetResourceSchema(*, id: str, filename: str | None = None, directory: str | None = None, format: str | None, web_label: str | None = None, web_format_str: str | None = None, histograms: dict[Literal['genes_per_gene_set', 'gene_sets_per_gene'], NumericHistogramSchema | CategoricalHistogramSchema] | None = None)[source]

Bases: BaseModel

directory: str | None
filename: str | None
histograms: dict[Literal['genes_per_gene_set', 'gene_sets_per_gene'], NumericHistogramSchema | CategoricalHistogramSchema] | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'directory': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'filename': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'histograms': FieldInfo(annotation=Union[dict[Literal['genes_per_gene_set', 'gene_sets_per_gene'], Annotated[Union[NumericHistogramSchema, CategoricalHistogramSchema], FieldInfo(annotation=NoneType, required=True, discriminator='type')]], NoneType], required=False, default=None), 'resource_format': FieldInfo(annotation=Union[str, NoneType], required=True, alias='format', alias_priority=2), 'resource_id': FieldInfo(annotation=str, required=True, alias='id', alias_priority=2), 'web_format_str': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'web_label': FieldInfo(annotation=Union[str, NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

resource_format: str | None
resource_id: str
web_format_str: str | None
web_label: str | None
class dae.gene_sets.gene_sets_db.GeneSetsDb(gene_set_collections: list[BaseGeneSetCollection])[source]

Bases: object

Class that represents a dictionary of gene set collections.

property collections_descriptions: list[dict[str, Any]]

Collect gene set descriptions.

Iterates and creates a list of descriptions for each gene set collection

get_all_gene_sets(collection_id: str) list[GeneSet][source]

Return all the gene sets in the specified collection.

get_gene_set(collection_id: str, gene_set_id: str) GeneSet | None[source]

Find and return a gene set in a gene set collection.

get_gene_set_collection_ids() set[str][source]

Return all gene set collection ids.

Including the ids of collections which have not been loaded.

get_gene_set_ids(collection_id: str) set[str][source]

Return the IDs of all the gene sets in specified collection.

has_gene_set_collection(gsc_id: str) bool[source]

Check the database if contains the specified gene set collection.

class dae.gene_sets.gene_sets_db.MetaSchema(*, description: str | None = None, labels: dict[str, Any] | None = None)[source]

Bases: BaseModel

description: str | None
labels: dict[str, Any] | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'description': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'labels': FieldInfo(annotation=Union[dict[str, Any], NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class dae.gene_sets.gene_sets_db.NumericHistogramSchema(*, type: Literal['number'], plot_function: str | None = None, number_of_bins: int | None = None, view_range: ViewRangeSchema | None = None, x_log_scale: bool | None = None, y_log_scale: bool | None = None, x_min_log: float | None = None, value_order: list[str | int] | None = None, displayed_values_count: int | None = None)[source]

Bases: BaseModel

displayed_values_count: int | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'displayed_values_count': FieldInfo(annotation=Union[int, NoneType], required=False, default=None), 'number_of_bins': FieldInfo(annotation=Union[int, NoneType], required=False, default=None), 'plot_function': FieldInfo(annotation=Union[str, NoneType], required=False, default=None), 'type': FieldInfo(annotation=Literal['number'], required=True), 'value_order': FieldInfo(annotation=Union[list[Union[str, int]], NoneType], required=False, default=None), 'view_range': FieldInfo(annotation=Union[ViewRangeSchema, NoneType], required=False, default=None), 'x_log_scale': FieldInfo(annotation=Union[bool, NoneType], required=False, default=None), 'x_min_log': FieldInfo(annotation=Union[float, NoneType], required=False, default=None), 'y_log_scale': FieldInfo(annotation=Union[bool, NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

number_of_bins: int | None
plot_function: str | None
type: Literal['number']
value_order: list[str | int] | None
view_range: ViewRangeSchema | None
x_log_scale: bool | None
x_min_log: float | None
y_log_scale: bool | None
class dae.gene_sets.gene_sets_db.ViewRangeSchema(*, min: float | None = None, max: float | None = None)[source]

Bases: BaseModel

max: float | None
min: float | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'max': FieldInfo(annotation=Union[float, NoneType], required=False, default=None), 'min': FieldInfo(annotation=Union[float, NoneType], required=False, default=None)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

dae.gene_sets.gene_sets_db.build_gene_set_collection_from_file(filename: str, collection_id: str | None = None, collection_format: str | None = None, web_label: str | None = None, web_format_str: str | None = None) GeneSetCollection[source]

Return a Gene Set Collection by adapting a file to a local resource.

dae.gene_sets.gene_sets_db.build_gene_set_collection_from_resource(resource: GenomicResource) GeneSetCollection[source]

Return a Gene Set Collection built from a resource.

dae.gene_sets.gene_sets_db.build_gene_set_collection_from_resource_id(resource_id: str, grr: GenomicResourceRepo | None = None) GeneSetCollection[source]

dae.gene_sets.gene_term module

class dae.gene_sets.gene_term.GeneInfo(gene_id: str, gene_sym: str, synonyms: set[str], description: str)[source]

Bases: object

description: str
gene_id: str
gene_sym: str
synonyms: set[str]
class dae.gene_sets.gene_term.GeneTerms[source]

Bases: object

Class representing gene terms.

filter_genes(filter_fun: Callable[[list[str]], list[str]]) None[source]

Filter the genes.

rename_genes(gene_ns: str | None, rename_fn: Callable[[str], str | None]) None[source]

Rename genese.

save(fname: str) None[source]

Save to fname.

class dae.gene_sets.gene_term.NCBIGeneInfo(genes: dict[str, dae.gene_sets.gene_term.GeneInfo], ns_tokens: dict[str, dict[str, list[dae.gene_sets.gene_term.GeneInfo]]])[source]

Bases: object

genes: dict[str, GeneInfo]
ns_tokens: dict[str, dict[str, list[GeneInfo]]]
dae.gene_sets.gene_term.dd() dict[str, int][source]
dae.gene_sets.gene_term.get_clean_gene_id(ncbi_gene_info: NCBIGeneInfo, ns: str, term: str) str | None[source]

Gene gene ID from NCBI gene info data.

dae.gene_sets.gene_term.load_gene_terms(path: str) GeneTerms | None[source]

Load gene terms from a file.

dae.gene_sets.gene_term.load_ncbi_gene_info(gene_info_file: str) NCBIGeneInfo[source]
dae.gene_sets.gene_term.read_ewa_set_file(set_files: list[IO]) GeneTerms[source]

Read a set of ewa files.

dae.gene_sets.gene_term.read_gmt_file(input_file: IO) GeneTerms[source]

Read a gmt file.

dae.gene_sets.gene_term.read_mapping_file(input_file: IO, names_file: IO | None) GeneTerms[source]

Read a mapping file.

dae.gene_sets.gene_term.rename_gene_terms(gene_terms: GeneTerms, gene_ns: str, ncbi_gene_info: NCBIGeneInfo) GeneTerms[source]

Rename gene terms using NCBI gene info data.

Module contents