Skip to content

Commit

Permalink
Providing a custom set of invariants before labelling.
Browse files Browse the repository at this point in the history
Signed-off-by: Cyrus Harmon <ch-github@bobobeach.com>
  • Loading branch information
johnmay committed Feb 24, 2014
1 parent 2fe701a commit 8b7b722
Showing 1 changed file with 26 additions and 1 deletion.
Expand Up @@ -109,7 +109,32 @@ private Canon(int[][] g, long[] partition, boolean symOnly) {
* @see InChINumbersTools
*/
public static long[] label(IAtomContainer container, int[][] g) {
return new Canon(g, basicInvariants(container, g), false).labelling;
return label(container, g, basicInvariants(container, g));
}

/**
* Compute the canonical labels for the provided structure. The labelling
* does not consider isomer information or stereochemistry. This method
* allows provision of a custom array of initial invariants.
*
* <p/>
* The current
* implementation does not fully distinguish all structure topologies
* but in practise performs well in the majority of cases. A complete
* canonical labelling can be obtained using the {@link InChINumbersTools}
* but is computationally much more expensive.
*
* @param container structure
* @param g adjacency list graph representation
* @param invariants intial invariants
* @return the canonical labelling
* @see EquivalentClassPartitioner
* @see InChINumbersTools
*/
public static long[] label(IAtomContainer container, int[][] g, long[] invariants) {
if (invariants.length != g.length)
throw new IllegalArgumentException("number of invariants != number of atoms");
return new Canon(g, invariants, false).labelling;
}

/**
Expand Down

0 comments on commit 8b7b722

Please sign in to comment.