User defined flags

User 07eebf78ca

16-11-2004 22:03:33

Hi,





I have some code that creates a Molecule. Some of the MolAtoms in the Molecule can have some inconsistencies like a charge of 0.5 which doesn't make sense. So I do some balancing and remove all non-integral charges and return the Molecule. But I would like to flag the Molecule as a "had charge errors" and I may also need to flag the MolAtoms as "had non-integral charge".





Is there any way to add user defined flags to Molecules or MolAtoms. I noticed get/setExtraLabel() methods for MolAtom. Is it what I'm looking for? I don't understand how exactly these methods should be used since the setExtraLabel() takes only one parameter - the Label name. What about the value? Please explain how I should use those methods. I don't see any such methods for Molecule class though!





Also, are these labels visible in MarvinSketch? I would prefer user defined flags that are not visible in MarvinSketch and are used purely for the purpose of passing additional information about the Molecule within the Java code. Is there any method which satisfies this requirement of mine?





Also, when can I expect a JChem release that includes Marvin 3.5 classes.





Thanks,


Sarav

ChemAxon fb166edcbd

17-11-2004 19:06:36

We have property String key-value pairs instead of flags.


You can set/get molecule properties by


Code:



Molecule.setProperty(String key, String value)


Molecule.getProperty(String key)





These properties are saved in SDF tags (tag name: key) and also saved in MRV format. They can also be saved in ChemAxon SMILES (but will not be read by other software in this case):


http://www.chemaxon.com/marvin/doc/user/smiles-doc.html#options


"Tf1:f2:... Export f1, f2 ... SDF fields."








Code:



MolAtom.setExtraLabel(String label)





sets an atom label that is also displayed in the Marvin GUI. This is not a property table but a single label attached to the atom. Actually, there can be two labels defined in one string,


separated by a "|" character.





It is better to use Molecule.setProperty() also for flagging atoms for internal use: you can list the atom flags in atom order and separate them by ";" signes, e.g. ";;;e;;;e;e;;" where 'e' means "charge error at this atom".





Time of JChem release that includes Marvin 3.5 classes: we do not know yet but we are working hard on it.