Skip to content

Instantly share code, notes, and snippets.

View olas's full-sized avatar

Ola Spjuth olas

View GitHub Profile
@olas
olas / hivpred.js
Created January 15, 2009 14:44
Predict drug susceptibility for HIV mutant using XMPP service
/*******************************************************************************
* 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.
@olas
olas / Downlaod and rotate PDB.js
Created March 16, 2009 10:30
Downlaod and rotate PDB
//Download PDB
res=ws.downloadPDBAsFile("1d66")
ui.open(res)
//Do some jmol visualization
jmol.run("move 0 0 90 00 0 0 0 0 1;set selectionhalos off; select all; spacefill 0; cartoon on;")
jmol.run("select nucleic; isosurface dna1 solvent; delay 1; color isosurface red;");
jmol.run("delay 1; color isosurface blue; delay 1; color isosurface translucent; move 0 360 90 90 0 0 0 0 4;");
@olas
olas / Calculate descriptors for list of mols.js
Created April 14, 2009 13:57
Calculate a list of descriptors (no params) for a list of molecules
/*******************************************************************************
* Bioclipse-script to calculate a list of descriptors for a list of molecules.
* This script does not support parameters to descriptors and requires the
* Chemoinformatics and QSAR features to be installed.
*
* Author: Ola Spjuth
*
******************************************************************************/
//Set up list of descriptors
@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";
@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 / 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 / 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 / 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)
/*******************************************************************************
* 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 / 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.