stcrpy.tcr_methods package

Submodules

stcrpy.tcr_methods.tcr_batch_operations module

class stcrpy.tcr_methods.tcr_batch_operations.TCRBatchOperator[source]

Bases: object

full_analysis(tcr_generator, geometry_mode='rudolph', save_dir=None)[source]
get_TCR_geometry(tcr_generator, mode='rudolph', save_as_csv=None)[source]
get_TCR_pMHC_interactions(tcr_generator, renumber=True, save_as_csv=None)[source]
get_germlines_and_alleles(tcr_generator, save_as_csv=None)[source]
tcrs_from_file_dict(file_dict)[source]
tcrs_from_file_list(file_list)[source]
stcrpy.tcr_methods.tcr_batch_operations.analyse_tcrs(tcr_files, save_dir=None)[source]
stcrpy.tcr_methods.tcr_batch_operations.batch_load_TCRs(tcr_files)[source]
stcrpy.tcr_methods.tcr_batch_operations.batch_yield_TCRs(tcr_files)[source]
stcrpy.tcr_methods.tcr_batch_operations.get_TCR_geometry(tcr_files, mode='rudolph', save_as_csv=None)[source]
stcrpy.tcr_methods.tcr_batch_operations.get_TCR_interactions(tcr_files, renumber=True, save_as_csv=None)[source]
stcrpy.tcr_methods.tcr_batch_operations.get_germlines_and_alleles(tcr_files, 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”)

stcrpy.tcr_methods.tcr_methods.load_TCR(tcr_structure_file, tcr_id=None)[source]
stcrpy.tcr_methods.tcr_methods.load_TCRs(tcr_structure_files, tcr_ids=None)[source]
stcrpy.tcr_methods.tcr_methods.yield_TCRs(tcr_structure_files, tcr_ids=None)[source]

stcrpy.tcr_methods.tcr_reformatting module

stcrpy.tcr_methods.tcr_reformatting.tcrs_to_AF3_json(tcrs, path=None, **kwargs)[source]

Module contents