Validatate a molfile in a single step using Marvin Java API?

User e6dac1475d

15-01-2014 14:56:01

Dear Chemaxon team,


 


 I am using the Java API v6.1.3 and I would
like to perform a general validation of a structure contained in a molfile, programmatically, i.e. not with a GUI or a command line tool.


Question 1:


Would you recommend to read the molfile into a Molecule and then perform a structure checker on the Molecule? Or is there another way to validate the file before creating a java Molecule instance?


Question 2:


In the Javadoc, I saw the StructureChecker interface, check(Molecule molecule) method, but the implementations are too complex for my purpose: I can see only the specific structure checkers (AtomChecker, MoleculeChargeChecker, etc..), but I don't want to call each of them explicitly. Basically, I only would like to have a simple check result of type boolean true/false (=molfile structure ok or not).  Is there a java class that is able to perform all the structure checks with a single method call? Something like XXGeneralStructureChecker.checkValid(molfile or Molecule) returning true/false?


Remark:


I am aware of the existence of the standalone/command-line StructureCheck and the StructureChecker GUI, but I would prefer to use the API directly in my context.


 


Thanks for your support,


Thierry


(int. ref. MET-123)

ChemAxon d26931946c

15-01-2014 16:09:42

Hi Thierry,


1) Yes, parsing the mol files to Molecule objects in a good way of validating the file itself.


2) For running multiple checkers on the same Molecule you may use the implementations of CheckerRunner. 


Please let us know if you have any further questions.


Peter

User e6dac1475d

16-01-2014 08:03:23

Dear Peter,


 


Thank you for your answer, I will try the CheckerRunner (BasicCheckerRunner or another) as you suggest.


 


Best regards,


 


Thierry