当前位置: 首页>>代码示例>>Java>>正文


Java IAtomContainer.getBond方法代码示例

本文整理汇总了Java中org.openscience.cdk.interfaces.IAtomContainer.getBond方法的典型用法代码示例。如果您正苦于以下问题:Java IAtomContainer.getBond方法的具体用法?Java IAtomContainer.getBond怎么用?Java IAtomContainer.getBond使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.openscience.cdk.interfaces.IAtomContainer的用法示例。


在下文中一共展示了IAtomContainer.getBond方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: parseBond

import org.openscience.cdk.interfaces.IAtomContainer; //导入方法依赖的package包/类
/**
 *  Append the symbol for the bond order between <code>a1</code> and <code>a2</code>
 *  to the <code>line</code>.
 *
 *@param  line           the StringBuffer that the bond symbol is appended to.
 *@param  a1             Atom participating in the bond.
 *@param  a2             Atom participating in the bond.
 *@param  atomContainer  the AtomContainer that the SMILES string is generated
 *      for.
  	 *@param useAromaticity				true=aromaticity or sp2 will trigger lower case letters, wrong=only sp2
 */
private void parseBond(StringBuffer line, IAtom a1, IAtom a2, IAtomContainer atomContainer, boolean useAromaticity)
{
	//logger.debug("in parseBond()");
	if (useAromaticity && a1.getFlag(CDKConstants.ISAROMATIC) && a2.getFlag(CDKConstants.ISAROMATIC))
	{
		return;
	}
	if (atomContainer.getBond(a1, a2) == null)
	{
		return;
	}
	IBond.Order type = atomContainer.getBond(a1, a2).getOrder();
	if (type == IBond.Order.SINGLE) {
	} else if (type == IBond.Order.DOUBLE) {
		line.append("=");
	} else if (type == IBond.Order.TRIPLE) {
		line.append("#");
	} else {
		// //logger.debug("Unknown bond type");
	}
}
 
开发者ID:yoann-dufresne,项目名称:Smiles2Monomers,代码行数:33,代码来源:SmilesGenerator.java

示例2: makeGraph

import org.openscience.cdk.interfaces.IAtomContainer; //导入方法依赖的package包/类
private void makeGraph(IAtomContainer base){
	graph = new SparseUndirectedGraph();
	for(int i=0; i<base.getAtomCount(); i++){
		graph.add(i);
		atomsToNodes.put(base.getAtom(i), i);
		nodesToAtoms.put(i, base.getAtom(i));
		for(int j=0; j<i; j++){
			IBond bond = base.getBond(base.getAtom(i), base.getAtom(j));
			if(  bond != null){
				Edge newEdge = new SimpleEdge(i,j);
				bondsToEdges.put(bond, newEdge);
				edgesToBonds.put(newEdge, bond);
				graph.add( newEdge);
			}
		}
	}
}
 
开发者ID:ndaniels,项目名称:Ammolite,代码行数:18,代码来源:MolStruct.java

示例3: isCOOHPOOHSOOHGroup

import org.openscience.cdk.interfaces.IAtomContainer; //导入方法依赖的package包/类
private boolean isCOOHPOOHSOOHGroup(IAtom a, IAtomContainer mol) {
	int falseNeighbor = 0;
	boolean doubleBondSeen = false;
	boolean singleBondSeen = false;
	boolean hydrogenSeen = false;

	for (final IAtom n : mol.getConnectedAtomsList(a)) {
		if (!n.getAtomicNumber().equals(8)) {
			if (falseNeighbor == 1) {
				return false;
			} else {
				falseNeighbor++;
			}
		} else {
			// Oxygen neighbor check bond type
			final IBond b = mol.getBond(a, n);
			if (b.getOrder().equals(IBond.Order.SINGLE)) {
				if (!singleBondSeen) {
					singleBondSeen = true;
					if (n.getImplicitHydrogenCount() > 0)
						hydrogenSeen = true;
				} else {
					return false;
				}
			} else if (b.getOrder().equals(IBond.Order.DOUBLE)) {
				if (!doubleBondSeen) {
					doubleBondSeen = true;
				} else {
					return false;
				}
			}
		}
	}
	if (doubleBondSeen && singleBondSeen && hydrogenSeen) {
		return true;
	} else {
		return false;
	}
}
 
开发者ID:fortiema,项目名称:jCompoundMapper,代码行数:40,代码来源:PharmacophorePointAssigner.java

示例4: getBondRefs

import org.openscience.cdk.interfaces.IAtomContainer; //导入方法依赖的package包/类
public static BondRef[] getBondRefs(IAtomContainer mol) {

        final int numAtoms = mol.getAtomCount();
        final int numBonds = mol.getBondCount();
        BondRef[] bonds    = new BondRef[numBonds];

        final Map<IAtom, AtomRef> atomCache = new IdentityHashMap<>(mol.getAtomCount());

        for (int i = 0; i < numAtoms; i++) {
            final IAtom atom = mol.getAtom(i);
            final AtomRef atomrf = new AtomRef(i,
                                               atom,
                                               new ArrayList<BondRef>());
            atomCache.put(atomrf.atom, atomrf);
        }
        for (int i = 0; i < numBonds; i++) {
            final IBond   bond    = mol.getBond(i);
            AtomRef       beg     = atomCache.get(bond.getAtom(0));
            AtomRef       end     = atomCache.get(bond.getAtom(1));
            final BondRef bondref = new BondRef(bond, i, beg, end);
            beg.bonds.add(bondref);
            end.bonds.add(bondref);
            bonds[i] = bondref;
        }

        return bonds;
    }
 
开发者ID:johnmay,项目名称:efficient-bits,代码行数:28,代码来源:BondRef.java

示例5: getAtomRefs

import org.openscience.cdk.interfaces.IAtomContainer; //导入方法依赖的package包/类
public static AtomRef[] getAtomRefs(IAtomContainer mol) {

        final int numAtoms = mol.getAtomCount();
        final int numBonds = mol.getBondCount();
        AtomRef[] atoms    = new AtomRef[numAtoms];

        final Map<IAtom, AtomRef> atomCache = new IdentityHashMap<>(mol.getAtomCount());

        for (int i = 0; i < numAtoms; i++) {
            final IAtom atom = mol.getAtom(i);
            final AtomRef atomrf = new AtomRef(i,
                                               atom,
                                               new ArrayList<BondRef>());
            atomCache.put(atomrf.atom, atomrf);
            atoms[i] = atomrf;
        }
        for (int i = 0; i < numBonds; i++) {
            final IBond   bond    = mol.getBond(i);
            AtomRef       beg     = atomCache.get(bond.getAtom(0));
            AtomRef       end     = atomCache.get(bond.getAtom(1));
            final BondRef bondref = new BondRef(bond, i, beg, end);
            beg.bonds.add(bondref);
            end.bonds.add(bondref);
        }

        return atoms;
    }
 
开发者ID:johnmay,项目名称:efficient-bits,代码行数:28,代码来源:AtomRef.java


注:本文中的org.openscience.cdk.interfaces.IAtomContainer.getBond方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。