iggytop.adapters.trait_adapter.TRAITAdapter#
- class iggytop.adapters.trait_adapter.TRAITAdapter(bc, cache_dir=None, receptors_to_include=('TCR', 'BCR'), test=False)#
A Comprehensive Database for T-cell Receptor-Antigen Interactions TRAIT.
- __init__(bc, cache_dir=None, receptors_to_include=('TCR', 'BCR'), test=False)#
Initializes the BaseAdapter instance.
- Parameters:
Methods
__init__(bc[, cache_dir, ...])Initializes the BaseAdapter instance.
create_anndata()Creates an Anndata object from the AIRR cell data and saves it to a file in the cache directory.
Yield BioCypher edges generated via OntoWeaver.
Retrieves the latest release of the TRAIT database.
Yield BioCypher nodes generated via OntoWeaver.
read_table(bc, table_path, receptors[, test])Reads and processes the TRAIT table from the downloaded database file.
set_metadata([version, source_url, ...])Sets the metadata for the adapter.
Attributes
Directory name for the downloaded database.
Name of the database.
URL to download the TRAIT database.
Version of the TRAIT database, taken from the date embedded in
DB_URL.airr_cellsProperty to get the list of AIRR cells.
Receptor types available in TRAIT.
cache_dirProperty to get the cache directory.
db_nameProperty to get the database name.
metadataProperty to get the adapter metadata.
receptorsProperty to get the available receptor types.
tableProperty to get the data table.
- get_edges()#
Yield BioCypher edges generated via OntoWeaver.
- get_latest_release(bc)#
Retrieves the latest release of the TRAIT database.
- get_nodes()#
Yield BioCypher nodes generated via OntoWeaver.
- read_table(bc, table_path, receptors, test=False)#
Reads and processes the TRAIT table from the downloaded database file.
- Parameters:
- Return type:
DataFrame- Returns:
A DataFrame containing the processed table data.
- Raises:
FileNotFoundError – If the table file cannot be found.
- DB_DIR = 'trait_latest'#
Directory name for the downloaded database.
- DB_NAME: str = 'TRAIT'#
Name of the database.
- DB_URL = 'https://pgx.zju.edu.cn/download.trait/Interactive_TCR-pMHC_Pairs.zip_20250312.zip'#
URL to download the TRAIT database.
- DB_VERSION = '2025-03-12'#
Version of the TRAIT database, taken from the date embedded in
DB_URL.
- _abc_impl = <_abc._abc_data object>#
- available_receptors: list[str] = ['TCR']#
Receptor types available in TRAIT.