Skip to content

Commit

Permalink
add on patches
Browse files Browse the repository at this point in the history
Signed-off-by: Rajarshi Guha <rajarshi.guha@gmail.com>
  • Loading branch information
asad authored and rajarshi committed May 22, 2010
1 parent 5bd8d64 commit 4bdce61
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ protected List<CDKRMap> removeRedundantMappingsForSingleAtomCase(List<CDKRMap> o
* @param graph2 second molecule. May be an IQueryAtomContainer. * @param graph2 second molecule. May be an IQueryAtomContainer.
* @return The mapping found projected on graph1. This is sourceAtom List of CDKRMap objects containing Ids of matching atoms. * @return The mapping found projected on graph1. This is sourceAtom List of CDKRMap objects containing Ids of matching atoms.
*/ */
public static List<List<CDKRMap>> makeAtomsMapOfBondsMap(List<CDKRMap> rMapList, IAtomContainer graph1, IAtomContainer graph2) { private static List<List<CDKRMap>> makeAtomsMapOfBondsMap(List<CDKRMap> rMapList, IAtomContainer graph1, IAtomContainer graph2) {
if (rMapList == null) { if (rMapList == null) {
return (null); return (null);
} }
Expand Down Expand Up @@ -288,13 +288,13 @@ public static List<List<CDKRMap>> makeAtomsMapOfBondsMap(List<CDKRMap> rMapList,


/** /**
* This makes atom map of matching atoms out of atom map of matching bonds as produced by the get(Subgraph|Ismorphism)Map methods. * This makes atom map of matching atoms out of atom map of matching bonds as produced by the get(Subgraph|Ismorphism)Map methods.
* @see Added by Asad since CDK one doesn't pick up the correct changes * Added by Asad since CDK one doesn't pick up the correct changes
* @param list The list produced by the getMap method. * @param list The list produced by the getMap method.
* @param sourceGraph first molecule. Must not be an IQueryAtomContainer. * @param sourceGraph first molecule. Must not be an IQueryAtomContainer.
* @param targetGraph second molecule. May be an IQueryAtomContainer. * @param targetGraph second molecule. May be an IQueryAtomContainer.
* @return The mapping found projected on sourceGraph. This is atom List of CDKRMap objects containing Ids of matching atoms. * @return The mapping found projected on sourceGraph. This is atom List of CDKRMap objects containing Ids of matching atoms.
*/ */
public static List<List<CDKRMap>> makeAtomsMapOfBondsMapSingleBond(List<CDKRMap> list, IAtomContainer sourceGraph, IAtomContainer targetGraph) { private static List<List<CDKRMap>> makeAtomsMapOfBondsMapSingleBond(List<CDKRMap> list, IAtomContainer sourceGraph, IAtomContainer targetGraph) {
if (list == null) { if (list == null) {
return null; return null;
} }
Expand Down Expand Up @@ -438,10 +438,10 @@ protected void identifyMatchedParts(List<List<CDKRMap>> list, IAtomContainer sou
array1.add(sourceAtom); array1.add(sourceAtom);
array2.add(targetAtom); array2.add(targetAtom);


int IndexI = source.getAtomNumber(sourceAtom); int indexI = source.getAtomNumber(sourceAtom);
int IndexJ = target.getAtomNumber(targetAtom); int indexJ = target.getAtomNumber(targetAtom);


atomNumbersFromContainer.put(IndexI, IndexJ); atomNumbersFromContainer.put(indexI, indexJ);
} }
/*Added the Mapping Numbers to the FinalMapping* /*Added the Mapping Numbers to the FinalMapping*
*/ */
Expand Down Expand Up @@ -481,11 +481,11 @@ protected void identifySingleAtomsMatchedParts(List<CDKRMap> list,
array1.add(sAtom); array1.add(sAtom);
array2.add(tAtom); array2.add(tAtom);


int IndexI = source.getAtomNumber(sAtom); int indexI = source.getAtomNumber(sAtom);
int IndexJ = target.getAtomNumber(tAtom); int indexJ = target.getAtomNumber(tAtom);




atomNumbersFromContainer.put(IndexI, IndexJ); atomNumbersFromContainer.put(indexI, indexJ);


/*Added the Mapping Numbers to the FinalMapping* /*Added the Mapping Numbers to the FinalMapping*
*/ */
Expand Down
1 change: 1 addition & 0 deletions src/test/org/openscience/cdk/smsd/SMSDTest.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -547,6 +547,7 @@ public void testQueryAtomCount() throws CDKException {
Assert.assertTrue(foundMatches); Assert.assertTrue(foundMatches);
} }


@Test
public void testMatchCount() throws CDKException { public void testMatchCount() throws CDKException {
SMSD smsd = new SMSD(Algorithm.DEFAULT, true); SMSD smsd = new SMSD(Algorithm.DEFAULT, true);
SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance()); SmilesParser sp = new SmilesParser(DefaultChemObjectBuilder.getInstance());
Expand Down

0 comments on commit 4bdce61

Please sign in to comment.