Skip to content

Instantly share code, notes, and snippets.

@baoilleach
baoilleach / povraymolecules.py
Created March 10, 2014 17:10
Create a Povray image of a molecule
import math
import sys
import numpy as np
import pybel
ob = pybel.ob
from collections import defaultdict
header = """#include "textures.inc"
#include "colors.inc"
#include "functions.inc"
@baoilleach
baoilleach / obdotnet.txt
Last active August 29, 2015 13:59
Compiling a 64-bit .NET version of Open Babel
x86 version
===========
C:\Windows\Microsoft.NET\Framework\v4.0.30319\csc.exe /target:library /platform:x86 /keyfile:C:/Tools/openbabel/nextmoveob/windows-vc2008/Distribution/obdotnet.snk /optimize /out:C:/Tools/openbabel/nextmoveob/scripts/csharp/OBDotNet.dll *.cs
giving...
C:\Tools\openbabel\nextmoveob\scripts\csharp>file OBDotNet.dll
OBDotNet.dll: PE32 executable (DLL) (console) Intel 80386 Mono/.Net assembly, for MS Windows
x64 version
@baoilleach
baoilleach / gvimjs.txt
Last active August 29, 2015 14:00
Gvim for javascript
Install node.js 64-bit msi
Add C:\Program Files\nodejs to the PATH if not already present
npm install jshint # Installs to C:\Users\Noel\module_modules\jshint
let g:syntastic_javascript_checkers=['jshint']
let g:syntastic_jshint_exec='C:\Users\Noel\node_modules\.bin\jshint.cmd'
@baoilleach
baoilleach / scan.txt
Created September 24, 2014 19:14
How to scan documents into a pdf
1. Microsoft Office Document Scanning
2. Black & White
3. File Save As "A.tif"
4. Insert images into Word, reduce the margins and save as PDF
#!/usr/bin/env python
# Call with python CleanBinaryStrings.py <binaryName>
# Will edit the binary in place
import struct
import sys
import mmap
import string
import binascii
import hashlib
import subprocess
@baoilleach
baoilleach / skolnik.rst
Last active August 29, 2015 14:27
Notes from Herman Skolnik ACS 2015

Herman Skolnik Award Symposium

  • Postdoc at Biosym on DFT of enzyme-inhibitor cmplexes
  • At BMS he worked on protein modeling

Looking for the printing press in Jurgen's office

Jane Tseng

import os
import glob
import subprocess
testprogram = """
#include <openbabel/parsmart.h>
using namespace OpenBabel;
int main(int argc, char *argv[]) {
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"]
# 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
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.