Skip to content

Commit

Permalink
Change functionality - don't write colon (:) for peripheral aromatic …
Browse files Browse the repository at this point in the history
…bonds, it is redundant.
  • Loading branch information
johnmay committed Oct 6, 2016
1 parent a43a478 commit adff265
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ public void testMol7() throws Exception {
String molSmiles = "c1ccccc1";
String expectedFPSmarts[][] = {

{ "c(:a):a" },
{ "c(:a)cc:a", "c(c:a)c:a", "c(cc:a):a" },
{ "c(:a)cccc:a", "c(c:a)ccc:a", "c(cc:a)cc:a", "c(ccc:a)c:a",
"c(cccc:a):a" },
{ "c(a)a" },
{ "c(a)cca", "c(ca)ca", "c(cca)a" },
{ "c(a)cccca", "c(ca)ccca", "c(cca)cca", "c(ccca)ca",
"c(cccca)a" },
{ "c1ccccc1", "c(c1)cccc1", "c(cc1)ccc1", "c(ccc1)cc1",
"c(cccc1)c1" } };
checkFPSmartsForMolecule(molSmiles, expectedFPSmarts);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ private void encodeExpr(int idx, int bprev, StringBuilder sb) {
if (avisit[nbr] == 0) {
// peripheral bond
if (remain > 0) sb.append('(');
sb.append(mol.getBond(bidx).isAromatic() ? ':' : bexpr[bidx]);
sb.append(bexpr[bidx]);
sb.append(mol.getAtom(nbr).isAromatic() ? 'a' : '*');
if (remain > 0) sb.append(')');
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void indoleWithPeripheral() throws Exception {
String smarts = generate("[nH]1ccc2c1cccc2",
true,
makeSeq(0,4));
assertThat(smarts, is("n(ccc(:a):a):a"));
assertThat(smarts, is("n(ccc(a)a)a"));
}

@Test
Expand Down

0 comments on commit adff265

Please sign in to comment.