Skip to content

Instantly share code, notes, and snippets.

View filipsPL's full-sized avatar
💭
🚀 travelling to Mars and back

filips filipsPL

💭
🚀 travelling to Mars and back
View GitHub Profile
@filipsPL
filipsPL / split_ligand.py
Last active November 12, 2015 12:35
split molecule file to separate components and save to multiple files.
### split molecule file to separate components and save to multiple files.
import pybel
from openbabel import *
mol = pybel.readfile('mol2', 'ligand.mol2').next()
separated = mol.OBMol.Separate()
def writeOut( theConformer, outputPath ):
myConversion = OBConversion()
@<TRIPOS>MOLECULE
pary/165D/ligand.pdb
57 54 0 0 0
SMALL
GASTEIGER
@<TRIPOS>ATOM
1 RH -2.4540 0.1530 21.4230 Rh 19 RHD19 0.0000
2 N1 -0.6230 -0.6450 20.7690 N.3 19 RHD19 0.0000
3 N2 -3.4790 -1.1210 20.1210 N.3 19 RHD19 0.0000