stcrpy.tcr_methods package
Submodules
stcrpy.tcr_methods.tcr_batch_operations module
- stcrpy.tcr_methods.tcr_batch_operations.get_TCR_geometry(tcr_files, mode='rudolph', save_as_csv=None)[source]
stcrpy.tcr_methods.tcr_methods module
- stcrpy.tcr_methods.tcr_methods.fetch_TCR(pdb_id: str)[source]
Fetches and parses a T-cell receptor (TCR) structure from the STCRDab or RCSB PDB databases.
The function first attempts to download a PDB file from the STCRDab database. If the PDB file is not found, it falls back to downloading a CIF file from RCSB PDB. The downloaded file is then parsed using TCRParser to extract TCR structures.
- Parameters:
pdb_id (str) – The PDB identifier of the structure to be fetched.
- Returns:
A single TCR structure if exactly one is found.
A list of TCR structures if multiple are found.
None if no TCRs are identified (with a UserWarning issued).
- Raises:
- A warning if no TCR structures are found in the downloaded file. –
- Prints an error message if the file cannot be downloaded. –
Notes
STCRDab returns an error message if the requested PDB ID does not exist.
The function temporarily saves the downloaded file and deletes it after parsing.
Example
tcr = fetch_TCR(“6eqa”)