On 6/9/11 5:03 AM, nms_uk wrote: > this must be very basic, but how do you use openbabel from command line to > compare 2 InChI strings?
If both molecules are in the same file (say an SDF), do this: babel file.sdf -o inchi | sort -u | wc -l (that's a lowercase "L", not a digit 1 on wc). If it prints "1", the two InChIs are the same. If it prints "2", they're different. You can extend this to a whole file to get the number of unique molecules. It should work with either InChI or SMILES. Something like this: babel file.sdf -o inchi | sort | uniq -c This will give you a count of how many times each molecule is repeated in the file. Craig ------------------------------------------------------------------------------ EditLive Enterprise is the world's most technically advanced content authoring tool. Experience the power of Track Changes, Inline Image Editing and ensure content is compliant with Accessibility Checking. http://p.sf.net/sfu/ephox-dev2dev _______________________________________________ OpenBabel-discuss mailing list OpenBabel-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbabel-discuss