Examples of parseSmiles()


Examples of org.openscience.cdk.smiles.SmilesParser.parseSmiles()

  /**
   * @param args
   */
  public static void main(String[] args) throws Exception {
    SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
    IMolecule mol = sp.parseSmiles("C1CC12CC2CC1CC1");
    AllRingsFinder ar = new AllRingsFinder();
    IRingSet ringSet = ar.findAllRings(mol);
    List l = RingPartitioner.partitionRings(ringSet);
    for(Object o : l) {
      IAtomContainer ac = RingPartitioner.convertToAtomContainer((IRingSet)o);
View Full Code Here

Examples of org.openscience.cdk.smiles.SmilesParser.parseSmiles()

                return null;
            }
        } else { // OK, it must be a SMILES
            SmilesParser smilesParser = new SmilesParser(DefaultChemObjectBuilder.getInstance());
            try {
                molecule = smilesParser.parseSmiles(text);
            } catch (InvalidSmilesException e1) {
                JOptionPane.showMessageDialog(jChemPaintPanel, GT.get("Invalid SMILES specified"));
                return null;
            }
        }
View Full Code Here

Examples of org.openscience.cdk.smiles.SmilesParser.parseSmiles()

        if (!found) return null;

        // got the canonical SMILES, lets get the molecule
        SmilesParser smilesParser = new SmilesParser(DefaultChemObjectBuilder.getInstance());
        try {
          IAtomContainer mol=smilesParser.parseSmiles(smiles);
            //for some reason, smilesparser sets valencies, which we don't want in jcp
            for(int i=0;i<mol.getAtomCount();i++){
              mol.getAtom(i).setValency(null);
            }
            return mol;
View Full Code Here

Examples of org.openscience.cdk.smiles.SmilesParser.parseSmiles()

                        toPaste = InChITool.parseInChI(content);
                    }
                    else {   
                        SmilesParser sp = new SmilesParser(
                                DefaultChemObjectBuilder.getInstance());
                        toPaste = sp.parseSmiles(
                                ((String) transfer.getTransferData(
                                        DataFlavor.stringFlavor)).trim());
                        toPaste = new FixBondOrdersTool().kekuliseAromaticRings(toPaste);

                        IAtomContainerSet mols = ConnectivityChecker.partitionIntoMolecules(toPaste);
View Full Code Here

Examples of org.openscience.cdk.smiles.SmilesParser.parseSmiles()

    public void loadModelFromSmiles(String smiles) {
        if (smiles != null) {
            try {
                SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder
                        .getInstance());
                IAtomContainer mol = sp.parseSmiles(smiles);

                //for some reason, smilesparser sets valencies, which we don't want in jcp
                for(int i=0;i<mol.getAtomCount();i++){
                  mol.getAtom(i).setValency(null);
                }
View Full Code Here

Examples of org.openscience.cdk.smiles.SmilesParser.parseSmiles()

                }else if(((char)i)=='\n' || ((char)i)=='\r'){
                    if(!sb.toString().equals("")){
                        StringTokenizer st=new StringTokenizer(sb.toString());
                        String key=(String)st.nextElement();
                        String value=(String)st.nextElement();
                        IAtomContainer mol = sp.parseSmiles(value);
                        //for some reason, smilesparser sets valencies, which we don't want in jcp
                        for(int k=0;k<mol.getAtomCount();k++){
                            mol.getAtom(k).setValency(null);
                        }
                        funcgroupsmap.put(key, mol);
View Full Code Here

Examples of org.openscience.cdk.smiles.SmilesParser.parseSmiles()

            }
            if(!sb.toString().equals("")){
                StringTokenizer st=new StringTokenizer(sb.toString());
                String key=(String)st.nextElement();
                String value=(String)st.nextElement();
                IAtomContainer mol = sp.parseSmiles(value);
                //for some reason, smilesparser sets valencies, which we don't want in jcp
                for(int k=0;k<mol.getAtomCount();k++){
                    mol.getAtom(k).setValency(null);
                }
                funcgroupsmap.put(key, mol);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.