Examples of Molecule


Examples of org.jrdf.graph.global.molecule.Molecule

        boolean skip = false;
        int i1 = 0, i2;
        while (i1 < length && length > 1) {
            i2 = i1 + 1;
            while (i2 < length) {
                Molecule m1 = moleculeArray.get(i1);
                Molecule m2 = moleculeArray.get(i2);
                Map<BlankNode, BlankNode> map = mapper.createMap(m1, m2);
                Molecule molecule = localMerger.merge(m1, m2, map);
                //map.clear();
                if (molecule != null) {
                    moleculeArray.remove(m1);
                    moleculeArray.remove(m2);
                    moleculeArray.add(molecule);
View Full Code Here

Examples of org.jrdf.graph.global.molecule.Molecule

    // TODO if a sub molecule is to be returned, the isTopLevel field isn't correctly set when creating the molecule.
    // TODO Maybe get the top-level molecule and return the subMolecule?
    private Molecule reconstructMolecule(Molecule parentMolecule, Long pid, Long mid) throws GraphException {
        Triple[] roots = iteratorAsTriples(readableIndex.findTriplesForMid(pid, mid));
        Map<BlankNode, Triple> rootTripleMap = getBNodeToRootMap(parentMolecule);
        Molecule molecule = new MoleculeImpl(moleculeComparator, roots);
        molecule = createSubMolecules(mid, molecule);
        if (null == parentMolecule) {
            return molecule;
        } else {
            Triple linkingTriple = findLinkingTriple(parentMolecule, roots, rootTripleMap, molecule);
View Full Code Here

Examples of org.jrdf.graph.global.molecule.Molecule

        ClosableIterator<Long> iterator = readableIndex.findMoleculeIDs(tripleAsLongs);
        try {
            while (iterator.hasNext()) {
                final Long mid = iterator.next();
                if (readableIndex.isSubmoleculeOfParentID(1L, mid)) {
                    Molecule m = handler.createMolecule(1L, mid);
                    if (m != null && moleculeComparator.compare(molecule, m) == 0) {
                        AddMoleculeToIndex amti = new AddMoleculeToIndex(writableIndex, localizer);
                        amti.handleTriple(rootTriple);
                        return molecule.add(rootTriple);
                    }
View Full Code Here

Examples of org.jrdf.graph.global.molecule.Molecule

        ClosableIterator<Long> iterator = readableIndex.findMoleculeIDs(tripleAsLongs);
        try {
            while (iterator.hasNext()) {
                Long aLong = iterator.next();
                if (readableIndex.isSubmoleculeOfParentID(1L, aLong)) {
                    Molecule m = handler.createMolecule(1L, aLong);
                    if (m != null && moleculeComparator.compare(molecule, m) == 0) {
                        return removeSubMolecules(molecule, rootTriple, tripleAsLongs, aLong);
                    }
                }
            }
View Full Code Here

Examples of org.jrdf.graph.global.molecule.Molecule

        try {
            ClosableIterator<Molecule> iterator = iterator();
            try {
                MoleculeHandler tmpHandler = new MoleculeToText(builder, localizer.getLocalizer());
                while (iterator.hasNext()) {
                    Molecule molecule = iterator.next();
                    traverser.traverse(molecule, tmpHandler);
                }
                return builder.toString();
            } finally {
                iterator.close();
View Full Code Here

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

Examples of org.openscience.cdk.Molecule

      } 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

Examples of org.openscience.cdk.Molecule

      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

Examples of org.openscience.cdk.Molecule

    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

Examples of org.openscience.cdk.Molecule

      } 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
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.