Hi again.

Firstly thank you for the help! This is a very important issue in my
project, so I was interested in solving it.
I saw the NoMCSS.java you provide and it's very useful for me. I use this
code in my application, but don't work correctly, because when I'm going to
display the uncommon parts, an error occurs, in the case the part only
contains one atom (I use 'StructureCDK plugin' to display molecules). I've
adapted NoMCSS.java to my code, and it is:

// m: a molecule I want obtain the uncommon part with another molecule.
// comun: MCSS between 'm' and another molecule
        public static MoleculeSet getNoComun(Molecule m, Molecule comun) {
                   Molecule noComun = new Molecule(m);
                   Vector idlist = new Vector();

                   List l = null;
                   try{
                           l =
UniversalIsomorphismTester.getSubgraphAtomsMaps(noComun, comun);
                   }
                   catch(Exception e){
                           System.out.println(" ERROR: "+e);
                   }
                   
                   List maplist = (List)l.get(0);
                   for (Iterator i = maplist.iterator(); i.hasNext(); ) {
                           RMap rmap = (RMap)i.next();
                           idlist.add( new Integer( rmap.getId1() ) );
                           }
                   
                   HashSet hs = new HashSet(idlist);
                   for (Iterator i = hs.iterator(); i.hasNext();) {
        
noComun.removeAtomAndConnectedElectronContainers(noComun.getAtom(
((Integer)i.next()).intValue() ));
                           }
                   
                   IMolecule im = (IMolecule)noComun;
                   MoleculeSet ms = (MoleculeSet)
ConnectivityChecker.partitionIntoMolecules(im);
                   
                   return ms;
        }
Then, I accede to all molecules in MoleculeSet and show them as the uncommon
part between 'm' and another molecule ('m' minus 'comun').
A result of this is in http://www.uco.es/~i12muzaf/mcss.PNG. This don't work
correctly again, and I don't know the reason. I think it is due to the bonds
between the mcss and uncommon part, because it's possible they can be
removed by the method 'removeAtomAndConnectedElectronContainers'.
So I'll try solve it by any way.

Thank you very much!


-----Mensaje original-----
De: Rajarshi Guha [mailto:[EMAIL PROTECTED] 
Enviado el: miƩrcoles, 14 de noviembre de 2007 0:50
Para: Javi Muriel Zafra
CC: [email protected]
Asunto: Re: [Cdk-user] MCSS in CDK


On Nov 13, 2007, at 2:49 PM, Javi Muriel Zafra wrote:

>
> Hi all!
> I need to know how I can obtain the no common structure between two 
> molecules.
> I use the method UniversalIsomorphismTester.getOverlaps to get the 
> MCSS. Then I need to know, furthermore MCSS between this molecules, 
> the no common structure in each molecule.

Note that if you want the substructure of X that is not part of the MCSS
between X & Y, you may have more than one substructure. As an example
consider

CSC1CC1NC and C1CC1CCC

The MCSS is C1CC1. But the uncommon parts for the first one will be CS and
NC and the uncommon part of the second one will be just CCC

If this is what you want, then see http://
cheminfo.informatics.indiana.edu/~rguha/code/java/NoMCSS.java

>  I do the following:
>
> // This method return the no common structure between m and mcs, where 
> mcs is the mcss between m and another molecule // So, if I remove from 
> m the bonds which appear in mcs, I have the no common structure, but 
> don't work exactly.
>  public static Molecule getneedle(Molecule m, Molecule mcs) {
>      Molecule needle = new Molecule(m);
>      Vector idlist = new Vector();
>
>      List l = null;
>      try{
>       l = UniversalIsomorphismTester.getSubgraphMaps(m, mcs);

It is easier if you use getSubgraphAtomsMaps, since we can then remove atoms
and associated bonds in one go

Once you have deleted atoms and bonds, you will in general end up with a
molecule that has disconnected components. Using the ConnectivityChecker it
is easy to create a IMoleculeSet from such a molecule. The contents of the
IMoleculeSet are the 'uncommon' parts of a molecule (i.e., the molecule
minus the MCSS)

-------------------------------------------------------------------
Rajarshi Guha  <[EMAIL PROTECTED]>
GPG Fingerprint: 0CCA 8EE2 2EEB 25E2 AB04  06F7 1BB9 E634 9B87 56EE
-------------------------------------------------------------------

If you believe in telekinesis, raise my hand.




-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to