MmffAromaticTypeMapping { static void updateAromaticTypesInSixMemberRing(int[] cycle, String[] symbs) { for (final int v : cycle) { if (NCN_PLUS.equals(symbs[v]) || "N+=C".equals(symbs[v]) || "N=+C".equals(symbs[v])) symbs[v] = "NPD+"; else if ("N2OX".equals(symbs[v])) symbs[v] = "NPOX"; else if ("N=C".equals(symbs[v]) || "N=N".equals(symbs[v])) symbs[v] = "NPYD"; else if (symbs[v].startsWith("C")) symbs[v] = "CB"; } } MmffAromaticTypeMapping();   }
@Test public void updateN2OXtoNPOX() { int[] cycle = new int[]{2, 4, 3, 1, 0, 5, 2}; String[] symbs = new String[10]; Arrays.fill(symbs, ""); symbs[cycle[1]] = "N2OX"; MmffAromaticTypeMapping.updateAromaticTypesInSixMemberRing(cycle, symbs); assertThat(symbs[cycle[1]], is("NPOX")); }
@Test public void updateToNPDPlus() { int[] cycle = new int[]{2, 4, 3, 1, 0, 5, 2}; String[] symbs = new String[10]; Arrays.fill(symbs, ""); symbs[cycle[1]] = "NCN+"; symbs[cycle[2]] = "N+=C"; symbs[cycle[3]] = "N=+C"; MmffAromaticTypeMapping.updateAromaticTypesInSixMemberRing(cycle, symbs); assertThat(symbs[cycle[1]], is("NPD+")); assertThat(symbs[cycle[2]], is("NPD+")); assertThat(symbs[cycle[3]], is("NPD+")); }
@Test public void updateNStarToNPYD() { int[] cycle = new int[]{2, 4, 3, 1, 0, 5, 2}; String[] symbs = new String[10]; Arrays.fill(symbs, ""); symbs[cycle[1]] = "N=C"; symbs[cycle[2]] = "N=N"; MmffAromaticTypeMapping.updateAromaticTypesInSixMemberRing(cycle, symbs); assertThat(symbs[cycle[1]], is("NPYD")); assertThat(symbs[cycle[2]], is("NPYD")); }
@Test public void updateCStarToCB() { int[] cycle = new int[]{2, 4, 3, 1, 0, 5, 2}; String[] symbs = new String[10]; Arrays.fill(symbs, ""); symbs[cycle[1]] = "C=C"; symbs[cycle[2]] = "C=N"; MmffAromaticTypeMapping.updateAromaticTypesInSixMemberRing(cycle, symbs); assertThat(symbs[cycle[1]], is("CB")); assertThat(symbs[cycle[2]], is("CB")); }