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
Metadata
Release files for boltzjobs 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| boltzjobs-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for boltzjobs-0.2.0-py3-none-any.whl |
Release files / boltzjobs-0.2.0-py3-none-any.whl
| Download URL | boltzjobs-0.2.0-py3-none-any.whl |
|---|---|
| Size | 14.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
04fcf4267b16935edefb37f7bdf2c26f4c1c8666e6f979b9f4f79112ed42e6a8
|
|
BLAKE2b-256 checksum How to use checksums |
899ef6a7c6863eeab4b6a1fbdd2e937c04d0f1f9e15a49cb2cb4cc3067378046
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.0
|
Security for boltzjobs 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.