Skip to content

Commit

Permalink
Handle HCl, HF, HBr etc as though they were Cl-, F-, Br- etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmay committed Feb 1, 2019
1 parent b3ddbe5 commit e820858
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1743,7 +1743,8 @@ private void calcGroup101_to_104(int i) {
IAtom ai = atomContainer.getAtom(i);
String s = ai.getSymbol();

if (ai.getFormalCharge() == -1) {
if (ai.getFormalCharge() == -1 ||
(ai.getFormalCharge() == 0 && isBondedToHydrogenOnly(ai))) {
if (s.equals("F")) {
frags[101]++;
alogpfrag[i] = 101;
Expand All @@ -1762,6 +1763,11 @@ private void calcGroup101_to_104(int i) {

}

private boolean isBondedToHydrogenOnly(IAtom ai) {
return ai.getBondCount() == 1 &&
ai.bonds().iterator().next().getOther(ai).getAtomicNumber() == 1;
}

private void calcGroup106(int i) {
// S in SH
if (fragment[i].equals("SsSH")) {
Expand Down

0 comments on commit e820858

Please sign in to comment.