Skip to content

Commit

Permalink
improved the atom smarts
Browse files Browse the repository at this point in the history
  • Loading branch information
ntk73 authored and johnmay committed Oct 6, 2016
1 parent d6a0fc5 commit d354570
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -545,18 +545,24 @@ private String getAtomSmarts(IAtomContainer mol, int atNum)
Integer chrg = at.getFormalCharge();
String atStr = at.getSymbol();


String chStr = "";
if (chrg != null)
if (chrg != 0)
{
atStr = "[" + atStr + getChargeSmartsStr(chrg) + "]";
return atStr;
chStr = getChargeSmartsStr(chrg);
}

if (atStr.equals("C")||atStr.equals("N")||atStr.equals("O")||atStr.equals("S")||atStr.equals("P")
/*
if (!FlagBrackets)
{
if (atStr.equals("C")||atStr.equals("N")||atStr.equals("O")||atStr.equals("S")||atStr.equals("P")
||atStr.equals("B")||atStr.equals("Cl")||atStr.equals("Br")||atStr.equals("I")||atStr.equals("F"))
return atStr;
FlagBrackets = true;
}
*/


return atStr = "[" + atStr + "]";
return atStr = "[" + atStr + chStr + "]";
}

private String getChargeSmartsStr(int chrg)
Expand Down

0 comments on commit d354570

Please sign in to comment.