Skip to content

Commit

Permalink
Got rid of more old methods
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Nov 14, 2015
1 parent f9b9d0e commit dc7ab81
Showing 1 changed file with 3 additions and 21 deletions.
@@ -1,4 +1,4 @@
/* Copyright (C) 2007-2008 Egon Willighagen <egonw@users.sf.net>
/* Copyright (C) 2007-2015 Egon Willighagen <egonw@users.sf.net>
* 2011 Nimish Gopal <nimishg@ebi.ac.uk>
* 2011 Syed Asad Rahman <asad@ebi.ac.uk>
* 2011 Gilleain Torrance <gilleain.torrance@gmail.com>
Expand Down Expand Up @@ -1018,7 +1018,7 @@ private boolean isAmide(IAtom atom, IAtomContainer atomContainer) {
List<IAtom> neighbors = atomContainer.getConnectedAtomsList(atom);
for (IAtom neighbor : neighbors) {
if (neighbor.getSymbol().equals("C")) {
if (countAttachedDoubleBonds(atomContainer, neighbor, "O") == 1) return true;
if (countAttachedDoubleBonds(atomContainer.getConnectedBondsList(neighbor), neighbor, "O") == 1) return true;
}
}
return false;
Expand All @@ -1028,7 +1028,7 @@ private boolean isThioAmide(IAtom atom, IAtomContainer atomContainer) {
List<IAtom> neighbors = atomContainer.getConnectedAtomsList(atom);
for (IAtom neighbor : neighbors) {
if (neighbor.getSymbol().equals("C")) {
if (countAttachedDoubleBonds(atomContainer, neighbor, "S") == 1) return true;
if (countAttachedDoubleBonds(atomContainer.getConnectedBondsList(neighbor), neighbor, "S") == 1) return true;
}
}
return false;
Expand Down Expand Up @@ -2359,10 +2359,6 @@ private int countAttachedDoubleBonds(List<IBond> connectedAtoms, IAtom atom, Str
return countAttachedBonds(connectedAtoms, atom, IBond.Order.DOUBLE, symbol);
}

private int countAttachedDoubleBonds(IAtomContainer container, IAtom atom, String symbol) {
return countAttachedBonds(container, atom, IBond.Order.DOUBLE, symbol);
}

private IAtomType perceiveCobalt(IAtomContainer atomContainer, IAtom atom) throws CDKException {
if (hasOneSingleElectron(atomContainer, atom)) {
// no idea how to deal with this yet
Expand Down Expand Up @@ -2431,20 +2427,6 @@ private boolean hasAromaticBond(List<IBond> connectedBonds) {
return false;
}

/**
* Count the number of doubly bonded atoms.
*
* @param container the molecule in which to look
* @param atom the atom being looked at
* @param order the desired bond order of the attached bonds
* @param symbol If not null, then it only counts the double bonded atoms which
* match the given symbol.
* @return the number of doubly bonded atoms
*/
private int countAttachedBonds(IAtomContainer container, IAtom atom, IBond.Order order, String symbol) {
return countAttachedBonds(container.getConnectedBondsList(atom), atom, order, symbol);
}

/**
* Count the number of doubly bonded atoms.
*
Expand Down

0 comments on commit dc7ab81

Please sign in to comment.