This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import pybel | |
def sqr_dist(a, b): | |
ac = a.coords | |
bc = b.coords | |
return (ac[0]-bc[0])**2 + (ac[1]-bc[1])**2 + (ac[2]-bc[2])**2 | |
# Definitions taken from | |
# http://baoilleach.blogspot.com/2007/07/pybel-hack-that-sd-file.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import glob | |
import subprocess | |
testprogram = """ | |
#include <openbabel/parsmart.h> | |
using namespace OpenBabel; | |
int main(int argc, char *argv[]) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib | |
import random | |
import pdb | |
import pybel | |
def getfromPubChem(N = 100, filenames = None): | |
"""Download N random PubChem molecules as 2D and 3D""" | |
if filenames == None: | |
filenames = ["2Ddataset.sdf", "3Ddataset.sdf"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requires PyActiveResource (http://code.google.com/p/pyactiveresource/) | |
from pyactiveresource.activeresource import ActiveResource | |
registry_id = "16" # Replace this with your registry_id | |
password = "password" | |
user = "baoilleach@gmail.com" | |
site = "https://chemcaster.com/registries/$registry_id/" | |
class Structure(ActiveResource): | |
_site = site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Generate the enol from the ketone...OBChemTsfm..not quite.. | |
>>> t.Init("[C:2](C)(=[O:1])[CH2]", "[C:2](C)([O:1])=C") | |
True | |
Chris says: | |
[*:2][C:3](=[O:1])[C:4] >> [*:2][C:3]([O:1])=[C:4] | |
works for ketones, except t-butyl ketones are wrong. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""sdfdatareader.py | |
Super fast skimmer over sdf files just to return the data | |
fields | |
""" | |
def sdf(filename): | |
input = open(filename, "r") | |
data = {} | |
for line in input: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/server freenode | |
/nick baoilleach | |
/msg NickServ identify ****** | |
/join openbabel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os, os.path | |
import sys | |
import smtplib | |
import datetime | |
nightly_dir = '/home/oboyle/not-backed-up' | |
output = open(os.path.join(nightly_dir, 'log.txt'),"a") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
root=/home/oboyle/not-backed-up | |
prefix=$root/tree | |
if [ ! -d $root ] | |
then | |
echo "Cannot find the autobuild folder: $root" | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Download Visual C++ 2008 Express Edition. | |
C:\Tools\OpenBabel\trunk>"C:\Program Files\CMake 2.6\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=..\buildtrunk -G "Visual Studio 9 2008" -DLIBXML2_LIBRARIES=windows-vc2005\libxml2.lib -DZLIB_LIBRARY=windows-vc2005\zlib1.lib -DLIBXML2_INCLUDE_DIR=windows-vc2005 -DZLIB_INCLUDE_DIR=windows-vc2005 | |
Open openbabel.sln and build |
OlderNewer