Skip to content

tiwarylab/carboost

Repository files navigation

CARBOOST

About

CARBOOST: Chimeric Antigen Receptor Biophysically Oriented Optimization of Synaptic Topology.

This package implements the carboost protocol in inference stage as mentioned in the (manuscript - soon to be added). The carboost package repurposes previously estimated CD8 $\alpha$ derived CAR's end-to-end ($z_{e2e}$, perpendicular to membrane) distance densities ( $P(z_{e2e})$ ). Thus, for any given target receptor carboost can generate the target's $P(z_{e2e})$ and finally calculates the intermembrane distance (synaptic cleft).

Notebooks

Two colab notebooks are provided with this package:

  • A demo notebook to show how carboost protocol performs.
  • A toolkit notebook that uses colabfold and performs carboost protocol for any given sequences.

Install

It is strongly recommended a separate environment for this package, either with conda or venv. After activating the environment the carboost can be installed by:

pip install "git+https://github.com/tiwarylab/carboost.git"

If you want the folding module it is recommended to use Colabnotebook as colabfold $^{[1]}$ requires a GPU with internet available for MSA generation. Please follow the instructions presented in the toolkit notebook.

For local source installation, please clone the repository using git clone ... and simpy run

pip install .

Once the installtion is done you can performa quick check by running

python -c "import carboost; print(carboost.__version__)"

or

import carboost
print(carboost.__version__)

Modules

carboost protocol contains 3 modules.

Folding module (carboost.folding):

About

The folding module uses colabfold to generate structures of target receptor. The folding module is essentially a wrapper that also performs reduced MSA approach for AF2.

Usage

The module can be used as follows:

from carboost.folding import ColabFoldRunConfig, run_colabfold_pipeline

config = ColabFoldRunConfig(
    query_sequence = target_sequence,
    num_seeds = 1,
    max_msa='512:1024' # -> MSA length
)

summary = run_colabfold_pipeline(
    config=config,
    output_dir="CD22",
    zip_output=True,
    show_msa_plot=False,
    show_prediction_plot=False,
)

The above code shows how to use the folding module to run a vanilla AlphaFold2 using ColabFold $^{[1]}$ and MMSeq2 without any templates. This code can be adapted to perform reduced MSA $^{[2]}$ by changing max_msa to ['32:64', '16:32', '8:16', '4:8']. This is a free parameter and can chosen according to the timescale/lengthscale movement in the protein $^{[3]}$.

Receptor module (carboost.receptor):

About

The receptor module is used for analysis of the structural ensemble of target receptor generated by the folding module. This module essentially calculates $z_{e2e}$ distances for the target receptor by

  • Filtering out the structures that does not obey membrane geometry.
  • Calculating $e2e$ distance along the normal to the membrane plane.

Synapse module (carboost.synapse):

About

The synapse module calculates the intermembrane distance by convolving the CAR's $P(z_{e2e})$ and target's $P(z_{e2e})$ densities. This assumes the the invidual distributions are independent. Finally, this module also calculates the $\phi$ value that is used as a metric to predict the responsiveness of the CAR Tcell for the given target.

Usage

This module is written such that the $\phi$ values can be calculated in one-shot. The following code snippet can be used for the same.

hinge_sequence_lengths = [3,8,15,27,47,56,76]

for hinge_len in hinge_sequence_lengths:
    syn = SynapseBase(car_name=f"8H{hinge_len}", # book keeping
                      hinge_length=f"{hinge_len}", # book keeping
                      target_type="dynamic",
                      target_kde=probab_target,
                      car_kdes=probab_cars[hinge_len]['kdes'],
                      method_name='af2rave', # book keeping
                      x_car=probab_cars[hinge_len]['xval'].reshape(-1),
                      x_target=xx,
                      max_val_car=max_hinge_zvalues[hinge_len],
                      max_val_target=max(cos_dist_vals),
                      offset_value=scFv_offset+target_offset)
    Phi_values[hinge_len] = run_carboost_pipeline(syn)['phi']

All the variables used are explained in the Demo and the Toolkit notebooks presented.

Inference mode (resources)

About

Additionally, as we mentioned carboost uses the pre-existing CAR $P(z_{e2e})$. These are included under carboost/resources and are installed with pip.

Usage

For reduced MSA AF2 generated ensemble:

from carboost.utils.load_utils import load_rMSA_AF2_KDEs
probab_cars, max_cars = load_rMSA_AF2_KDEs(hinge_sequence_lengths=hinge_sequence_lengths,bandwidth=0.5)

For af2rave generated ensemble $^{[4,5]}$:

from carboost.utils.load_utils import load_af2rave_KDEs
probab_cars, max_cars = load_af2rave_KDEs(hinge_sequence_lengths=hinge_sequence_lengths)

NOTE: Please note that these distrbutions are not thermodynamically weighted (for rMSA AF2) or may not be converged (for af2rave). However, we have shown that these data can still give a good estimate on an optimal CD8 $\alpha$ derived CAR hinge.

NOTE: Further, rMSA AF2 structures under hinge_sequence_length < 40 with chemical bias can also provide a good estimate on the optimal CD8 $\alpha$ derived CAR hinge.

NOTE: If necessary the folding and receptor module can be used to generate structures and $P(z_{e2e})$ for any other hinges or CAR receptors to calculate the $\phi$ values. (An additional simulation module will be provided soon or upon request $^{[4,5]}$.)

Bibliography

This work

  • ...

ColabFold

  1. M. Mirdita, K. Schütze, Y. Moriwaki, L. Heo, S. Ovchinnikov, and M. Steinegger, “ColabFold: making protein folding accessible to all,” Nature Methods, vol. 19, no. 6. Springer Science and Business Media LLC, pp. 679–682, May 30, 2022. doi: 10.1038/s41592-022-01488-1.

reduced MSA AF2

  1. Diego del Alamo Davide Sala Hassane S Mchaourab Jens Meiler (2022) Sampling alternative conformational states of transporters and receptors with AlphaFold2. eLife 11:e75751.
Assigning timescales to reduced MSA AF2 structures
  1. Akashnathan Aranganathan, and Eric R. Beyerle, Applied Causality to Infer Prodein Dynamics and Kinetics. Journal of Chemical Information and Modelling 2026, 66, 3, 1661-1674. https://doi.org/10.1021/acs.jcim.5c02554

AF2RAVE

  1. Bodhi P. Vani, Akashnathan Aranganathan, Dedi Wang, and Pratyush Tiwary, AlphaFold2-RAVE: From Sequence to Boltzmann Ranking, J. Chem. Theory Comput. 2023, 19, 14, 4351–4354, https://doi.org/10.1021/acs.jctc.3c00290.
  2. Da Teng, Vanessa J. Meraz, Akashnathan Aranganathan, Xinyu Gu, and Pratyush Tiwary, AlphaFold2-RAVE: Protein Ensemble Generation with Physics-Based Sampling, ChemRxiv (2025) https://doi.org/10.26434/chemrxiv-2025-q3mwr

About

CAR-BOOSTing T-Cell Responsiveness through Synaptic Cleft Engineering

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages