Skip to content

NoahHenrikKleinschmidt/buildamol

Repository files navigation



cite - BMC Cheminformatics version DOI - 10.5281/zenodo.13169192 Made with Python Documentation Status Check out - Tutorials PyPI version Downloads code style - black CodeFactor

BuildAMol is a molecular building suite designed to facilitate the generation and alteration of atomic models for large and small chemical structures.

It allows for an easy modeling process inside a Jupyter Notebook or can be integrated into automated pipelines. BuildAMol offers direct integrations to PubChem, and the PDBE component library as well as the CHARMM project to provide pre-defined template structures and linkages to use out-of-the-box. Quick-conversions to popular libraries such as RDKit allow for a smooth workflow, going from modeling to analysis.

BuildAMol allows users to:

  • build any larger molecular structure they like
  • improve the conformation of an existing structure
  • convert data formats
  • visualize the structures as they build them
  • quickly obtain molecular structures for chemical compounds

BuildAMol cannot:

  • imitate real-life chemical reaction mechanisms
  • perform molecular dynamics or quantum chemistry computations
  • generate molecules for the user out of the blue - the user needs to know what they want to build...

Installing BuildAMol

BuildAMol can be installed via pip using:

pip install buildamol

Getting Started

BuildAMol has a comprehensive documentation on ReadTheDocs. There you can find also also a number of tutorials to get you started on the API covering both basic operations as well as more complex and applied workflows such as building materials, preparing molecules for molecular dynamics, or designing protein ligands.

BuildAMol Paper

To learn more about the benchmarking we did and further details on the software, please check out the BuildAMol paper. Also, if you were using BuildAMol for your project, please cite the paper ❤️

@article{buildamol,
	author = {Kleinschmidt, Noah and Lemmin, Thomas},
	journal = {Journal of Cheminformatics},
	number = {1},
	pages = {104},
	title = {BuildAMol: a versatile Python toolkit for fragment-based molecular design},
	volume = {16},
	year = {2024}}

Quick Example - Building A Dendrimer

Open In Colab

This code will model a polyphenylene dendrimer as it was originally described by Bauer et al. (2002).

import buildamol as bam

bam.load_small_molecules()

benzene = bam.molecule("benzene")

# -----------------------------
#     make the periphery
# -----------------------------
periphery = benzene.copy()

# set up the linkage instructions
# always shifting the carbon at which to attach
link = bam.linkage("C1", "C1")
for carbon in range(1, 6):
    link.atom1 = f"C{carbon}"
    periphery.attach(benzene, link, at_residue=1)

# -----------------------------
#     assemble the molecule
# -----------------------------
mol = benzene.copy()
link2 = bam.linkage("C1", "C4")

# and attach the periphery to the core
for carbon in mol.get_atoms("C", by="element"):
    link2.atom1 = carbon
    mol.attach(periphery, link2, at_residue=1, other_residue=2)

# -----------------------------
#   optimize the conformation
# -----------------------------
mol.optimize()
mol.to_pdb("polyphenylene.pdb")