本文整理汇总了Java中chemaxon.struc.MolBond.getType方法的典型用法代码示例。如果您正苦于以下问题:Java MolBond.getType方法的具体用法?Java MolBond.getType怎么用?Java MolBond.getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chemaxon.struc.MolBond
的用法示例。
在下文中一共展示了MolBond.getType方法的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: 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);
}
}
示例5: 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;
}
示例6: 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;
}
示例7: 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);
}
}
}
}
示例8: isQueryMol
import chemaxon.struc.MolBond; //导入方法依赖的package包/类
public static boolean isQueryMol (Molecule mol) {
mol.ungroupSgroups();
for (MolAtom atom : mol.getAtomArray()) {
switch (atom.getAtno()) {
case MolAtom.LIST:
case MolAtom.NOTLIST:
case MolAtom.ANY:
case MolAtom.RGROUP:
return true;
}
}
for (MolBond bond : mol.getBondArray()) {
switch (bond.getType()) {
case 1: case 2: case 3: case MolBond.AROMATIC:
break;
default:
return true;
}
}
return false;
}
示例9: isAlphaAminoAcidCarbonylCarbonAtom
import chemaxon.struc.MolBond; //导入方法依赖的package包/类
private boolean isAlphaAminoAcidCarbonylCarbonAtom(MolAtom atom) {
if (atom.getAtno() == 6) {
int bondCount = atom.getBondCount();
boolean foundOxygen = false;
boolean foundAlphaNitrogen = false;
for (int i = 0; i < bondCount; i++) {
MolBond bond = atom.getBond(i);
MolAtom otherAtom = bond.getOtherAtom(atom);
if (bond.getType() == 2 && otherAtom.getAtno() == 8) {
foundOxygen = true;
} else 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() == 7) {
foundAlphaNitrogen = true;
break;
}
}
}
}
if (foundOxygen && foundAlphaNitrogen) {
return true;
}
}
return false;
}
示例10: isDisulfideBond
import chemaxon.struc.MolBond; //导入方法依赖的package包/类
private boolean isDisulfideBond(MolBond bond) {
MolAtom atom1 = bond.getAtom1();
MolAtom atom2 = bond.getAtom2();
if (bond.getType() == 1) {
if (isDisulfideSulfurAtom(atom1) && isDisulfideSulfurAtom(atom2)) {
return true;
}
}
return false;
}
示例11: isKekulized
import chemaxon.struc.MolBond; //导入方法依赖的package包/类
protected static boolean isKekulized (Molecule m) {
for (MolBond b : m.getBondArray()) {
if (b.getType() == MolBond.AROMATIC) {
return false;
}
}
return true;
}
示例12: adjustEZStereo
import chemaxon.struc.MolBond; //导入方法依赖的package包/类
public static void adjustEZStereo (Molecule mol) {
for (MolBond b : mol.getBondArray()) {
if (b.getType() == 2) {
MolAtom a1 = b.getCTAtom1();
MolAtom a4 = b.getCTAtom4();
if (a1 != null && a4 != null
&& (a1.getX() != 0. || a1.getY() != 0.)
&& (a4.getX() != 0. || a4.getY() != 0.)) {
b.setStereo2Flags(a1, a4, b.calcStereo2(a1, a4));
}
}
}
}
示例13: getLabel
import chemaxon.struc.MolBond; //导入方法依赖的package包/类
public String getLabel (MolBond b) {
int type = b.getType();
switch (type) {
case 1: return "";
case 2: return "=";
case 3: return "#";
case MolBond.AROMATIC: return ":";
default: return "?";
}
}
示例14: transform
import chemaxon.struc.MolBond; //导入方法依赖的package包/类
void transform (Molecule mol, int[] hit) {
if (debug) {
System.out.println("Hit: "+smirks);
for(int j=0; j < hit.length; j++) {
System.out.print(" " + (hit[j]+1)+":"
+source.getAtom(j).getAtomMap());
}
System.out.println();
}
if (target.getAtomCount() == 0) {
// delete this subgraph
for (int j = 0; j < hit.length; ++j) {
mol.removeNode(hit[j]);
}
}
else {
MolAtom[] M = new MolAtom[mol.getAtomCount()];
// update atom
for (int j = 0; j < hit.length; ++j) {
MolAtom src = target.getAtom(map[j]);
MolAtom dst = mol.getAtom(hit[j]);
//System.out.println("updating atom " + (hit[j]+1));
copy (dst, src);
M[hit[j]] = src;
}
// now update the bond
for (MolBond b1 : mol.getBondArray()) {
MolAtom a1 = b1.getAtom1();
MolAtom a2 = b1.getAtom2();
int i1 = mol.indexOf(a1);
int i2 = mol.indexOf(a2);
if (M[i1] != null && M[i2] != null) {
for (int j = 0; j < M[i1].getBondCount(); ++j) {
MolBond b2 = M[i1].getBond(j);
if (b2.getOtherAtom(M[i1]) == M[i2]) {
int type = b2.getType();
switch (type) {
case MolBond.SINGLE_OR_AROMATIC:
b1.setType(1);
break;
case MolBond.DOUBLE_OR_AROMATIC:
b1.setType(2);
break;
case 1: case 2: case 3:
b1.setType(type);
break;
}
if (debug) {
System.out.println
("updating bond " + (i1+1)
+ "-"+(i2+1) + " to "
+ b1.getType());
}
}
}
}
}
M = null;
}
}
示例15: postprocessing
import chemaxon.struc.MolBond; //导入方法依赖的package包/类
void postprocessing (Molecule mol, boolean chargeBalance) {
if (chargeBalance) chargeBalance (mol);
if (mol.getAtomCount() > 0) {
/*
* this is needed because of tests/standardizer_case10.smi
*/
try {
String smiles = mol.toFormat("cxsmiles:u");
if (DEBUG) {
logger.log(Level.INFO, "Before final molecule cleaning: "
+smiles);
}
Molecule newmol = MolImporter.importMol(smiles);
newmol.dearomatize();
boolean hasArom = false;
for (MolBond b : newmol.getBondArray()) {
if (b.getType() == MolBond.AROMATIC) {
hasArom = true;
break;
}
}
if (hasArom) {
logger.log(Level.WARNING, mol.getName()
+": can't kekulize aromatized form: "+smiles);
// leave mol as-is
}
else {
if (DEBUG) {
logger.info("Final molecule clean-up\n"
+newmol.toFormat("mol"));
}
newmol.clonecopy(mol);
}
}
catch (Exception ex) {
logger.log(Level.SEVERE,
"Can't cleanup molecule properly", ex);
}
}
}