stcrpy.tcr_metrics package

Submodules

stcrpy.tcr_metrics.constants module

stcrpy.tcr_metrics.tcr_interface_rmsd module

class stcrpy.tcr_metrics.tcr_interface_rmsd.InterfaceRMSD[source]

Bases: object

align_by_mhc(dock: abTCR, reference: abTCR, chain_mapping: dict) None[source]

Aligns the docked TCR structure to the reference TCR structure by aligning the MHC.

Parameters:
  • dock (abTCR) – The docked TCR structure.

  • reference (abTCR) – The reference TCR structure.

  • chain_mapping (dict) – A dictionary mapping the chain IDs of the docked TCR structure to the chain IDs of the reference TCR structure.

Returns:

None

check_residue_mapping(dock: abTCR, reference: abTCR) dict[source]
get_interface_residues(tcr: abTCR, angstrom_cutoff: float = 8.0) list[source]

Retrieves the interface residues between a TCR and its antigen based on a distance cutoff.

Parameters:
  • tcr (abTCR) – The TCR object.

  • angstrom_cutoff (float, optional) – The distance cutoff in angstroms. Defaults to 8.0.

Returns:

A tuple containing two lists: the interface residues of the TCR and the

interface residues of the antigen.

Return type:

tuple

get_interface_rmsd(dock: abTCR, reference: abTCR) float[source]

Calculates the root-mean-square deviation (RMSD) between the interface residues of a docked TCR structure and a reference TCR structure.

Parameters:
  • dock (abTCR) – The docked TCR structure.

  • reference (abTCR) – The reference TCR structure.

Returns:

The RMSD value between the interface residues of the docked TCR structure and

the reference TCR structure.

Return type:

float

stcrpy.tcr_metrics.tcr_rmsd module

class stcrpy.tcr_metrics.tcr_rmsd.RMSD[source]

Bases: object

calculate_rmsd(tcr_to_align, tcr_ref, save_alignment=False)[source]
rmsd_from_files(pred_and_target_files: list) DataFrame[source]

Calculates the RMSD between TCR structures from a list of files.

Parameters:

pred_and_target_files (list of tuples) – List of tuples, where each tuple contains the path to the predicticted PDB at index 0 and the path to the target PDB at index 1.

Returns:

Pandas dataframe indexed by the TCR ID of the predicted structure, with columns

containing the RMSD of the whole alpha and beta chain, and all framework and CDR regions.

Return type:

pandas.Dataframe

Module contents