Skip to main content

A fragment-based molecular assembly toolkit for python.

Project description

Documentation Status CodeFactor

Biobuild is a molecular building suite designed to facilitate the creation of large biomolecules such as glycans. It allows for an easy molecule creation process in a jupyter-notebook environment. Biobuild offers direct integrations to PubChem, and the PDBE component library as well as the CHARMM project for pre-defined component structures and linkage types.

biobuild 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

biobuild cannot:

  • generate circular structures (users need to choose suitable templates with rings already present)
  • imitate real-life chemical reaction mechanisms
  • perform molecular dynamics or quantum chemistry computations
  • generate molecules for the user - the user needs to know what they want to build...

Example - building a dendrimer

Let's build a polyphenylene dendrimer

import biobuild as bb

bb.load_small_molecules()

benzene = bb.molecule("benzene")

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

# set up the linkage instructions
# always shifting the carbon at which to attach
link = bb.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 = bb.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")

Example - building a glycan

Because Biobuild has data on glycosyidic linkages from CHARMM, we can build glycan structures from scratch by referencing the linkages from CHARMM.

import biobuild as bb

# load the sugar dataset from PDBE
bb.load_sugars()

# get the monosaccharides
# (using their PDBE identifiers)
nag = bb.molecule("NAG") # N-acetylglucosamine, a.k.a. GlcNAc
bma = bb.molecule("BMA") # beta-mannose
man = bb.molecule("MAN") # alpha-mannose

# start by connecting two NAGs together
# 'beta 1->4' glycosydic linkage is pre-defined
# in the CHARMM force field and can be used by its name '14bb' directly
glycan = bb.connect(nag, nag,  "14bb")

# add a beta-mannose to the last NAG
glycan.attach(bma, "14bb")

# add an alpha-mannose to the beta-mannose
# using an 'alpha 1->3' linkage ('13ab' in CHARMM)
glycan.attach(man, "13ab")

# add another alpha-mannose
# at the second-to-last residue (BMA)
glycan.attach(man, "16ab", at_residue=-2)

# add one final alpha-mannose (using shorter syntax)
glycan = glycan % "16ab" + man 

# now visualise the structure
glycan.show()

# and save to a PDB file
glycan.to_pdb("my_glycan.pdb")

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

biobuild-3.10.11.tar.gz (11.8 MB view details)

Uploaded Source

File details

Details for the file biobuild-3.10.11.tar.gz.

File metadata

  • Download URL: biobuild-3.10.11.tar.gz
  • Upload date:
  • Size: 11.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for biobuild-3.10.11.tar.gz
Algorithm Hash digest
SHA256 233b1f5a44b4324e2e223eb569bcf0cf74dbbb6a788b767d786ecc7ec552f058
MD5 5811c36072288c521d12036df83e9bd8
BLAKE2b-256 007043df7ccedded4cafabdb32d0c2c99255bd1c6abab73aa271cfe5f5f2bf0f

See more details on using hashes here.

Supported by

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