gain.gene_sets.implementations package
Submodules
gain.gene_sets.implementations.gene_sets_impl module
- class GeneSetCollectionImpl(resource: GenomicResource)[source]
Bases:
GenomicResourceImplementation,InfoImplementationMixinGene sets collection resource implementations.
Not a
ResourceConfigValidationMixin: a gene-set collection validates its config on construction through pydantic’sGeneSetResourceSchema, in the collection this builds, so there is no cerberus schema to declare (ADR 0031).- calc_info_hash() bytes[source]
Compute the digest of the inputs of the info page.
The page is rendered again only when the digest changes.
- Returns:
The digest of everything that
get_infodepends on.- Return type:
bytes
- calc_statistics_hash() bytes[source]
Compute the digest of the inputs of the statistics build.
grr_managecompares the digest with the stored one to decide whether it must compute the statistics again.- Returns:
The digest of everything that the statistics tasks read.
- Return type:
bytes
- create_statistics_build_tasks(*, region_size: int = 3000000000, grr: GenomicResourceRepo | None = None) list[TaskDesc][source]
Create the task graph tasks that compute the statistics.
grr_managecalls every kind with the same two keyword-only arguments. An implementation declares both, even when it ignores them, and declares no other argument.- Parameters:
region_size (int) – The longest region that one task covers. A kind that splits its build by genomic region reads it.
0means do not split: a genomic score then scans the resource in one pass and a reference genome uses one region for each chromosome. A kind that does not split ignores it.grr (GenomicResourceRepo | None) – The repository that holds the resource.
Nonemeans that the caller names no repository.
- Returns:
The tasks of the build. An empty list means that the kind has no statistics to compute.
- Return type:
list[TaskDesc]
- Raises:
ValueError – If
region_sizeis negative.
- get_info(**kwargs: Any) str[source]
Render the HTML of the info page of the resource.
- Parameters:
**kwargs (Any) – Options of the renderer. The caller defines them.
- Returns:
The HTML of the page.
- Return type:
str
- get_statistics_info(**kwargs: Any) str[source]
Render the HTML of the statistics page of the resource.
- Parameters:
**kwargs (Any) – Options of the renderer. The caller defines them.
- Returns:
The HTML of the page.
- Return type:
str
- styles_template_name: ClassVar[str] = 'gene_set_collection_styles.jinja'
- template_name: ClassVar[str] = 'gene_set_collection.jinja'