Navigation Menu

Skip to content

Commit

Permalink
Minor fix to abbreviations when the 'leaving' bond is to a '*' atom.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmay committed Aug 3, 2017
1 parent 5851070 commit dc73466
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Expand Up @@ -505,6 +505,8 @@ else if (attachBond.getEnd().equals(atom))
} else if (nbr.getAtomicNumber() > 0){
nbrSymbols.add(newSymbol(nbr.getAtomicNumber(), nbr.getImplicitHydrogenCount(), false));
xatoms.add(nbr);
} else {
newbonds.add(bond);
}
} else {
newbonds.add(bond);
Expand Down
Expand Up @@ -272,6 +272,17 @@ public void dontOverwriteExistingSgroups() throws Exception {
assertThat(sgroups.get(0).getSubscript(), is("HOOH"));
}

@Test public void OMeFragment() throws Exception {
Abbreviations factory = new Abbreviations();
IAtomContainer mol = smi("*OC");
List<Sgroup> sgroups = factory.generate(mol);
assertThat(sgroups.size(), is(1));
Sgroup sgroup = sgroups.get(0);
assertThat(sgroup.getAtoms().size(), is(2));
assertThat(sgroup.getBonds().size(), is(1));
assertThat(sgroup.getSubscript(), is("OMe"));
}

@Test
public void loadFromFile() throws Exception {
Abbreviations factory = new Abbreviations();
Expand Down

0 comments on commit dc73466

Please sign in to comment.