Hi Pascal,
for the CDK, we decided that we want it to behave like a Lego construction set.
Each of the components should only do the minimal promised work, which gives
maximum flexibility in wiring things together as you like them.
In your example, you would always need to do aromaticity detection (using some
CDKHueckelAromaticityDetector.java or so) to do the detection before doing the
Murcko stuff.
The reasoning in this case, although a bit artificial in this case, might be
that some dude somewhere might want to do the Murcko fragmentation on the
Kekule-Representations instead of the aromaticity-marked one and if we do the
aromaticity detection *inside* the Murcko fragmentation, we hinder him to do so.
As usual, a note on this behaviour should go into the Javadoc documentation :-)
Hope that helps,
Chris
On 30 Sep 2010, at 10:08, Pascal Muller wrote:
> Hi,
>
> I would like to generate Murcko framework for my library (a big Zinc
> subset). But for now, I'm just trying to do it for a few smiles :)
> After a bit of googling and java initiation (not so easy for me :) -
> thanks to Rajarshi, Egon, Christian and other who let some pieces of
> code there and there!), CDK seems to do what I want.
>
> But, in the case I tried, the Murcko framework is not the same for an
> aromatic phenyl (c1ccccc1 - gives saturated cycle) and for a "double
> bond" phenyl (C1=CC=CC=C1 - stays unsaturated).
>
> I tested these two smiles:
> CCCNCC1=CC(CC2CC2)=CC=C1 which gives C=1C=CC=C(C=1)CC2CC2 (seems OK to me)
> and
> CCCNCc1cccc(CC2CC2)c1 which gives C1CCCC(C1)CC2CC2 (saturated cyclohexyl).
>
> Is it what is expected?
>
> Below is the code I used.
>
> Many thanks if you can have a look at it,
> Regards,
> Pascal
>
>
> import org.openscience.cdk.interfaces.*; // I had so much errors when
> I tried snippets of code that I lost patience and put * everywhere
> import org.openscience.cdk.*;
> import org.openscience.cdk.exception.*;
> import org.openscience.cdk.graph.*;
> import org.openscience.cdk.ringsearch.*;
> import org.openscience.cdk.smiles.*;
> import org.openscience.cdk.atomtype.*;
> import org.openscience.cdk.tools.*;
> import org.openscience.cdk.tools.manipulator.*;
>
> public class ex {
> public static void main(String args[]) throws Exception {
>
> GenerateFragments gf=new GenerateFragments(); // Should this
> line be
> reproduced for each molecule? (eg gf1, gf2...)
> boolean bol = true; // A boolean for the generateMurckoFragments
> function - is it right?
>
> IMolecule mol = null;
> SmilesParser sp1 = new
> SmilesParser(DefaultChemObjectBuilder.getInstance());
> mol = sp1.parseSmiles("CCCNCC1=CC(CC2CC2)=CC=C1"); // I'm sure
> it
> could be possible to read file.smi and go through it - if anybody has
> an example code...? Thanks :)
> System.out.println("CCCNCC1=CC(CC2CC2)=CC=C1");
> gf.generateMurckoFragments(mol,bol,bol,3);
> String[] smiles1=gf.getMurckoFrameworksAsSmileArray();
> for (int i = 0; i < smiles1.length; i++) { // But there is only
> one
> MurckoFramework for a molecule, isn't it?
> System.out.println(smiles1[i]);
> }
>
> mol = null;
> SmilesParser sp2 = new
> SmilesParser(DefaultChemObjectBuilder.getInstance());
> mol = sp2.parseSmiles("CCCNCc1cccc(CC2CC2)c1");
> System.out.println("CCCNCc1cccc(CC2CC2)c1");
> gf.generateMurckoFragments(mol,bol,bol,3);
> String[] smiles2=gf.getMurckoFrameworksAsSmileArray();
> System.out.println(smiles2[0]);
> }
> }
>
>
>
> Compiled and executed with
> javac -classpath /opt/CDK/CDK_1.2.7/cdk-1.2.7.jar ex.java
> java -classpath .:/opt/CDK/CDK_1.2.7/cdk-1.2.7.jar ex
>
> ------------------------------------------------------------------------------
> Start uncovering the many advantages of virtual appliances
> and start using them to simplify application deployment and
> accelerate your shift to cloud computing.
> http://p.sf.net/sfu/novell-sfdev2dev
> _______________________________________________
> Cdk-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cdk-user
--
Dr. Christoph Steinbeck
Head of Chemoinformatics and Metabolism
European Bioinformatics Institute (EBI)
Wellcome Trust Genome Campus
Hinxton, Cambridge CB10 1SD UK
Phone +44 1223 49 2640
Video meliora proboque deteriora sequor.
... Ovid, Metamorphoses VII, 20/21
------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user