Skip to content

Commit

Permalink
default path length set to 7 for pathfingerprinter
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich Apodaca committed Jul 17, 2009
1 parent d2ab04b commit fd15030
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/com/metamolecular/mx/fingerprint/PathFingerprinter.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public PathFingerprinter(RingFilter filter)
this.walker = new DefaultWalker();
this.filter = filter;
this.aromatics = new HashSet();

walker.setMaximumDepth(7);
}

public RingFilter getRingFilter()
Expand Down Expand Up @@ -97,8 +99,10 @@ public BitSet getFingerprint(Molecule molecule)
{
bloomFilter.clear();
findAromatics(molecule);

// System.out.println(molecule.countAtoms());

for (int i = 0; i < molecule.countAtoms(); i++)
for (int i = 1; i < molecule.countAtoms(); i++)
{
Atom atom = molecule.getAtom(i);

Expand Down
6 changes: 5 additions & 1 deletion src/com/metamolecular/mx/test/PathFingerprinterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package com.metamolecular.mx.test;

import com.metamolecular.mx.fingerprint.PathFingerprinter;
Expand All @@ -47,6 +46,11 @@ protected void setUp() throws Exception
{
fingerprinter = new PathFingerprinter();
}

public void testItStartsWithMaxDepthSeven()
{
assertEquals(7, fingerprinter.getMaximumPathDepth());
}

public void testItIsCreatedWithACustomRingFilter()
{
Expand Down
2 changes: 1 addition & 1 deletion src/com/metamolecular/mx/walk/PathWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void walkStart(Atom atom)
}

public void atomFound(Atom atom)
{
{
if (atomPath.size() > 0 && (atomPath.size() != bondPath.size()))
{
throw new RuntimeException("Attempt to add Atom without first adding Bond");
Expand Down

0 comments on commit fd15030

Please sign in to comment.