Just a note on this - in CDK 1.5 the Pattern class is preferred as the
universal isomorphism tester is actually doing MCS (much harder).

Pattern ptrn = Pattern.findIdentical(butane);
for (Mol m : mols)
   ptrn.matches(m);

In general though this is the slowest way to do it (n^2) vs (n log n) with
InChI/SMILES.


Regards,
John W May
john.wilkinson...@gmail.com

On 8 July 2015 at 00:03, Egon Willighagen <egon.willigha...@gmail.com>
wrote:

> Dear Zheng Shi,
>
> I think what you are looking for is "isomorphism checking". If the
> chemical graph of two structures is the same, they are called
> isomorphic. The following Groovy code shows a very basic example:
>
> butane = MoleculeFactory.makeAlkane(4);
> isomorphismTester = new UniversalIsomorphismTester()
> println "Is isomorphic: " +
>   isomorphismTester.isIsomorph(
>     butane, butane
>   )
>
> But that can also indeed be done with canonical SMILES or InChI, as
> indicated by John.
>
> Egon
>
> On Mon, Jul 6, 2015 at 11:16 PM, Zheng Shi <zs...@ualberta.ca> wrote:
> > The "compare" means to tell if two molecules are equal. Suppose I have a
> > molecule B, which is generated by molecule A during a reaction: A -> B,
> and
> > I get a molecule C, which is also generated by molecule A during a
> reaction:
> > A->C. I want to tell whether B and C are the same. Usually we can
> visualize
> > the structure of the two structures to see. But if the number of
> molecules
> > is too big, for example, two sdf files contain some molecules, then it's
> not
> > convenient to visualize manually. So is there a reasonable way to do
> that?
> > can we just generate canonical form for molecules (like SMILES, then
> compare
> > the SMILES)? Is it reasonable for this? Or other methods? Thanks.
> >
> > On Mon, Jul 6, 2015 at 3:17 AM, John M <john.wilkinson...@gmail.com>
> wrote:
> >>
> >> Hit send too soon...
> >>
> >>  b) Generate hash codes (CDK/InChIKey)
> >>  c) Graph-Isomorphism check.
> >>
> >> Normally the best approach is (a) but this might not be the
> >> equality/comparison you want?
> >>
> >> John
> >>
> >>
> >>
> ------------------------------------------------------------------------------
> >> Don't Limit Your Business. Reach for the Cloud.
> >> GigeNET's Cloud Solutions provide you with the tools and support that
> >> you need to offload your IT needs and focus on growing your business.
> >> Configured For All Businesses. Start Your Cloud Today.
> >> https://www.gigenetcloud.com/
> >> _______________________________________________
> >> Cdk-user mailing list
> >> Cdk-user@lists.sourceforge.net
> >> https://lists.sourceforge.net/lists/listinfo/cdk-user
> >>
> >
> >
> >
> ------------------------------------------------------------------------------
> > Don't Limit Your Business. Reach for the Cloud.
> > GigeNET's Cloud Solutions provide you with the tools and support that
> > you need to offload your IT needs and focus on growing your business.
> > Configured For All Businesses. Start Your Cloud Today.
> > https://www.gigenetcloud.com/
> > _______________________________________________
> > Cdk-user mailing list
> > Cdk-user@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/cdk-user
> >
>
>
>
> --
> E.L. Willighagen
> Department of Bioinformatics - BiGCaT
> Maastricht University (http://www.bigcat.unimaas.nl/)
> Homepage: http://egonw.github.com/
> LinkedIn: http://se.linkedin.com/in/egonw
> Blog: http://chem-bla-ics.blogspot.com/
> PubList: http://www.citeulike.org/user/egonw/tag/papers
> ORCID: 0000-0001-7542-0286
> ImpactStory: https://impactstory.org/EgonWillighagen
>
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Cdk-user mailing list
Cdk-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to