aigct.repository
Data access layer methods for accessing variant repository. Classes here provide an encapsulation layer to hide the internal details of the repository structure.
Attributes
Classes
Caches the variant csv file in a dataframe. Implements the singleton |
|
Caches a repository csv file in a dataframe. Implements the singleton |
|
Caches a repository csv file in a dataframe. Maintains a separate |
|
Caches the variant csv file in a dataframe. Implements the singleton |
|
Caches the variant csv file in a dataframe. Implements the singleton |
|
Caches the variant csv file in a dataframe. Implements the singleton |
|
Caches the variant csv file in a dataframe. Implements the singleton |
|
Caches a repository csv file in a dataframe. Implements the singleton |
|
Classes that wish to behave as threadsafe singletons can inherit from |
|
Functions
|
|
|
|
|
Module Contents
- aigct.repository.VARIANT_PK_COLUMNS = ['GENOME_ASSEMBLY', 'CHROMOSOME', 'POSITION', 'REFERENCE_NUCLEOTIDE', 'ALTERNATE_NUCLEOTIDE'][source]
- aigct.repository.VARIANT_NON_PK_COLUMNS = ['PRIOR_GENOME_ASSEMBLY', 'PRIOR_CHROMOSOME', 'PRIOR_POSITION', 'PRIOR_PRIOR_GENOME_ASSEMBLY',...[source]
- aigct.repository.VARIANT_LABEL_NON_PK_COLUMNS = ['LABEL_SOURCE', 'RAW_LABEL', 'BINARY_LABEL'][source]
- aigct.repository.VARIANT_EFFECT_SCORE_PK_COLUMNS = ['GENOME_ASSEMBLY', 'CHROMOSOME', 'POSITION', 'REFERENCE_NUCLEOTIDE', 'ALTERNATE_NUCLEOTIDE',...[source]
- class aigct.repository.RepoSessionContext(data_folder_root: str, table_defs: dict[str, TableDef])[source]
- class aigct.repository.VariantEffectLabelCache[source]
Bases:
aigct.util.ParameterizedSingletonCaches the variant csv file in a dataframe. Implements the singleton pattern to ensure there is only one instance of the cached dataframe. We use an _init_once method rather than the normal __init__ method as required by the ParameterizedSingleton class.
- class aigct.repository.DataCache[source]
Bases:
aigct.util.ParameterizedSingletonCaches a repository csv file in a dataframe. Implements the singleton pattern to ensure there is only one instance of the cached dataframe. We use an _init_once method rather than the normal __init__ method as required by the ParameterizedSingleton class.
- class aigct.repository.TaskBasedDataCache[source]
Bases:
aigct.util.ParameterizedSingletonCaches a repository csv file in a dataframe. Maintains a separate cache for each task in a dict. Implements the singleton pattern to ensure there is only one instance of the cached dataframe. We use an _init_once method rather than the normal __init__ method as required by the ParameterizedSingleton class.
- class aigct.repository.TaskDataCache[source]
Bases:
DataCacheCaches the variant csv file in a dataframe. Implements the singleton pattern to ensure there is only one instance of the cached dataframe. We use an _init_once method rather than the normal __init__ method as required by the ParameterizedSingleton class.
- class aigct.repository.VariantEffectScoreCache[source]
Bases:
TaskBasedDataCacheCaches the variant csv file in a dataframe. Implements the singleton pattern to ensure there is only one instance of the cached dataframe. We use an _init_once method rather than the normal __init__ method as required by the ParameterizedSingleton class.
- class aigct.repository.VariantCache[source]
Bases:
DataCacheCaches the variant csv file in a dataframe. Implements the singleton pattern to ensure there is only one instance of the cached dataframe. We use an _init_once method rather than the normal __init__ method as required by the ParameterizedSingleton class.
- class aigct.repository.VariantTaskCache[source]
Bases:
DataCacheCaches the variant csv file in a dataframe. Implements the singleton pattern to ensure there is only one instance of the cached dataframe. We use an _init_once method rather than the normal __init__ method as required by the ParameterizedSingleton class.
- class aigct.repository.VariantEffectSourceCache[source]
Bases:
DataCacheCaches a repository csv file in a dataframe. Implements the singleton pattern to ensure there is only one instance of the cached dataframe. We use an _init_once method rather than the normal __init__ method as required by the ParameterizedSingleton class.
- class aigct.repository.VariantFilterCache[source]
Bases:
aigct.util.ParameterizedSingletonClasses that wish to behave as threadsafe singletons can inherit from this class. To be used only by classes that have an initialization method that takes parameters. The class must implement an _init_once method instead of the normal __init__ method for initialization. It takes same parameters as __init__ method. By inheriting from this class all instantiations of the subclass will return the same instance.
- class aigct.repository.VariantEffectSourceRepository(session_context: RepoSessionContext, variant_effect_score_repo)[source]
- class aigct.repository.VariantTaskRepository(session_context: RepoSessionContext)[source]
- class aigct.repository.VariantFilterRepository(session_context: RepoSessionContext)[source]
-
- get_by_task_filter_name(task_code: str, filter_name: str) aigct.model.VariantFilter[source]
- get_by_task_filter_names(task_code: str, filter_names: list[str]) list[aigct.model.VariantFilter][source]
- aigct.repository.query_by_filter(query_df: pandas.DataFrame, filter: pandas.Series, filter_gene_df: pandas.DataFrame, filter_variant_df: pandas.DataFrame) pandas.DataFrame[source]
- aigct.repository.query_by_filters(query_df: pandas.DataFrame, filters: list[aigct.model.VariantFilter]) pandas.DataFrame[source]
- class aigct.repository.VariantRepository(session_context: RepoSessionContext)[source]
-
- get(qry: aigct.model.VEQueryCriteria) pandas.DataFrame[source]
Fetches variants. The optional parameters are filter criteria used to limit the set of variants returned.
- class aigct.repository.VariantEffectLabelRepository(session_context: RepoSessionContext, variant_task_repo: VariantTaskRepository, variant_repo: VariantRepository, filter_repo: VariantFilterRepository)[source]
-
- get(task_code: str, qry: aigct.model.VEQueryCriteria = None) pandas.DataFrame[source]
Fetches variant effect labels.
- class aigct.repository.VariantEffectScoreRepository(session_context: RepoSessionContext, task_repo: VariantTaskRepository, variant_repo: VariantRepository, filter_repo: VariantFilterRepository)[source]
-
- get(task_code: str, variant_effect_sources: list[str] | str = None, include_variant_effect_sources: bool = True, qry: aigct.model.VEQueryCriteria = None) pandas.DataFrame[source]