Skip to main content

TCR geometry calculation and visualization tools

Project description

Installation

This package can be installed via

pip install tcrgeometry

Extra dependencies

For TCR numbering, ANARCII must be installed via pip: (using the newest version)

pip install anarcii

Sometimes the legacy version ANARCI works better, so it must also be installed via conda:

conda install bioconda::anarci

For visualization, PyMOL must be installed via bioconda:

conda install conda-forge::pymol-open-source

Measure angles of existing TCR structures

To measure angles in existing TCR structures, you can use the new_calc.py script provided in the TRangle package. This script allows you to calculate angles and distances in a TCR structure file.

tcr-calc --input_pdb file.pdb --out_path ./out

Add the --vis flag to generate a visualization of the modified structure. It will save a visualisation of the measured angles and distance saved as an image and a .pse file which can be opened in PyMOL.

or with the API:

import tcrgeometry
calc_results = tcrgeometry.calc_tcr_geometry(pdb_file, out_path="./out")

Set the vis=True flag to generate a visualization of the modified structure.

This will output a CSV file with the measured angles and distances.

Measure angles of existing TCR trajectories

To measure angles in existing TCR trajectories, you can use the new_calc_MD.py script provided in the TRangle package. This script allows you to calculate angles and distances in a TCR trajectory file.

tcr-calc-md --input_pdb file.pdb --input_md trajectory.traj --out_path ./out

or with the API:

import tcrgeometry
md_results = tcrgeometry.calc_tcr_geometry_MD(pdb_file, md_path, out_path="./out")

Change geometry of a TCR structure

To change the geometry of a TCR structure, you can use the change_geometry.py script provided in the TRangle package. This script allows you to modify angles and distances in a TCR structure based on a configuration file.

tcr-change --input file.pdb --out_path ./out --BA 113 --BC1 98.7 --BC2 9.3 --AC1 71.5 --AC2 154 --dc 24

Add the --vis flag to generate a visualization of the modified structure.

or with the API:

import tcrgeometry
changed_pdb=tcrgeometry.change_tcr_geometry(pdb_file, out_path="./out", BA=113, BC1=98.7, BC2=9.3, AC1=71.5, AC2=154, dc=24)

Set the vis=True flag to generate a visualization of the modified structure.

This script will read the configuration file, apply the specified changes to the angles and distances, and output a new PDB file with the modified geometry.

Extract loop anchor residue coordinates

To extract the coordinates of loop anchor residues from a TCR structure, you can use the extract_loop_anchor.py script provided in the TRangle package. This script allows you to specify the loop anchor residues and extract their coordinates from a TCR structure file.

tcr-extract-anchor path/to/your/input.pdb

or with the API:

import tcrgeometry
anchor_coords = tcrgeometry.get_anchor_coords(pdb_file)

This will output a CSV file containing the coordinates of the specified loop anchor residues, which can be used for input to the CDR loop diffusion model.

Dataset: From STCRDB get non-redundant abTCR set of IMGT-numbered structures (resolution cutoff 3.0, sequence identity cutoff 70%)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tcrgeometry-0.1.8.tar.gz (715.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tcrgeometry-0.1.8-py3-none-any.whl (715.8 kB view details)

Uploaded Python 3

File details

Details for the file tcrgeometry-0.1.8.tar.gz.

File metadata

  • Download URL: tcrgeometry-0.1.8.tar.gz
  • Upload date:
  • Size: 715.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for tcrgeometry-0.1.8.tar.gz
Algorithm Hash digest
SHA256 3943e523725a22cba0ce1fa77e71142f41d44947bd686c5cfffd8a346991595b
MD5 c5c324083a15c201fc722c2286c0d0a2
BLAKE2b-256 cb547f6a908951bea3b6b9276bf88149805084f553acfa5c7e5469cb76be25a0

See more details on using hashes here.

File details

Details for the file tcrgeometry-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: tcrgeometry-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 715.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.13

File hashes

Hashes for tcrgeometry-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c91dd4402d237e07cb117dea13f84fe16513d58da16cf950e0f1eca0cd9f4285
MD5 29bccc357c0261c5319a04a6b1497be9
BLAKE2b-256 9e476b7ef41c58247222c4978e44888b6e12c97ed40d6b7c58dd24e642f21bac

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page