dae.gene package

Submodules

dae.gene.denovo_gene_set_collection module

class dae.gene.denovo_gene_set_collection.DenovoGeneSetCollection(study_id, study_name, config, person_set_collections)[source]

Bases: object

Class representing a study’s denovo gene sets.

classmethod get_all_gene_sets(denovo_gene_sets, denovo_gene_set_spec=None)[source]
classmethod get_gene_set(gene_set_id, denovo_gene_set_collections, denovo_gene_set_spec=None)[source]

Return a single set from provided denovo gene set collections.

get_gene_sets_types_legend()[source]

Return list of dictionaries for legends for each collection.

get_person_set_collection_legend(person_set_collection_id)[source]

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

dae.gene.denovo_gene_set_collection_factory module

class dae.gene.denovo_gene_set_collection_factory.DenovoGeneSetCollectionFactory[source]

Bases: object

Class for creating and loading created denovo gene sets.

classmethod build_collection(genotype_data_study)[source]

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

static denovo_gene_set_cache_file(config, person_set_collection_id='')[source]

Return the path to the cache file for a person set collection.

classmethod load_collection(genotype_data_study)[source]

Load a denovo gene set collection for a given study.

dae.gene.denovo_gene_sets_db module

class dae.gene.denovo_gene_sets_db.DenovoGeneSetsDb(gpf_instance)[source]

Bases: object

Class to manage available de Novo gene sets.

get_all_gene_sets(denovo_gene_set_spec, permitted_datasets=None, collection_id='denovo')[source]

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

get_gene_set(gene_set_id, gene_set_spec, permitted_datasets=None, collection_id='denovo')[source]

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

get_gene_set_descriptions(permitted_datasets=None)[source]
get_gene_set_ids(genotype_data_id)[source]
get_genotype_data_ids()[source]

Return list of genotype data IDs with denovo gene sets.

reload()[source]

dae.gene.gene_scores module

dae.gene.gene_sets_db module

Classes for handling of gene sets.

class dae.gene.gene_sets_db.BaseGeneSetCollection[source]

Bases: ABC

Base class for gene set collections.

abstract get_all_gene_sets() list[dae.gene.gene_sets_db.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.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.gene_sets_db.GeneSetCollection(resource: GenomicResource)[source]

Bases: GenomicResourceImplementation, ResourceConfigValidationMixin, InfoImplementationMixin, BaseGeneSetCollection

Class representing a collection of gene sets in a resource.

add_statistics_build_tasks(task_graph: TaskGraph, **kwargs: Any) list[dae.task_graph.graph.Task][source]

Add tasks for calculating resource statistics to a task graph.

calc_info_hash() bytes[source]

Compute and return the info hash.

calc_statistics_hash() bytes[source]

Compute the statistics hash.

This hash is used to decide whether the resource statistics should be recomputed.

property files: set[str]

Return a list of resource files the implementation utilises.

get_all_gene_sets() list[dae.gene.gene_sets_db.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_info() str[source]

Construct the contents of the implementation’s HTML info page.

static get_schema() dict[str, Any][source]

Return schema to be used for config validation.

get_template() Template[source]
load_gene_sets() dict[str, dae.gene.gene_sets_db.GeneSet][source]

Build a gene set collection from a given GenomicResource.

class dae.gene.gene_sets_db.GeneSetsDb(gene_set_collections: list[dae.gene.gene_sets_db.GeneSetCollection])[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[dae.gene.gene_sets_db.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.

dae.gene.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.gene_sets_db.build_gene_set_collection_from_resource(resource: GenomicResource) GeneSetCollection[source]

Return a Gene Set Collection built from a resource.

dae.gene.gene_term module

class dae.gene.gene_term.GeneTerms[source]

Bases: object

Class representing gene terms.

filterGenes(filterF)[source]

Filter the genese.

renameGenes(geneNS, renameF)[source]

Rename genese.

save(fn)[source]

Save to fn.

dae.gene.gene_term.dd()[source]
dae.gene.gene_term.read_ewa_set_file(set_files)[source]

Read a set of ewa files.

dae.gene.gene_term.read_gmt_file(input_file)[source]

Read a gmt file.

dae.gene.gene_term.read_mapping_file(input_file, names_file)[source]

Read a mapping file.

dae.gene.scores module

dae.gene.utils module

dae.gene.utils.getCleanGeneId(config, ns, t)[source]

Return clean gene id.

dae.gene.utils.getGeneTermAtt(config, gt_id, attName)[source]
dae.gene.utils.getGenes(config)[source]
dae.gene.utils.getNsTokens(config)[source]
dae.gene.utils.loadNCBIGeneInfo(config)[source]

Load NCBI Gene Info.

dae.gene.utils.rename_gene_terms(config, gene_terms, inNS)[source]

Rename gene terms.

Module contents