本文整理汇总了Java中chemaxon.struc.MolBond类的典型用法代码示例。如果您正苦于以下问题:Java MolBond类的具体用法?Java MolBond怎么用?Java MolBond使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MolBond类属于chemaxon.struc包,在下文中一共展示了MolBond类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isAlphaAminoAcidNitrogenAtom
import chemaxon.struc.MolBond; //导入依赖的package包/类
private boolean isAlphaAminoAcidNitrogenAtom(MolAtom atom) {
if (atom.getAtno() == 7) {
int bondCount = atom.getBondCount();
for (int i = 0; i < bondCount; i++) {
MolBond bond = atom.getBond(i);
MolAtom otherAtom = bond.getOtherAtom(atom);
if (bond.getType() == 1 && otherAtom.getAtno() == 6) {
int carbonBondCount = otherAtom.getBondCount();
for (int j = 0; j < carbonBondCount; j++) {
MolBond carbonBond = otherAtom.getBond(j);
MolAtom neighborAtom = carbonBond.getOtherAtom(otherAtom);
if (carbonBond.getType() == 1 && neighborAtom.getAtno() == 6 && isCarbonylCarbonAtom(neighborAtom)) {
return true;
}
}
}
}
}
return false;
}
示例2: isAmideBond
import chemaxon.struc.MolBond; //导入依赖的package包/类
private boolean isAmideBond(MolBond bond) {
MolAtom atom1 = bond.getAtom1();
MolAtom atom2 = bond.getAtom2();
if (bond.getType() == 1) {
boolean found = false;
if (isCarbonylCarbonAtom(atom1) && isAminoNitrogenAtom(atom2)) {
found = true;
} else if (isCarbonylCarbonAtom(atom2) && isAminoNitrogenAtom(atom1)) {
found = true;
}
if (found && !isPreservedAmideBond(bond)) {
return true;
}
}
return false;
}
示例3: isCarbonylCarbonAtom
import chemaxon.struc.MolBond; //导入依赖的package包/类
private boolean isCarbonylCarbonAtom(MolAtom atom) {
if (atom.getAtno() == 6) {
int bondCount = atom.getBondCount();
int hcount = atom.getImplicitHcount();
if (bondCount + hcount == 3) {
for (int i = 0; i < bondCount; i++) {
MolBond bond = atom.getBond(i);
MolAtom otherAtom = bond.getOtherAtom(atom);
if (bond.getType() == 2 && otherAtom.getAtno() == 8) {
return true;
}
}
}
}
return false;
}
示例4: removeRgroup
import chemaxon.struc.MolBond; //导入依赖的package包/类
/**
* mol is changed after this step, make sure to clone it if need to preserve
* state It is possible that there are more than one R groups that have the
* same ID as rgroup
*
* @param mol
* @param rgroup
* @return MolAtom which is the single connection MolAtom to rgroup
* @throws org.helm.notation.StructureException
*/
public static MolAtom removeRgroup(Molecule mol, MolAtom rgroup)
throws StructureException {
MolAtom atom = null;
if (rgroup.getBondCount() == 1) {
MolBond bond = rgroup.getBond(0);
if (bond.getAtom1().equals(rgroup)) {
atom = bond.getAtom2();
} else {
atom = bond.getAtom1();
}
mol.removeNode(rgroup);
} else {
throw new StructureException("Only one bond is allowed from Rgroup");
}
return atom;
}
示例5: if
import chemaxon.struc.MolBond; //导入依赖的package包/类
protected void genParityPath
(LinkedList<MolBond> path, Set<MolAtom> visited,
int parity, MolAtom a, MolAtom end) {
if (a == end) {
MolPath newpath = new MolPath (path.toArray(new MolBond[0]), rank);
paths.add(newpath);
}
else if (path.size() <= maxdepth) {
visited.add(a);
for (int i = 0; i < a.getBondCount(); ++i) {
MolBond b = a.getBond(i);
MolAtom xa = b.getOtherAtom(a);
if (visited.contains(xa) || xa.getCharge() != 0) {
}
else if (parity + 1 == b.getType()) {
path.push(b);
genParityPath (path, visited, 1-parity, xa, end);
path.pop();
}
}
visited.remove(a);
}
}
示例6: getTopologyRank
import chemaxon.struc.MolBond; //导入依赖的package包/类
protected static int[] getTopologyRank (Molecule mol) {
Molecule m = mol.cloneMolecule();
for (MolAtom a : m.getAtomArray()) {
a.setAtno(6);
a.setRadical(0);
a.setCharge(0);
a.setFlags(0);
}
for (MolBond b : m.getBondArray()) {
b.setFlags(0);
b.setType(1);
}
int[] rank = new int[m.getAtomCount()];
m.getGrinv(rank);
return rank;
}
示例7: initializeVisitFlags
import chemaxon.struc.MolBond; //导入依赖的package包/类
protected void initializeVisitFlags () {
for (int i = 0; i < atoms.length; ++i) {
if ((types[i] & (TAU_ACC | TAU_DON)) != 0) {
avisit[i] = 0;
}
else {
avisit[i] = 1;
}
}
for (int i = 0; i < bonds.length; ++i) {
MolBond bond = bonds[i];
MolAtom src = bond.getAtom1();
MolAtom dst = bond.getAtom2();
if (((types[mol.indexOf(src)] & TAU_OTHER) == 0)
&& ((types[mol.indexOf(dst)] & TAU_OTHER) == 0)) {
bvisit[i] = 0;
}
else {
bvisit[i] = 1;
}
}
}
示例8: mustHaveSingle
import chemaxon.struc.MolBond; //导入依赖的package包/类
protected boolean mustHaveSingle (int ai) {
if (avisit[ai] != 0) {
if ((types[ai] & TAU_DON) != 0)
return true;
}
MolAtom atom = atoms[ai];
for (int i = 0; i < atom.getBondCount(); ++i) {
MolBond bond = atom.getBond(i);
if (bond.getType() == 2 && bvisit[mol.indexOf(bond)] != 0) {
return true;
}
}
return false;
}
示例9: mustHaveDouble
import chemaxon.struc.MolBond; //导入依赖的package包/类
protected boolean mustHaveDouble (int ai) {
if ((types[ai] & TAU_DON) == 0 && avisit[ai] != 0) {
int doub = 0, avail = 0;
MolAtom atom = atoms[ai];
for (int i = 0; i < atom.getBondCount(); ++i) {
MolBond bond = atom.getBond(i);
if (bvisit[mol.indexOf(bond)] != 0) {
if (bond.getType() == 2)
++doub;
}
else {
++avail;
}
}
return avail== 1 && doub == 0;
}
return false;
}
示例10: kekuleTautomer
import chemaxon.struc.MolBond; //导入依赖的package包/类
protected boolean kekuleTautomer (int depth) {
for (int i = 0; i < bonds.length; ++i) {
if (bvisit[i] == 0) {
MolBond bnd = bonds[i];
MolAtom src = bnd.getAtom1();
MolAtom dst = bnd.getAtom2();
bvisit[i] = depth;
setBondOrder (bnd, 2);
if (propagateTautomer (src, depth+1) != 0 ||
propagateTautomer (dst, depth+1) != 0) {
setBondOrder (bnd, 1);
resetVisitFlags (depth + 1);
if (propagateTautomer (src, depth + 1) != 0 ||
propagateTautomer (dst, depth + 1) != 0)
return false;
}
depth += 2;
}
}
return true;
}
示例11: topologyInvariant
import chemaxon.struc.MolBond; //导入依赖的package包/类
public static int[] topologyInvariant (Molecule mol) {
Molecule m = mol.cloneMolecule();
m.hydrogenize(false);
m.expandSgroups();
for (MolAtom a : m.getAtomArray()) {
a.setAtno(6);
a.setRadical(0);
a.setCharge(0);
a.setFlags(0);
}
for (MolBond b : m.getBondArray()) {
b.setFlags(0);
b.setType(1);
}
int[] map = new int[m.getAtomCount()];
m.getGrinv(map);
return map;
}
示例12: resetEZ
import chemaxon.struc.MolBond; //导入依赖的package包/类
public static void resetEZ (Molecule mol) {
MolBond[] bonds = mol.getBondArray();
for (int i = 0; i < bonds.length; ++i) {
MolBond b = bonds[i];
int type = b.getType();
if (type == 2) {
b.setFlags(0, MolBond.CTUMASK);
}
else if (type == 1) {
int flags = b.getFlags() & MolBond.STEREO1_MASK;
if (flags == (MolBond.UP | MolBond.DOWN)) {
// WAVY flag...
b.setFlags(0, MolBond.STEREO1_MASK);
}
}
}
}
示例13: dfs
import chemaxon.struc.MolBond; //导入依赖的package包/类
@Override
protected void dfs (PathVisitor visitor, Stack<MolBond> path,
BitSet visited, int start, int a, int end) {
if (a == end) {
visitor.visit(getMolecule (), path);
return;
}
visited.set(a);
MolAtom atom = atoms[a];
for (int b = 0; b < atom.getBondCount(); ++b) {
MolBond bond = atom.getBond(b);
int xa = mol.indexOf(bond.getOtherAtom(atom));
if ((cost[start][xa] + cost[xa][end] <= cost[start][end])
&& !visited.get(xa)) {
path.push(bond);
dfs (visitor, path, visited, start, xa, end);
path.pop();
}
}
visited.clear(a);
}
示例14: walkPaths
import chemaxon.struc.MolBond; //导入依赖的package包/类
public void walkPaths (PathVisitor visitor, int length,
int start, int end) {
if (visitor == null) {
throw new IllegalArgumentException ("Path visitor is null");
}
if (start < 0 || start >= atoms.length) {
throw new IllegalArgumentException
("Invalid starting atom specified");
}
if (end < 0 || end >= atoms.length) {
throw new IllegalArgumentException
("Invalid ending atom specified");
}
if (maxDepth > 0 && length > maxDepth) {
logger.warning("Truncating path to "+maxDepth);
length = maxDepth;
}
BitSet visited = new BitSet (atoms.length);
Stack<MolBond> path = new Stack<MolBond>();
dfs (visitor, path, visited, length, start, end);
}
示例15: handleSpecialMetals
import chemaxon.struc.MolBond; //导入依赖的package包/类
protected static void handleSpecialMetals (Molecule mol) {
MolBond bonds[] = mol.getBondArray();
List<MolBond> delete = new ArrayList<MolBond>();
for (int i = 0; i < bonds.length; ++i) {
MolAtom a1 = bonds[i].getAtom1();
MolAtom a2 = bonds[i].getAtom2();
// handle limited covalent NaO
if ((a1.getAtno() == 8) && a2.getAtno() == 11) {
a2.setCharge(a2.getCharge()+1);
a1.setCharge(a1.getCharge()-1);
delete.add(bonds[i]);
}
else if (a1.getAtno() == 11 && (a2.getAtno() == 8)) {
a1.setCharge(a1.getCharge()+1);
a2.setCharge(a2.getCharge()-1);
delete.add(bonds[i]);
}
}
for (MolBond b : delete)
mol.removeEdge(b);
mol.valenceCheck();
}