2D to 3D structure conversion

User 368690ce71

23-06-2010 14:38:21

Hello,


I am trying to convert a table of molecules with 2D structure into 3D structures by


1) adding a 'New chemical terms' field


2) using the function 'lowestEnergyConformer()'


Then I get the following error message for each molecule:


--------


Error: Error at molecule with cd_id: 1
java.sql.SQLDataException: A truncation error was encountered trying to shrink VARCHAR '<?xml version="1.0" ?>
<cml>
<MDocument>
  <MChemicalStruct>&' to length 1000.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
        at org.apache.derby.impl.jdbc.EmbedPreparedStatement.execute(Unknown Source)
        at chemaxon.jchem.db.CTColumnRegenerator.updateRow(CTColumnRegenerator.java:146)
        at chemaxon.jchem.db.CTColumnRegenerator.access$500(CTColumnRegenerator.java:35)
        at chemaxon.jchem.db.CTColumnRegenerator$RegenThread.run(CTColumnRegenerator.java:108)
Caused by: java.sql.SQLException: A truncation error was encountered trying to shrink VARCHAR '<?xml version="1.0" ?>
<cml>
<MDocument>
  <MChemicalStruct>&' to length 1000.
        at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown Source)
        ... 12 more
Caused by: ERROR 22001: A truncation error was encountered trying to shrink VARCHAR '<?xml version="1.0" ?>
<cml>
<MDocument>
  <MChemicalStruct>&' to length 1000.
        at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
        at org.apache.derby.iapi.types.SQLChar.hasNonBlankChars(Unknown Source)
        at org.apache.derby.iapi.types.SQLVarchar.normalize(Unknown Source)
        at org.apache.derby.iapi.types.SQLVarchar.normalize(Unknown Source)
        at org.apache.derby.iapi.types.DataTypeDescriptor.normalize(Unknown Source)
        at org.apache.derby.impl.sql.execute.NormalizeResultSet.normalizeRow(Unknown Source)
        at org.apache.derby.impl.sql.execute.NormalizeResultSet.getNextRowCore(Unknown Source)
        at org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore(Unknown Source)
        at org.apache.derby.impl.sql.execute.UpdateResultSet.collectAffectedRows(Unknown Source)
        at org.apache.derby.impl.sql.execute.UpdateResultSet.open(Unknown Source)
        at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
        ... 6 more

-----------


I am not a programmer, so I am not sure what wrong here and if this is the right procedure to obtain 3D coordinates.


Many thanks


Andreas

ChemAxon fa971619eb

24-06-2010 04:45:46

Yes, you are doing the right sort of thing, but there are a couple of gotchas here.


1. To store structures they must be converted to a text represtantion. It seems that you may already be doing this, but in case not then you shoudl do this. You can do this with a chemical terms expression like this:


molString(lowestEnergyConformer(), 'mrv')


2. The length of the text column that you use needs to be large enough to store the values. But default a VARCHAR column of 1000 characters is used, and this is much to small. It is best to set the column type to CLOB to store large values like this (use the combobox int he bottom left corner of the dialog for this)


Tim

User 368690ce71

24-06-2010 10:48:00

Many thanks, Tim,


Your second point using the column type CLOB made the difference.


As a result I get something like this (for each molecule in my table):


---------


<?xml version="1.0" ?>
<cml>
<MDocument>
  <MChemicalStruct>
    <molecule molID="m1">
      <propertyList>
        <property dictRef="Energy" title="Energy">
          <scalar>69.18729064307693</scalar>
        </property>
        <property dictRef="Clean3DConformersDescriptor" title="Clean3DConformersDescriptor">
          <scalar dataType="xsd:ENTITY"><![CDATA[MProp:chemaxon.marvin.modelling.struc.ConformersDescriptor:17 6 6 6 7 6 8 6 6 6 6 7 6 6 7 6 6 7 6 6 6 6 6 ...
....
....
</bondArray>
    </molecule>
  </MChemicalStruct>
</MDocument>
</cml>
------------------------


This does not display as a 3D structure. Also what I want to do finally, is to export the table with 3D structures as in the mol format, so I can use the 3D structures for further computations.


The cell renderer for that column has only two options: 'Text Renderer' and 'Multiline Text Renderer'.


Many thanks


Andreas

ChemAxon fa971619eb

25-06-2010 13:31:16

Which version of IJC are you uisng?
Since IJC 3.0 we have the option to display text columns using the structure renederer.


Tim

ChemAxon e189db4705

25-06-2010 13:34:26

We tested it on Local DB and on Oracle and it works for us. Text fields based on CLOB columns should have Structure renderer available. Also Molecule pane widget can be used for displaying of this field.


Please look at following animation. This was tested in Instant JChem 5.3.4 on sample project (pubchem) with just 5 rows.