Not Logged In  
Register
e-Science Central

Inkspot Software Tools

Sat, 9 Jan 2010 12:59
David Leahy

Here is one of the first workflow blocks I wrote using R. Very simple, the rcdk library does all the hard work of parsing the SMILES, creating the molecule and calculating LogP. I just have to read in and write out to the workflow ports correctly. SHould get even easier when Hugo delivers the new workflow block upload/definition tools

#open the rcdk library
library(rcdk);

#get the smiles from the input port of the workflow block
input <- input_text;

#parse the smiles to create a cdl molecule object
sp <- get.smiles.parser();
mols <- sapply(input, parse.smiles, parser = sp);

#add hydrogens
lapply(mols, convert.implicit.to.explicit);

#calculate ALogP value and pass to output port of workflow block
alogp <- data.matrix(as.double(sapply(mols, get.alogp)));

 

 

Comment on this post




Register with InkSpot

Sign in with another account

Login









Other Ways of Signing In
expand Attached Files