gain.genomic_resources.implementations package
Subpackages
- gain.genomic_resources.implementations.genomic_scores_impl package
- Submodules
- gain.genomic_resources.implementations.genomic_scores_impl.allele module
- gain.genomic_resources.implementations.genomic_scores_impl.base module
- gain.genomic_resources.implementations.genomic_scores_impl.builders module
- gain.genomic_resources.implementations.genomic_scores_impl.fragment module
- gain.genomic_resources.implementations.genomic_scores_impl.position module
- gain.genomic_resources.implementations.genomic_scores_impl.scan module
- Module contents
Submodules
gain.genomic_resources.implementations.ann_data_resource_impl module
Provides the ann_data resource implementation.
- class gain.genomic_resources.implementations.ann_data_resource_impl.AnnDataResourceImplementation(genomic_resource: GenomicResource)[source]
Bases:
GenomicResourceImplementation,InfoImplementationMixinAnnData resource implementation.
- 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.
- create_statistics_build_tasks(**kwargs: Any) list[TaskDesc][source]
Create tasks for calculating resource statistics for task graph.
- property files: set[str]
Return a list of resource files the implementation utilises.
- get_info(**kwargs: Any) str[source]
Construct the contents of the implementation’s HTML info page.
- get_statistics_info(**kwargs: Any) str[source]
Construct the contents of the implementation’s HTML statistics info page.
- template_name: ClassVar[str] = 'ann_data.jinja'
gain.genomic_resources.implementations.annotation_pipeline_impl module
- class gain.genomic_resources.implementations.annotation_pipeline_impl.AnnotationPipelineImplementation(resource: GenomicResource)[source]
Bases:
GenomicResourceImplementation,InfoImplementationMixinResource implementation for annotation pipeline.
- 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.
- create_statistics_build_tasks(**kwargs: Any) list[TaskDesc][source]
Create tasks for calculating resource statistics for task graph.
- property files: set[str]
Return a list of resource files the implementation utilises.
- get_info(**kwargs: Any) str[source]
Construct the contents of the implementation’s HTML info page.
- get_statistics_info(**kwargs: Any) str[source]
Construct the contents of the implementation’s HTML statistics info page.
- template_name: ClassVar[str] = 'annotation_pipeline.jinja'
gain.genomic_resources.implementations.basic_resource_impl module
Provides the catch-all basic resource implementation.
- class gain.genomic_resources.implementations.basic_resource_impl.BasicResourceImplementation(genomic_resource: GenomicResource)[source]
Bases:
GenomicResourceImplementation,InfoImplementationMixinImplementation for resources without a more specific type.
A resource whose config carries no
typeresolves to thebasictype (seeGenomicResource.get_type). It has no schema or statistics of its own; it only renders a minimal info page and – crucially – exposes every data file viafilesso caching covers the whole resource, the same way untyped resources were cached before they had an implementation (gain#78).- 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.
- create_statistics_build_tasks(**kwargs: Any) list[TaskDesc][source]
Create tasks for calculating resource statistics for task graph.
- property files: set[str]
Return a list of resource files the implementation utilises.
- get_info(**kwargs: Any) str[source]
Construct the contents of the implementation’s HTML info page.
- get_statistics_info(**kwargs: Any) str[source]
Construct the contents of the implementation’s HTML statistics info page.
- template_name: ClassVar[str] = 'basic.jinja'
gain.genomic_resources.implementations.data_frame_resource_impl module
Provides the data_frame resource implementation.
- class gain.genomic_resources.implementations.data_frame_resource_impl.DataFrameResourceImplementation(genomic_resource: GenomicResource)[source]
Bases:
GenomicResourceImplementation,InfoImplementationMixinDataFrame resource implementation.
- 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.
- create_statistics_build_tasks(**kwargs: Any) list[TaskDesc][source]
Create tasks for calculating resource statistics for task graph.
- property files: set[str]
Return a list of resource files the implementation utilises.
- get_info(**kwargs: Any) str[source]
Construct the contents of the implementation’s HTML info page.
- get_statistics_info(**kwargs: Any) str[source]
Construct the contents of the implementation’s HTML statistics info page.
- template_name: ClassVar[str] = 'data_frame.jinja'
gain.genomic_resources.implementations.gene_models_impl module
- class gain.genomic_resources.implementations.gene_models_impl.GeneModelsImpl(resource: GenomicResource)[source]
Bases:
GenomicResourceImplementation,InfoImplementationMixinProvides class for gene models.
- 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.
- create_statistics_build_tasks(**kwargs: Any) list[TaskDesc][source]
Create tasks for calculating resource statistics for task graph.
- property files: set[str]
Return a list of resource files the implementation utilises.
- get_info(**kwargs: Any) str[source]
Construct the contents of the implementation’s HTML info page.
- get_statistics() GeneModelsStatistics | None[source]
Try and load resource statistics.
- get_statistics_info(**kwargs: Any) str[source]
Construct the contents of the implementation’s HTML statistics info page.
- styles_template_name: ClassVar[str] = 'gene_models_styles.jinja'
- template_name: ClassVar[str] = 'gene_models.jinja'
- class gain.genomic_resources.implementations.gene_models_impl.GeneModelsStatistics(resource_id: str, chromosome_count: int, global_statistic: StatisticsData, chrom_statistics: dict[str, StatisticsData])[source]
Bases:
ResourceStatisticsClass for accessing reference genome statistics.
- static deserialize(data: str) GeneModelsStatistics[source]
Deserialize gene models statistics.
- serialize() str[source]
Serialize gene models statistics.
- class gain.genomic_resources.implementations.gene_models_impl.StatisticsData(transcript_number: int, protein_coding_transcript_number: int, gene_number: int, protein_coding_gene_number: int)[source]
Bases:
objectClass for storing gene models statistics.
- gene_number: int
- protein_coding_gene_number: int
- protein_coding_transcript_number: int
- transcript_number: int
gain.genomic_resources.implementations.liftover_chain_impl module
Provides LiftOver chain resource.
- class gain.genomic_resources.implementations.liftover_chain_impl.LiftoverChainImplementation(resource: GenomicResource)[source]
Bases:
GenomicResourceImplementation,InfoImplementationMixinDefines Lift Over chain resource implementation.
- 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.
- create_statistics_build_tasks(**kwargs: Any) list[TaskDesc][source]
Create tasks for calculating resource statistics for task graph.
- get_info(**kwargs: Any) str[source]
Construct the contents of the implementation’s HTML info page.
- get_statistics_info(**kwargs: Any) str[source]
Construct the contents of the implementation’s HTML statistics info page.
- template_name: ClassVar[str] = 'liftover_chain.jinja'
gain.genomic_resources.implementations.reference_genome_impl module
- class gain.genomic_resources.implementations.reference_genome_impl.ChromosomeStatistic(chromosome: str, length: int = 0, nucleotide_counts: dict[str, int] | None = None, nucleotide_pair_counts: dict[str, int] | None = None)[source]
Bases:
StatisticClass for individual chromosome statistics.
- add_value(value: tuple[str | None, str]) None[source]
Add a value to the statistic.
- static deserialize(content: str) ChromosomeStatistic[source]
Create a statistic from serialized data.
- finish() None[source]
Perform final calculations for the statistic.
This step is optional.
This is called when resource iteration is complete.
Can also be used when creating more complex resources via deserialization.
- merge(other: Statistic) None[source]
Merge the values from another statistic in place.
- serialize() str[source]
Return a serialized version of this statistic.
- class gain.genomic_resources.implementations.reference_genome_impl.GenomeStatistic(chromosomes: list[str], length: int = 0, nucleotide_distribution: dict[str, float] | None = None, bi_nucleotide_distribution: dict[str, float] | None = None, chromosome_statistics: dict[str, ChromosomeStatistic] | None = None)[source]
Bases:
StatisticClass for the global reference genome statistic.
- add_value(value: Any) None[source]
Add a value to the statistic.
- property chrom_count: int
- static deserialize(content: str) GenomeStatistic[source]
Create a statistic from serialized data.
- finish() None[source]
Perform final calculations for the statistic.
This step is optional.
This is called when resource iteration is complete.
Can also be used when creating more complex resources via deserialization.
- merge(other: Statistic) None[source]
Merge the values from another statistic in place.
- serialize() str[source]
Return a serialized version of this statistic.
- class gain.genomic_resources.implementations.reference_genome_impl.GenomeStatisticsMixin[source]
Bases:
objectMixin for reference genome statistics access.
- static get_chrom_file(chrom: str) str[source]
- static get_global_statistic_file() str[source]
- class gain.genomic_resources.implementations.reference_genome_impl.ReferenceGenomeImplementation(resource: GenomicResource)[source]
Bases:
GenomicResourceImplementation,InfoImplementationMixinResource implementation for reference genome.
- 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.
- create_statistics_build_tasks(**kwargs: Any) list[TaskDesc][source]
Create tasks for calculating resource statistics for task graph.
- property files: set[str]
Return a list of resource files the implementation utilises.
- get_info(**kwargs: Any) str[source]
Construct the contents of the implementation’s HTML info page.
- get_statistics() ReferenceGenomeStatistics | None[source]
Try and load resource statistics.
- get_statistics_info(**kwargs: Any) str[source]
Construct the contents of the implementation’s HTML statistics info page.
- styles_template_name: ClassVar[str] = 'reference_genome_styles.jinja'
- template_name: ClassVar[str] = 'reference_genome.jinja'
- class gain.genomic_resources.implementations.reference_genome_impl.ReferenceGenomeStatistics(resource_id: str, global_statistic: GenomeStatistic, chrom_statistics: dict[str, ChromosomeStatistic])[source]
Bases:
ResourceStatistics,GenomeStatisticsMixinClass for accessing reference genome statistics.
- static build_statistics(genomic_resource: GenomicResource) ReferenceGenomeStatistics | None[source]
Load reference genome statistics.