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.
 
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);   
     }
     catch(Exception e){
      System.out.println("ERROR");
     }
     
     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();) {
      needle.removeBond(m.getBond( ((Integer)i.next()).intValue() ));
     }     
 
     for (int i=0; i<needle.getAtomCount(); i++){
      if ( needle.getConnectedAtomsCount(needle.getAtom(i)) ==0)
       needle.removeAtom(needle.getAtom(i));
     }
     for (int i=0; i<needle.getBondCount(); i++){
      if ( needle.getBond(i).getAtomCount()<2 )
       needle.removeBond(i);
     }
    }
      return new Molecule(needle);
 }
 
What is wrong in this code?
Do you know any way to make this?
 
Thanks a lot!!
PD: Sorry for my english!
 
-------------------------------------------------------------------------
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