private boolean determineDonor(int aidx) { // must have a hydrogen atom, either implicit or explicit if (hcount[aidx] == 0) return false; IAtom atom = mol.getAtom(aidx); final String el = atom.getSymbol(); if (el.equals("N") || el.equals("O")) { // tetrazoles do not donate if (tetrazole[aidx]) return false; // see if any of the neighbours is an oxide of some sort; this is grounds for disqualification, with the exception // of amides, which are consider nonacidic for (int n = 0; n < atomAdj[aidx].length; n++) if (isOxide[atomAdj[aidx][n]]) { if (!mol.getAtom(atomAdj[aidx][n]).getSymbol().equals("C") || !el.equals("N")) return false; } return true; } else if (el.equals("S")) { // any kind of adjacent double bond disqualifies -SH for (int n = 0; n < atomAdj[aidx].length; n++) if (hasDouble[atomAdj[aidx][n]]) return false; return true; } else if (el.equals("C")) { // terminal alkynes qualify for (int n = 0; n < bondAdj[aidx].length; n++) if (bondOrderBioType(bondAdj[aidx][n]) == 3) return true; return false; } return false; }
private boolean determineNegative(int aidx) { IAtom atom = mol.getAtom(aidx); // consider formal ionic charge first final int chg = atom.getFormalCharge(); if (chg > 0) return false; if (chg < 0) { for (int n = 0; n < atomAdj[aidx].length; n++) if (mol.getAtom(atomAdj[aidx][n]).getFormalCharge() > 0) return false; return true; } final String el = atom.getSymbol(); // tetrazole nitrogens get negative charges if (tetrazole[aidx] && el.equals("N")) return true; // centres with an oxide and an -OH group qualify as negative if (isOxide[aidx] && (el.equals("C") || el.equals("S") || el.equals("P"))) { for (int n = 0; n < atomAdj[aidx].length; n++) if (bondOrderBioType(bondAdj[aidx][n]) == 1) { final int a = atomAdj[aidx][n]; if (mol.getAtom(a).getSymbol().equals("O") && hcount[a] > 0) return true; } } return false; }
int other = -1; for (int n = 0; n < atomAdj[aidx].length; n++) if (bondOrderBioType(bondAdj[aidx][n]) == 2) { other = atomAdj[aidx][n]; break; if (bondOrderBioType(bondAdj[aidx][n]) == 2) imine = true; else if (hcount[a] == 1) amine = true;