Null Field when importing SDF File into table

User f77f09c19a

01-07-2008 19:16:37

When importing molecule from SDF file, the <name> field is always NULL even though the file contains the property <name> for each imported molecule.


I tried to add the column in the structure table with NOT NULL constrains, but that gave and error of there is no default value for the field.


During the process of creating the table the field shows as not connected, in the step before executing the command.





Any help will be appreciated.





Regards, Saif

ChemAxon a9ded07333

01-07-2008 19:47:22

Could you send a sample file that fails to read the name field?





Best regards,





Tamás

User f77f09c19a

01-07-2008 22:08:35

Hi Tomas


Attached is part of one of the files I imported.(i attached a file with only 100 molecule)


I'm not a chemist, but if I consider the first line of the file as name for the molecule, is there any way it can be read into the name field of the structure table created by JChemManager?





Regards, Saif

ChemAxon a9ded07333

02-07-2008 09:25:57

Hi Saif,
Quote:
I tried to add the column in the structure table with NOT NULL constrains, but that gave and error of there is no default value for the field.
Creating a column in the database with NOT NULL constraint is OK, but you have to decide which field of the file should be connected to this table field.
Quote:
if I consider the first line of the file as name for the molecule
In your file the fields <PUBCHEM_COMPOUND_CID> contain the same number as the first line of the molecule [note that the first line is NOT a field!], so if you want to use this number as molecule name, you have to connect this file field to your database table field (see attached screenshot).
Quote:
the file contains the property <name> for each imported molecule.
This file contains more fields that can be names of the molecule. If you want to use one of these fields as name, connect the appropriate one.





Regards,





Tamás

User f77f09c19a

02-07-2008 20:41:49

Hi Tamás


Thank you for your reply.


In many cases of SDF files there is no field. In such case how can I get the name of each molecule, (usually it's the first line in each molecule).





Thank you.





Regards, Saif

ChemAxon 9c0afc9aaf

04-07-2008 10:10:23

Hi,





We do not have an option yet to import the molfile name from the input structure into a database column yet.


We have discussed this and scheduled this option for JChem 5.2 (5.1 is too close now), and Instant JChem 3.0.





Are these names IUPAC names or some other compound identifiers ?


If IUPAC names are needed, you can add a Chemical Terms column to the table, and they are automatically generated.


Please let us know if you need more information on this solution.





Best regards,





Szilard

User acc0517f25

15-08-2008 17:30:23

Just wanted to make sure that I understood correctly. There is currently no way to extract the name of a chemical when it is stored in the standard way within a sdfile?

ChemAxon 9c0afc9aaf

15-08-2008 17:44:00

Hi,





There is a way, but only from the API at the moment.





MolImporter automatically reads the names of structures during import:





http://www.chemaxon.com/jchem/doc/api/chemaxon/formats/MolImporter.html





You can get the name for each molecule by using Molecule.getName:





http://www.chemaxon.com/jchem/doc/api/chemaxon/struc/Molecule.html#getName()





Then you can insert it to the database with UpdateHandler.


In this case please make sure you also speicfy the string representation fo UpdateHandler, the easiest way is to convert to MRV with Molecule.toFormat("mrv")





Alternatively you may put the name to an SDF property and export with MolExport to SDF again.


The name will also be present in a data field in this case, and can be handled by our GUI applications:





http://www.chemaxon.com/jchem/doc/api/chemaxon/struc/Molecule.html#setProperty(java.lang.String,%20java.lang.String)





http://www.chemaxon.com/jchem/doc/api/chemaxon/formats/MolExporter.html





Best regards,





Szilard