dae.gpf_instance package

Subpackages

Submodules

dae.gpf_instance.gpf_instance module

Defines GPFInstance class that gives access to different parts of GPF.

class dae.gpf_instance.gpf_instance.GPFInstance(dae_config: Box, dae_dir: str | Path, dae_config_path: Path, **kwargs: dict[str, Any])[source]

Bases: object

Class to access different parts of a GPF instance.

static build(config_filename: str | Path | None = None, **kwargs: Any) GPFInstance[source]

Construct and return a GPF instance.

If the config_filename is None, tries to discover the GPF instance. First check if a DAE_DB_DIR environment variable is defined and if defined use it as a GPF instance directory.

Otherwise look for a gpf_instance.yaml file in the current directory and its parents. If found use it as a configuration file.

property denovo_gene_sets_db: DenovoGeneSetsDb
property gene_models: GeneModels

Return gene models used in the GPF instance.

property gene_scores_db: Any

Load and return gene scores db.

property gene_sets_db: GeneSetsDb

Return GeneSetsDb populated with gene sets from the GPFInstance.

property genomic_scores: GenomicScoresRegistry

Load and return genomic scores db.

property genotype_storages: Any

Construct and return genotype storage registry.

get_all_common_report_configs() list[Box][source]

Return all common report configuration.

get_all_gene_score_descs() list[ScoreDesc][source]
get_all_gene_scores() list[GeneScore][source]
get_all_genotype_data() list[GenotypeData][source]
get_all_phenotype_data() list[PhenotypeData][source]
get_annotation_pipeline() AnnotationPipeline[source]

Return the annotation pipeline configured in the GPF instance.

get_annotation_pipeline_config() list[dict[str, Any]] | RawFullConfig[source]

Return the annotation pipeline config.

get_cache_path(prefix: str) Path | None[source]
get_common_report(study_id: str) CommonReport | None[source]

Load and return common report (dataset statistics) for a study.

get_dataset(dataset_id: str) GenotypeData[source]
get_enrichment_builder(dataset: GenotypeData) BaseEnrichmentBuilder[source]

Get enrichment builder for specific dataset.

Will create and register new one if one isn’t found.

get_gene_score(gene_score_id: str) GeneScore[source]
get_gene_score_desc(score_id: str) ScoreDesc[source]
get_genotype_data(genotype_data_id: str) GenotypeData[source]
get_genotype_data_config(genotype_data_id: str) Box | None[source]
get_genotype_data_ids() list[str][source]
get_gp_configuration() Box[source]
get_gp_statistic(gene_symbol: str) GPStatistic[source]
get_pheno_cache_path() Path[source]
get_pheno_tool_adapter(dataset: GenotypeData) PhenoToolAdapterBase[source]

Get enrichment builder for specific dataset.

Will create and register new one if one isn’t found.

get_phenotype_data(phenotype_data_id: str) PhenotypeData[source]
get_phenotype_data_config(phenotype_data_id: str) dict | None[source]
get_phenotype_data_ids() list[str][source]
get_transcript_models(gene_symbol: str) tuple[str | None, list[TranscriptModel] | None][source]

Get gene model by gene symbol.

property grr: GenomicResourceRepo

Return genomic resource repository configured for GPF instance.

has_gene_score(gene_score_id: str) bool[source]
has_phenotype_data(phenotype_data_id: str) bool[source]
list_gp_gene_symbols(page: int, symbol_like: str | None = None) list[str][source]

Query AGR statistics and return results.

load() GPFInstance[source]

Load all GPF instance attributes.

make_enrichment_builder(dataset: GenotypeData) EnrichmentBuilder[source]
make_pheno_tool_adapter(dataset: GenotypeData) PhenoToolAdapterBase[source]

Create a pheno tool adapter for dataset.

property phenotype_storages: PhenotypeStorageRegistry

Get phenotype storage registry.

Will load if not cached.

query_gp_statistics(page: int, symbol_like: str | None = None, sort_by: str | None = None, order: str | None = None) list[GPStatistic][source]

Query AGR statistics and return results.

property reference_genome: ReferenceGenome

Return reference genome defined in the GPFInstance config.

register_enrichment_builder(dataset_id: str, builder: BaseEnrichmentBuilder) None[source]

Register a new enrichment builder to a given dataset ID.

register_pheno_tool_adapter(dataset_id: str, adapter: PhenoToolAdapterBase) None[source]

Register a new enrichment builder to a given dataset ID.

reload() None[source]

Reload GPF instance studies, de Novo gene sets, etc.

Module contents

class dae.gpf_instance.GPFInstance(dae_config: Box, dae_dir: str | Path, dae_config_path: Path, **kwargs: dict[str, Any])[source]

Bases: object

Class to access different parts of a GPF instance.

static build(config_filename: str | Path | None = None, **kwargs: Any) GPFInstance[source]

Construct and return a GPF instance.

If the config_filename is None, tries to discover the GPF instance. First check if a DAE_DB_DIR environment variable is defined and if defined use it as a GPF instance directory.

Otherwise look for a gpf_instance.yaml file in the current directory and its parents. If found use it as a configuration file.

property denovo_gene_sets_db: DenovoGeneSetsDb
property gene_models: GeneModels

Return gene models used in the GPF instance.

property gene_scores_db: Any

Load and return gene scores db.

property gene_sets_db: GeneSetsDb

Return GeneSetsDb populated with gene sets from the GPFInstance.

property genomic_scores: GenomicScoresRegistry

Load and return genomic scores db.

property genotype_storages: Any

Construct and return genotype storage registry.

get_all_common_report_configs() list[Box][source]

Return all common report configuration.

get_all_gene_score_descs() list[ScoreDesc][source]
get_all_gene_scores() list[GeneScore][source]
get_all_genotype_data() list[GenotypeData][source]
get_all_phenotype_data() list[PhenotypeData][source]
get_annotation_pipeline() AnnotationPipeline[source]

Return the annotation pipeline configured in the GPF instance.

get_annotation_pipeline_config() list[dict[str, Any]] | RawFullConfig[source]

Return the annotation pipeline config.

get_cache_path(prefix: str) Path | None[source]
get_common_report(study_id: str) CommonReport | None[source]

Load and return common report (dataset statistics) for a study.

get_dataset(dataset_id: str) GenotypeData[source]
get_enrichment_builder(dataset: GenotypeData) BaseEnrichmentBuilder[source]

Get enrichment builder for specific dataset.

Will create and register new one if one isn’t found.

get_gene_score(gene_score_id: str) GeneScore[source]
get_gene_score_desc(score_id: str) ScoreDesc[source]
get_genotype_data(genotype_data_id: str) GenotypeData[source]
get_genotype_data_config(genotype_data_id: str) Box | None[source]
get_genotype_data_ids() list[str][source]
get_gp_configuration() Box[source]
get_gp_statistic(gene_symbol: str) GPStatistic[source]
get_pheno_cache_path() Path[source]
get_pheno_tool_adapter(dataset: GenotypeData) PhenoToolAdapterBase[source]

Get enrichment builder for specific dataset.

Will create and register new one if one isn’t found.

get_phenotype_data(phenotype_data_id: str) PhenotypeData[source]
get_phenotype_data_config(phenotype_data_id: str) dict | None[source]
get_phenotype_data_ids() list[str][source]
get_transcript_models(gene_symbol: str) tuple[str | None, list[TranscriptModel] | None][source]

Get gene model by gene symbol.

property grr: GenomicResourceRepo

Return genomic resource repository configured for GPF instance.

has_gene_score(gene_score_id: str) bool[source]
has_phenotype_data(phenotype_data_id: str) bool[source]
list_gp_gene_symbols(page: int, symbol_like: str | None = None) list[str][source]

Query AGR statistics and return results.

load() GPFInstance[source]

Load all GPF instance attributes.

make_enrichment_builder(dataset: GenotypeData) EnrichmentBuilder[source]
make_pheno_tool_adapter(dataset: GenotypeData) PhenoToolAdapterBase[source]

Create a pheno tool adapter for dataset.

property phenotype_storages: PhenotypeStorageRegistry

Get phenotype storage registry.

Will load if not cached.

query_gp_statistics(page: int, symbol_like: str | None = None, sort_by: str | None = None, order: str | None = None) list[GPStatistic][source]

Query AGR statistics and return results.

property reference_genome: ReferenceGenome

Return reference genome defined in the GPFInstance config.

register_enrichment_builder(dataset_id: str, builder: BaseEnrichmentBuilder) None[source]

Register a new enrichment builder to a given dataset ID.

register_pheno_tool_adapter(dataset_id: str, adapter: PhenoToolAdapterBase) None[source]

Register a new enrichment builder to a given dataset ID.

reload() None[source]

Reload GPF instance studies, de Novo gene sets, etc.