Package org.openscience.cdk

Examples of org.openscience.cdk.Molecule


    if(mol == null && request.getParameter("element") != null && (request.getParameter("element").length() > 0)) {
      String elemSymbol = request.getParameter("element");
      Atom a = new Atom(elemSymbol);
      a.setPoint2d(new Point2d(0.0, 0.0));
      mol = new Molecule();
      mol.addAtom(a);
      makeStructure = false;
    }
   
    if (mol == null){
View Full Code Here


      } else if("text/plain".equals(type) && "Name did not parse!".equals(new BufferedReader(new InputStreamReader(conn.getInputStream())).readLine())) {
        // Failure from SimpleOPSINServlet
        return null;
      } else if("chemical/x-mdl-molfile".equals(type)) {
        MDLReader mdlr = new MDLReader(conn.getInputStream());
        IMolecule outputMol = (IMolecule)mdlr.read(new Molecule());
        StructureConverter.configureMolecule(outputMol);
        String smiles = generator.createSMILES(outputMol);
        String inchi = ConverterToInChI.getInChI(outputMol);
        Results results = new Results(smiles, inchi, null);
        return results; 
View Full Code Here

      Query q = new TermQuery(new Term("InChI", inchi));
      if(indexSearcher.search(q).length() > 0) return;
    }*/
    IMolecule mol;
    try {
      mol = new Molecule();
      mol = ConverterToInChI.getMolFromInChI(inchi);
      StructureConverter.configureMolecule(mol);
      try {
        HueckelAromaticityDetector.detectAromaticity(mol);       
      } catch (Exception e) {
View Full Code Here

    AllRingsFinder ar = new AllRingsFinder();
    IRingSet ringSet = ar.findAllRings(mol);
    List l = RingPartitioner.partitionRings(ringSet);
    for(Object o : l) {
      IAtomContainer ac = RingPartitioner.convertToAtomContainer((IRingSet)o);
      IMolecule nMol = new Molecule(ac);
      System.out.println(new SmilesGenerator().createSMILES(nMol));
    }
  }
View Full Code Here

      } catch (Exception ee) {
       
      }
    }
    try {
      Molecule blank = new Molecule();
      Molecule2Png m2p = new Molecule2Png();
      m2p.fixedWidthAndHeight = true;
      m2p.height = 300;
      m2p.width = 300;
      m2p.renderMolecule(blank, new File(paperDir, "blank.png").toString());     
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

      }
    }
    if(!done) {
      mol = ConverterToInChI.getMolFromInChI(inchi);
      if(mol != null) {
        mol = new Molecule(mol);
        try {
          StructureConverter.configureMolecule(mol);
          new HydrogenAdder(new ValencyHybridChecker()).addExplicitHydrogensToSatisfyValency(mol);
          StructureConverter.addHydrogensForSilicon(mol);
        } catch (Exception e) {
View Full Code Here

  }
 
  private void prepareMolecule() throws Exception {
    ConverterToInChI.clearInChIFromCache(targetInChI);
    mol = ConverterToInChI.getMolFromInChI(targetInChI);
    mol = new Molecule(mol);
   
    new HydrogenAdder().addExplicitHydrogensToSatisfyValency(mol);
    StructureConverter.addHydrogensForSilicon(mol);

    //System.out.println(mol);
View Full Code Here

    private static final long serialVersionUID = -4683096180546540588L;
    private IMolecule itsMolecule;
    private TwoDimensionList<Double> itsDistanceMatrix;

    public DistanceMatrix() {
        this.setMolecule(new Molecule());
        this.setDistanceMatrix(new TwoDimensionList<Double>());
    }
View Full Code Here

TOP

Related Classes of org.openscience.cdk.Molecule

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.