Package org.openscience.cdk.interfaces

Examples of org.openscience.cdk.interfaces.IMolecule


    return mol;
  }
 
  static IMolecule cmlToMolecule(InputStream is) throws Exception {
    IChemFile cf = (IChemFile) new CMLReader(is).read(new ChemFile());
    IMolecule mol = cf.getChemSequence(0).getChemModel(0).getMoleculeSet().getMolecule(0);
    configureMolecule(mol);
    return mol;   
  }
View Full Code Here


   */
  public static void enhanceCMLMolecule(Element cmlMolElem, String name) throws Exception {
    if(cmlMolElem.getLocalName().equals("cml")) {
      cmlMolElem = cmlMolElem.getFirstChildElement("molecule", "http://www.xml-cml.org/schema");
    }
    IMolecule mol = cmlToMolecule(cmlMolElem);
    StructureConverter.configureMolecule(mol);
    addNameAndInchiToCMLMolecule(cmlMolElem, name, ConverterToInChI.getInChI(mol));
    XOMTools.setNamespaceURIRecursively(cmlMolElem, "http://www.xml-cml.org/schema");
  }
View Full Code Here

      //System.out.println("Use IGF!");
      try {
        lock.lock();
        //getInstance().igf.
        IAtomContainer iac = igf.getInChIToStructure(InChI).getAtomContainer();
        IMolecule mol = new Molecule(iac);
        molCache.put(InChI, mol);

        return mol;
        //return getInstance().igf.getInChIGenerator(mol).getInchi();
      } catch (Exception e) {
View Full Code Here

      //proc.waitFor();
      /* This loop seems to work better under windows than proc.waitFor(), which hangs */
     
      //System.out.println(tmpMolFile.getAbsolutePath());
     
      IMolecule mol = (IMolecule)new MDLReader(new InputStreamReader(new FileInputStream(tmpMolFile), "UTF-8")).read(new Molecule());
     
      //System.out.println(FileTools.readTextFile(tmpMolFile));
     
      tmpMolFile.delete();
      tmpInChIAuxFile.delete();
View Full Code Here

    // TODO Auto-generated method stub
    doGet(request, response);
  }
  @Override
  protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    IMolecule mol = null;
    try {
      if(request.getParameter("smiles") != null) {
        mol = new SmilesParser(DefaultChemObjectBuilder.getInstance()).parseSmiles(request.getParameter("smiles"));
        //StructureConverter.configureMolecule(mol);
      } else if(request.getParameter("inchi") != null) {
View Full Code Here

  return cq;
}*/
 
  ChemQuery makeChemQueryFromSMILES(String smiles, String type, String parameters) throws Exception {
    if(!smiles.contains(" ")) {
      IMolecule mol = smilesParser.parseSmiles(smiles);
      try {
        HueckelAromaticityDetector.detectAromaticity(mol);       
      } catch (Exception e) {
        // Fail silently for now...
      }
View Full Code Here

        return theMoleculeSet;
    }

    private IMolecule __getChemicalShiftAndMpeoeAndCdeapBySDFormat(Nmr1dUnit thePeak, int theMoleculeIndex) {
        IMolecule theMolecule = new Molecule();
        int theAnnotatedAtomNumber = thePeak.getAnnotatedAtomNumber();

        theMolecule.setProperty(this.CHEMICAL_SHIFT_COLUMN_NAME_IN_RESULT_FILE, thePeak.getChemicalShift());
        theMolecule.setProperty(this.MPEOE_COLUMN_NAME_IN_RESULT_FILE, this.getMPEOEListByMolecules().get(theMoleculeIndex).get(theAnnotatedAtomNumber));
        theMolecule.setProperty(this.CDEAP_COLUMN_NAME_IN_RESULT_FILE, this.getCDEAPListByMolecules().get(theMoleculeIndex).get(theAnnotatedAtomNumber));

        return theMolecule;
    }
View Full Code Here

        return theMoleculeSet;
    }

    private IMolecule __getHoseCodeDescriptorBySDFormat(Nmr1dUnit thePeak, int theHoseCodeLevel, int theMoleculeIndex) {
        IMolecule theMolecule = new Molecule();
        int theAnnotatedAtomNumber = thePeak.getAnnotatedAtomNumber();

        if (this.getMPEOEListByMolecules().get(theMoleculeIndex).get(theAnnotatedAtomNumber) != this.NOT_CONTAIN_PROPERTY_VALUE
                && !this.getSFEList().get(theMoleculeIndex).equals(this.INCORRECT_VALUE)) {
            HoseCodeDescriptor theHoseCodeDescriptor = new HoseCodeDescriptor(this.getMoleculeSet().getMolecule(theMoleculeIndex), theHoseCodeLevel);

            theMolecule.setProperty(this.CHEMICAL_SHIFT_COLUMN_NAME_IN_RESULT_FILE, thePeak.getChemicalShift());
            theMolecule.setProperty(this.MPEOE_COLUMN_NAME_IN_RESULT_FILE, this.getMPEOEListByMolecules().get(theMoleculeIndex).get(theAnnotatedAtomNumber));
            theMolecule.setProperty(this.CDEAP_COLUMN_NAME_IN_RESULT_FILE, this.getCDEAPListByMolecules().get(theMoleculeIndex).get(theAnnotatedAtomNumber));
            theMolecule.setProperty(this.SFE_COULUMN_NAME_IN_RESULT_FILE, this.getSFEList().get(theMoleculeIndex));
            theMolecule.setProperties(this.__getHoseCodeDescriptorBySDFormat(this.getMoleculeSet().getMolecule(theMoleculeIndex), theAnnotatedAtomNumber, theHoseCodeLevel));
        }

        return theMolecule;
    }
View Full Code Here

        return theMolecule;
    }

    private Map<Object, Object> __getHoseCodeDescriptorBySDFormat(IMolecule theMolecule, int theAnnotatedAtomNumber, int theHoseCodeLevel) {
        HoseCodeDescriptor theHoseCodeDescriptor = new HoseCodeDescriptor(theMolecule, theHoseCodeLevel);
        IMolecule theDataMolecule = new Molecule();

        for (int pi = 0, pEnd = theHoseCodeDescriptor.getHoseCodeNameList().size(); pi < pEnd; pi++) {
            theDataMolecule.setProperty(theHoseCodeDescriptor.getHoseCodeNameList().get(pi), theHoseCodeDescriptor.getHoseCodeValue2dList().get(theAnnotatedAtomNumber).get(pi));
        }

        return theDataMolecule.getProperties();
    }
View Full Code Here

TOP

Related Classes of org.openscience.cdk.interfaces.IMolecule

Copyright © 2018 www.massapicom. 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.