torchcell.sequence.Genome

class Genome(data_root: str | None = None)[source]

Bases: ABC

Abstract genome providing lazy gene-set and sequence access.

property db: FeatureDB | None

Get database connection - lazy loaded per process/thread.

Subclasses should set self._db_connection_manager to enable database access.

property gene_set: GeneSet

Return the gene set, computing and caching it on first access.

abstractmethod compute_gene_set() → GeneSet[source]

Compute and return the set of gene identifiers.

abstractmethod get_seq(chr: int | str, start: int, end: int, strand: str) → DnaSelectionResult[source]

Return the DNA selection for the given coordinates and strand.

abstract property gene_attribute_table: DataFrame

Return a table of per-gene attributes.

abstract property feature_types: list[str]

Return the list of supported feature types.