Skip to content

Instantly share code, notes, and snippets.

View olas's full-sized avatar

Ola Spjuth olas

View GitHub Profile
//Create same mol in 2 representations
sam1=cdk.fromSMILES("CN(C)CCC1=CNC2=C1C=C(C=C2)CC1NC(=O)OC1");
sam2=cdk.fromSMILES("CN(C)CCC1=CNc2c1cc(cc2)CC1NC(=O)OC1");
js.print("\n==========\n==========\n")
//Print out sybyl atom types (works fine)
js.print("\n\nPerceive sybyl atom types on molecules directly:\n");
syb1=cdx.perceiveSybylAtomTypes(sam1)
js.print(syb1);
@olas
olas / adSDFprop.js
Created July 24, 2009 11:33
Add property to SDF from file
//***************************************************************
// Script that iterates over an SDFile and adds precalculated values
// from an external file as a property and saves as a new SDFile.
//
// The file with values have one value per row in same order as
// the molecukes in the SDFile.
//
// Author: Ola Spjuth
//****************************************************************
@olas
olas / calcPropsSdf.js
Created May 5, 2009 15:20
Iterate over SDFile, calculates properties, and stores in new SDF.
//***************************************************************
// Script that iterates over a file, calculates properties
// and stores all in a new SDFile. Requires Sample Data installed.
//
// Author: Ola Spjuth
//****************************************************************
it = cdk.createMoleculeIterator("/Sample Data/SDF/Fragments2.sdf");
list=cdk.createMoleculeList();
@olas
olas / hivpred_plugin.js
Created May 4, 2009 09:37
Call hivpred with plugin installed
/*******************************************************************************
* Script to predict the susceptibility of an HIV protease sequence for seven
* drugs based on the proteochemometric model described in:
* Lapins M, Eklund M, Spjuth O, Prusis P, Wikberg JE.
* Proteochemometric modeling of HIV protease susceptibility,
* BMC Bioinformatics. 2008 Apr 10;9:181. .
*
* Script accepts a 99 aa sequence as input and delivers susceptbiliy values
* for the drugs Amprenavir, Atazanavir, Indinavir, Lopinavir, Nelfinavir,
* Ritonavir, and Saquinavir.
/*******************************************************************************
* Bioclipse-script to iteratively build a molecule in JChemPaint
* Author: Ola Spjuth
* Author: Egon Willighagen
******************************************************************************/
//Start with a carbon and open in JCP
mol=cdk.fromSMILES("C")
mol2=cdk.generate2dCoordinates(mol)
ui.open(mol2)
@olas
olas / buildmol
Created April 16, 2009 17:07
Build a mol in JCP via script
/*******************************************************************************
* Bioclipse-script to iteratively build a molecule in JChemPaint
* Author: Ola Spjuth
******************************************************************************/
//Start with a carbon and open in JCP
mol=cdk.fromSMILES("C")
mol2=cdk.generate2dCoordinates(mol)
ui.open(mol2)
@olas
olas / Multiple-mol-manipulation.js
Created April 15, 2009 14:09
Basic manipulation of multiple mols
//Demonstrates basic manipulation of multiple molecules in Bioclipse
//Requires sample data installed in default location
mols=cdk.loadMolecules("/Sample Data/SDF/Fragments2.sdf")
mols.size()
mol=mols.get(3)
cdk.calculateSMILES(mols.get(4))
ui.open(mols)
@olas
olas / DNA-isosurface-Jmol.js
Created April 15, 2009 13:55
DNA isosurface in Jmol
//Download PDB via Web service at EBI and open in Jmol
res=ws.queryPDB("1d66")
ui.openFiles(res)
//Execute some jmol script commands
jmol.run("select all; spacefill 0; wireframe off; cartoon on;select none")
jmol.run("select !dna; isosurface solvent; select none; color isosurface blue")
jmol.spinOn()
@olas
olas / gencoords.js
Created April 15, 2009 13:06
Generate different coordinates on a list of molecules
/*******************************************************************************
* Bioclipse-script to generate different coordinates on a list of molecules.
* Author: Ola Spjuth
******************************************************************************/
//Create list of molecules
mols=cdk.createMoleculeList();
mols.add(cdk.fromSMILES("CCC"));
mols.add(cdk.fromSMILES("CCCNCC"));
mols.add(cdk.fromSMILES("CCNCCOC(C)CC"));
@olas
olas / Qsar single mol
Created April 14, 2009 14:04
Calculate 2 descr for a molecule
/*******************************************************************************
* Bioclipse script to calculate 2 descriptors for a molecule.
* Requires the Chemoinformatics and QSAR features to be installed.
*
* Author: Ola Spjuth
*
******************************************************************************/
mol=cdk.fromSMILES("C1CNCCC1CC(COC)CCNC");
descid="http://www.blueobelisk.org/ontologies/chemoinformatics-algorithms/#bpol";
descid2="http://www.blueobelisk.org/ontologies/chemoinformatics-algorithms/#hBondDonors";