Module for defining molecular components, modifications, and job configurations for Boltz-2
Project description
boltzjobs
boltzjobs is a Python package designed to streamline the process of creating YAML input files for Boltz-2.
It provides an intuitive, object-oriented interface for defining molecular sequences, constraints, and templates, and generates a correctly formatted YAML file.
Features
- Define protein, DNA, and RNA chains with support for residue modifications.
- Add ligands using either CCD codes or SMILES strings.
- Specify geometric constraints, including bonds, contacts, and binding pockets.
- Define mmCIF or PDB files as structural templates.
- Request property calculations, such as binding affinity.
Installation
pip install git+https://github.com/ugSUBMARINE/boltzjobs.git
Usage
The Job class is the main entry point for building a Boltz-2 input file. You can create a job, add different molecular components, and then write the final configuration to a YAML file.
from boltzjobs import Job
# 1. Create a new job
job = Job(name="Herceptin-HER2_complex_design")
# 2. Add molecular components
# Add a protein chain (HER2)
her2_chain = job.add_protein_chain(sequence="MELAALCRWGLLLALLPPGAASTQVCTGTDMKLRLPASPETHLDMLRHLYQGCQVVQGNLELTYLPTNASLSFLQDIQEVQGYVLIAHNQVRQVPLQRLRIVRGTQLFEDNYALAVLDNGDPLNNTTPVTGASPGGLRELQLRSLTEILKGGVLIQRNPQLCYQDTILWKDIFHKNNQLALTLIDTNRSR", ids="A")
# Add a second protein chain (Herceptin heavy chain)
herceptin_h = job.add_protein_chain(sequence="EVQLVESGGGLVQPGGSLRLSCAASGFNIKDTYIHWVRQAPGKGLEWVARIYPTNGYTRYADSVKGRFTISADTSKNTAYLQMNSLRAEDTAVYYCSRWGGDGFYAMDYWGQGTLVTVSS", ids="H")
# Add a ligand using a SMILES string
# The library automatically handles single-quoting the SMILES string in the YAML output
job.add_ligand(smiles="CC(=O)N[C@@H](C)C(=O)O", ids="L")
# 3. Define constraints and properties
# Define a binding pocket for the ligand, specifying contact residues on chain A
pocket = job.add_pocket(binder="L", max_distance=6.0)
pocket.add_contact_token("A", 8)
pocket.add_contact_token("A", 12)
# Request an affinity calculation for the ligand
job.request_affinity(binder="L")
# 4. Add structural templates
job.add_template(cif="templates/1n8z.cif", chain_id="A")
# 5. Write the final YAML file
# The output will be correctly formatted for Boltz-2.
job.write_yaml("boltz_input.yaml")
print("Successfully generated boltz_input.yaml")
print("-" * 20)
print(job) # You can also print the job object for a summary
This will generate a boltz_input.yaml file with the following content:
version: 1
sequences:
- protein:
id: A
sequence: MELAALCRWGLLLALLPPGAASTQVCTGTDMKLRLPASPETHLDMLRHLYQGCQVVQGNLELTYLPTNASLSFLQDIQEVQGYVLIAHNQVRQVPLQRLRIVRGTQLFEDNYALAVLDNGDPLNNTTPVTGASPGGLRELQLRSLTEILKGGVLIQRNPQLCYQDTILWKDIFHKNNQLALTLIDTNRSR
- protein:
id: H
sequence: EVQLVESGGGLVQPGGSLRLSCAASGFNIKDTYIHWVRQAPGKGLEWVARIYPTNGYTRYADSVKGRFTISADTSKNTAYLQMNSLRAEDTAVYYCSRWGGDGFYAMDYWGQGTLVTVSS
- ligand:
id: L
smiles: 'CC(=O)N[C@@H](C)C(=O)O'
constraints:
- pocket:
binder: L
contacts: [[A, 8], [A, 12]]
max_distance: 6.0
templates:
- cif: templates/1n8z.cif
chain_id: A
properties:
- affinity:
binder: L
License
This project is licensed under the MIT License.
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file boltzjobs-0.2.0-py3-none-any.whl.
File metadata
- Download URL: boltzjobs-0.2.0-py3-none-any.whl
- Upload date:
- Size: 14.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04fcf4267b16935edefb37f7bdf2c26f4c1c8666e6f979b9f4f79112ed42e6a8
|
|
| MD5 |
58a22594634a659d0d6860fb9bc4c130
|
|
| BLAKE2b-256 |
899ef6a7c6863eeab4b6a1fbdd2e937c04d0f1f9e15a49cb2cb4cc3067378046
|