Inserting structures with UpdateHandler leads to empty ones

User f6678ce8b0

14-08-2008 10:15:33

Hi.


I am upgrading to JChem 3.1.5 then 5.1.0 and the insertion of structures now leads to a strange behavior (in both versions). When using UpdateHandler to insert a structure (code below), the smiles and fingerprints are inserted but the structure is empty, as showed by using marvin applet to display it (it is important to know this code was previously working, at least in 3.0.13, later I am unsure).


I rewrited the code to use the Importer and this time it works, as it is with Jchem manager. But I need to be able to use the update handler when the source is not an SDF file...


Also, on these structures (don't depend on which structure, it never works) when I run the regenerate option in jcman, then the lines in the structure tables are emptied, with the smile removed and all fingerprints to 0.


May there be a structure table trouble ?





**** Code for insertion (based on conversion from smiles to Molecule) ****





uh = new UpdateHandler(ch, UpdateHandler.INSERT, "STRUCTURE", "NAME, TYPE") ;


//uh.setStructure(molecule);


uh.setInputMolecule(molecule);


uh.setSetChiralFlag(true);


uh.setStandardizationEnabled(true);


uh.setDuplicateFiltering(true);


uh.setEmptyStructuresAllowed(false);


uh.setValueForAdditionalColumn(1, Name);


uh.setValueForAdditionalColumn(2, MolNumber);


cd_id = uh.execute(true);





**** Structure table ****





CD_ID NOT NULL NUMBER(10)


CD_SMILES VARCHAR2(1000


CD_FORMULA VARCHAR2(100)


CD_MOLWEIGHT FLOAT(126)


CD_FP1 NOT NULL NUMBER(10)


CD_FP2 NOT NULL NUMBER(10)


CD_FP3 NOT NULL NUMBER(10)


CD_FP4 NOT NULL NUMBER(10)


CD_FP5 NOT NULL NUMBER(10)


CD_FP6 NOT NULL NUMBER(10)


CD_FP7 NOT NULL NUMBER(10)


CD_FP8 NOT NULL NUMBER(10)


CD_FP9 NOT NULL NUMBER(10)


CD_FP10 NOT NULL NUMBER(10)


CD_FP11 NOT NULL NUMBER(10)


CD_FP12 NOT NULL NUMBER(10)


CD_FP13 NOT NULL NUMBER(10)


CD_FP14 NOT NULL NUMBER(10)


CD_FP15 NOT NULL NUMBER(10)


CD_FP16 NOT NULL NUMBER(10)


STRUCTNUM NUMBER(10)


NAME VARCHAR2(255)


TYPE VARCHAR2(80)


CD_STRUCTURE LONG RAW


CD_HASH NOT NULL NUMBER(10)


CD_FLAGS VARCHAR2(20)


CD_TIMESTAMP NOT NULL DATE


CD_SORTABLE_FORMULA VARCHAR2(500)





**** JCHEMPROPERTIES ****


db.ConstraintNeededForPrimaryKeyDef=false


registration.code=xxxxxxx


registration.code.cluster=xxxxxx


registration.code.cartridge=0


db.isAutoIncrementProperty=true


db.autoIncrementTriggerCreation=built-in value


db.autoIncrementTriggerCleanup=built-in value


db.existsBitwiseAND=BITAND


table.STRUCTURE.version=50100


table.STRUCTURE.fingerprint.numberOfBits=512


table.STRUCTURE.fingerprint.numberOfOnes=2


table.STRUCTURE.fingerprint.numberOfEdges=5


table.STRUCTURE.absoluteStereo=true


option.structureCompressionDisabled=false


update.logs.to.keep=1000


table.STRUCTURE.JChemVersion=5.1.0


table.STRUCTURE.validityTimestamp=2008-08-13 23:17:59.784


option.commitInterval=50





I am using Oracle 9.2.0.3.0 on Linux RHEL 3.


Thanks in advance for your help


Fabien





PS: And when regenerating the table, I got this exception on several structures, maybe it can help you on other stuff...


(with Cimetidine, Omepraole structures, for example)


Error at molecule with cd_id: 5210


java.lang.NullPointerException


at chemaxon.sss.screen.HashCode.processTautomerRegions(HashCode.java:188)


at chemaxon.sss.screen.HashCode.initialize(HashCode.java:170)


at chemaxon.sss.screen.HashCode.getHashCode(HashCode.java:67)


at chemaxon.sss.screen.HashCode.getHashCode(HashCode.java:107)


at chemaxon.sss.screen.HashCode.getHashCode(HashCode.java:94)


at chemaxon.jchem.db.UpdateHandler.init(UpdateHandler.java:1138)


at chemaxon.jchem.db.UpdateHandler.execute(UpdateHandler.java:2291)


at chemaxon.jchem.db.UpdateHandler.execute(UpdateHandler.java:2269)


at chemaxon.jchem.db.Regenerator$RegenThread.run(Regenerator.java:81)

User f6678ce8b0

14-08-2008 12:29:21

In fact, I read a message on the forum where it is stated to use the setValueForFixColumn to pass the string representation of the structure.


Though counterintuitive, it seems to work (by using setStructure as isetValueForFixColum is now deprecated).


You should really make the javadoc clearer.


So first point is now solved, only remains the NullPointer Exception, that isn't causing troubles at the time but may...


Best,


Fabien

ChemAxon e274e1bada

15-08-2008 19:02:25

Hi Fabien,





We will make our API doc clearer at this point for the next version.


We are investigating that exception, thank you for the report.





Regards, Edvard

ChemAxon e274e1bada

18-08-2008 09:49:55

Hi Fabien,





could you post the structure which generate the NullPointerException?


Please send it to my address (you can fin it in my profile) if it is confidential.





Regards, Edvard

User f6678ce8b0

18-08-2008 09:55:22

Hi Edvard.


Here is one of the faulty ones.


Best regards,


Fabien

ChemAxon e274e1bada

19-08-2008 13:17:48

Hi,





Thank you for the file and the report. This is indeed a bug, we will fix it by JChem 5.1.2





Best Regards, Edvard