热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.openscience.cdk.interfaces.IRing.contains()方法的使用及代码示例

本文整理了Java中org.openscience.cdk.interfaces.IRing.contains()方法的一些代码示例,展示了IRing.co

本文整理了Java中org.openscience.cdk.interfaces.IRing.contains()方法的一些代码示例,展示了IRing.contains()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IRing.contains()方法的具体详情如下:
包路径:org.openscience.cdk.interfaces.IRing
类名称:IRing
方法名:contains

IRing.contains介绍

暂无

代码示例

代码示例来源:origin: cdk/cdk

/**
* Checks if atom1 and atom2 share membership in the same ring or ring system.
* Membership in the same ring is checked if the RingSet contains the SSSR of a molecule; membership in
* the same ring or same ring system is checked if the RingSet contains all rings of a molecule.


*
*

Important: This method only returns meaningful results if atom1 and
* atom2 are members of the same molecule for which the RingSet was calculated!
*
* @param ringSet The collection of rings
* @param atom1 The first atom
* @param atom2 The second atom
* @return boolean true if atom1 and atom2 share membership of at least one ring or ring system, false otherwise
*/
public static boolean isSameRing(IRingSet ringSet, IAtom atom1, IAtom atom2) {
for (IAtomContainer atomContainer : ringSet.atomContainers()) {
IRing ring = (IRing) atomContainer;
if (ring.contains(atom1) && ring.contains(atom2)) return true;
}
return false;
}

代码示例来源:origin: cdk/cdk

public static boolean inSameAromaticRing(IAtomContainer m, IAtom atom1, IAtom atom2, IRingSet rs) {
if (rs == null) return false;
for (int i = 0; i <= rs.getAtomContainerCount() - 1; i++) {
IRing r = (IRing) rs.getAtomContainer(i);
if (r.contains(atom1) && r.contains(atom2)) {
if (isAromaticRing(r)) return (true);
}
}
return false;
}

代码示例来源:origin: org.openscience.cdk/cdk-legacy

private boolean inRingSet(IAtom atom, IRingSet ringSet) {
for (int i = 0; i IRing ring = (IRing) ringSet.getAtomContainer(i);
if (ring.contains(atom)) return true;
}
return false;
}

代码示例来源:origin: cdk/cdk

/**
* Partition the bonding partners of a given atom into ring atoms and non-ring atoms
*
* @param atom The atom whose bonding partners are to be partitioned
* @param ring The ring against which the bonding partners are checked
* @param ringAtoms An AtomContainer to store the ring bonding partners
* @param nonRingAtoms An AtomContainer to store the non-ring bonding partners
*/
public void partitionNonRingPartners(IAtom atom, IRing ring, IAtomContainer ringAtoms, IAtomContainer nonRingAtoms) {
List atoms = molecule.getConnectedAtomsList(atom);
for (int i = 0; i IAtom curAtom = (IAtom) atoms.get(i);
if (!ring.contains(curAtom)) {
nonRingAtoms.addAtom(curAtom);
} else {
ringAtoms.addAtom(curAtom);
}
}
}

代码示例来源:origin: org.openscience.cdk/cdk-sdg

/**
* Partition the bonding partners of a given atom into ring atoms and non-ring atoms
*
* @param atom The atom whose bonding partners are to be partitioned
* @param ring The ring against which the bonding partners are checked
* @param ringAtoms An AtomContainer to store the ring bonding partners
* @param nonRingAtoms An AtomContainer to store the non-ring bonding partners
*/
public void partitionNonRingPartners(IAtom atom, IRing ring, IAtomContainer ringAtoms, IAtomContainer nonRingAtoms) {
List atoms = molecule.getConnectedAtomsList(atom);
for (int i = 0; i IAtom curAtom = (IAtom) atoms.get(i);
if (!ring.contains(curAtom)) {
nonRingAtoms.addAtom(curAtom);
} else {
ringAtoms.addAtom(curAtom);
}
}
}

代码示例来源:origin: org.openscience.cdk/cdk-silent

/**
* Returns a vector of all rings that this atom is part of.
*
* @param atom The atom to be checked
* @return A vector of all rings that this bond is part of
*/
@Override
public IRingSet getRings(IAtom atom) {
IRingSet rings = new RingSet();
IRing ring;
for (int i = 0; i ring = (Ring) getAtomContainer(i);
if (ring.contains(atom)) {
rings.addAtomContainer(ring);
}
}
return rings;
}

代码示例来源:origin: cdk/cdk

/**
* Returns a vector of all rings that this atom is part of.
*
* @param atom The atom to be checked
* @return A vector of all rings that this bond is part of
*/
@Override
public IRingSet getRings(IAtom atom) {
IRingSet rings = new RingSet();
IRing ring;
for (int i = 0; i ring = (Ring) getAtomContainer(i);
if (ring.contains(atom)) {
rings.addAtomContainer(ring);
}
}
return rings;
}

代码示例来源:origin: org.openscience.cdk/cdk-data

/**
* Returns a vector of all rings that this atom is part of.
*
* @param atom The atom to be checked
* @return A vector of all rings that this bond is part of
*/
@Override
public IRingSet getRings(IAtom atom) {
IRingSet rings = new RingSet();
IRing ring;
for (int i = 0; i ring = (Ring) getAtomContainer(i);
if (ring.contains(atom)) {
rings.addAtomContainer(ring);
}
}
return rings;
}

代码示例来源:origin: cdk/cdk

/**
* Returns a vector of all rings that this atom is part of.
*
* @param atom The atom to be checked
* @return A vector of all rings that this bond is part of
*/
@Override
public IRingSet getRings(IAtom atom) {
IRingSet rings = new RingSet();
IRing ring;
for (int i = 0; i ring = (Ring) getAtomContainer(i);
if (ring.contains(atom)) {
rings.addAtomContainer(ring);
}
}
return rings;
}

代码示例来源:origin: org.openscience.cdk/cdk-legacy

/**
* Recovers a RingSet corresponding to a AtomContainer that has been
* stored by storeRingSystem().
*
* @param mol The IAtomContainer for which to recover the IRingSet.
*/
private IRingSet recoverRingSystem(IAtomContainer mol) {
IRingSet ringSet = mol.getBuilder().newInstance(IRingSet.class);
for (Integer[] bondNumbers : listOfRings) {
IRing ring = mol.getBuilder().newInstance(IRing.class, bondNumbers.length);
for (int bondNumber : bondNumbers) {
IBond bOnd= mol.getBond(bondNumber);
ring.addBond(bond);
if (!ring.contains(bond.getBegin())) ring.addAtom(bond.getBegin());
if (!ring.contains(bond.getEnd())) ring.addAtom(bond.getEnd());
}
ringSet.addAtomContainer(ring);
}
return ringSet;
}

代码示例来源:origin: cdk/cdk

/**
* Returns all the rings in the RingSet that share
* one or more atoms with a given ring.
*
* @param ring A ring with which all return rings must share one or more atoms
* @return All the rings that share one or more atoms with a given ring.
*/
@Override
public IRingSet getConnectedRings(IRing ring) {
IRingSet cOnnectedRings= ring.getBuilder().newInstance(IRingSet.class);
IRing tempRing;
IAtom atom;
for (int i = 0; i atom = ring.getAtom(i);
for (int j = 0; j tempRing = (IRing) getAtomContainer(j);
if (tempRing != ring && !connectedRings.contains(tempRing) && tempRing.contains(atom)) {
connectedRings.addAtomContainer(tempRing);
}
}
}
return connectedRings;
}

代码示例来源:origin: cdk/cdk

/**
* Returns all the rings in the RingSet that share
* one or more atoms with a given ring.
*
* @param ring A ring with which all return rings must share one or more atoms
* @return All the rings that share one or more atoms with a given ring.
*/
@Override
public IRingSet getConnectedRings(IRing ring) {
IRingSet cOnnectedRings= ring.getBuilder().newInstance(IRingSet.class);
IRing tempRing;
IAtom atom;
for (int i = 0; i atom = ring.getAtom(i);
for (int j = 0; j tempRing = (IRing) getAtomContainer(j);
if (tempRing != ring && !connectedRings.contains(tempRing) && tempRing.contains(atom)) {
connectedRings.addAtomContainer(tempRing);
}
}
}
return connectedRings;
}

代码示例来源:origin: org.openscience.cdk/cdk-data

/**
* Returns all the rings in the RingSet that share
* one or more atoms with a given ring.
*
* @param ring A ring with which all return rings must share one or more atoms
* @return All the rings that share one or more atoms with a given ring.
*/
@Override
public IRingSet getConnectedRings(IRing ring) {
IRingSet cOnnectedRings= ring.getBuilder().newInstance(IRingSet.class);
IRing tempRing;
IAtom atom;
for (int i = 0; i atom = ring.getAtom(i);
for (int j = 0; j tempRing = (IRing) getAtomContainer(j);
if (tempRing != ring && !connectedRings.contains(tempRing) && tempRing.contains(atom)) {
connectedRings.addAtomContainer(tempRing);
}
}
}
return connectedRings;
}

代码示例来源:origin: org.openscience.cdk/cdk-silent

/**
* Returns all the rings in the RingSet that share
* one or more atoms with a given ring.
*
* @param ring A ring with which all return rings must share one or more atoms
* @return All the rings that share one or more atoms with a given ring.
*/
@Override
public IRingSet getConnectedRings(IRing ring) {
IRingSet cOnnectedRings= ring.getBuilder().newInstance(IRingSet.class);
IRing tempRing;
IAtom atom;
for (int i = 0; i atom = ring.getAtom(i);
for (int j = 0; j tempRing = (IRing) getAtomContainer(j);
if (tempRing != ring && !connectedRings.contains(tempRing) && tempRing.contains(atom)) {
connectedRings.addAtomContainer(tempRing);
}
}
}
return connectedRings;
}

代码示例来源:origin: org.openscience.cdk/cdk-legacy

boolean haveatom = r.contains(m.getAtom(i));

代码示例来源:origin: uk.ac.ebi.smsd/smsd-core

boolean haveatom = ring.contains(mol.getAtom(i));

代码示例来源:origin: org.openscience.cdk/cdk-legacy

boolean haveatom = ring.contains(mol.getAtom(i));

代码示例来源:origin: org.openscience.cdk/cdk-legacy

boolean haveatom = ring.contains(mol.getAtom(i));

代码示例来源:origin: org.openscience.cdk/cdk-legacy

continue jloop;
boolean haveatom = ring.contains(mol.getAtom(i));

代码示例来源:origin: asad/ReactionDecoder

boolean haveatom = ring.contains(mol.getAtom(i));

推荐阅读
author-avatar
li永不言败ly_608
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有