From: SourceForge.net <no...@so...> - 2003-08-05 11:46:41
|
Support Requests item #738493, was opened at 2003-05-15 22:58 Message generated for change (Settings changed) made by egonw You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=220024&aid=738493&group_id=20024 Category: None Group: None >Status: Closed Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: getting structure from RTools.Getoverlaps Initial Comment: I am trying to use the CDK RTools feature : getOverlaps public static java.util.List getOverlaps (AtomContainer g1, AtomContainer g2) Returns all the maximal common substructure between 2 atom containers Parameters: g1 - first molecule g2 - second molecule Returns: the list of all the maximal common substructure found projected of g1 (list of AtomContainer ) My problem is that I can get out the list of AtomContainers, but I cannot cast them to Molecules in order to get the SMILES: int listsize = myList.size(); if (myList.get(0) instanceof AtomContainer) { AtomContainer ac = (AtomContainer)myList.get (0); if (ac instanceof Molecule) //fails { SmilesGenerator sg = new SmilesGenerator (); // Molecule m2 = (Molecule)ac; String myString = sg.createSMILES(m2); } } Any ideas? Many thanks. Steve Jones. ste...@gs... ---------------------------------------------------------------------- Comment By: Steve Jones (wag602389) Date: 2003-08-05 13:40 Message: Logged In: YES user_id=779860 Egon, That worked fine. Thanks. Steve. ---------------------------------------------------------------------- Comment By: Egon Willighagen (egonw) Date: 2003-05-21 09:11 Message: Logged In: YES user_id=25678 AtomContainer's are easily converted to Molecules by doing: Molecule mol = new Molecule((AtomContainer)ac); Note that this constructor does not check wether the molecule is fully connected. The code could be: int listsize = myList.size(); if (myList.get(0) instanceof AtomContainer) { AtomContainer ac = (AtomContainer)myList.get(0); Molecule mol = new Molecule(ac); SmilesGenerator sg = new SmilesGenerator(); String myString = sg.createSMILES(mol); } ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=220024&aid=738493&group_id=20024 |