User 2c6aa21beb
03-02-2010 10:15:33
Hi,
I'm using the Marvin applet and when I load the structure the 2d coordinates
are being lost. I'm using the smiles structure which doesn’t have the
coordinates. How do I load the chemical structure with the 2d coordinates?
Please see attached word document for a detailed description with pictures.
Kind Regards and thanks in advance;
Karl
ChemAxon 990acf0dec
03-02-2010 11:04:37
Hi Karl,
There is no way to export coordinates into the original SMILES format, but you can do that if you export the structure to ChemAxon Extended SMILES format, and use the "c" option for exporting the coordinates. You can read more details here:
http://www.chemaxon.com/marvin/help/formats/cxsmiles-doc.html
Best regards,
Akos
User 2c6aa21beb
03-02-2010 11:36:26
Hi Akos,
Thanks very much for the quick reply.
When I use
marvinApplet.getMol("cxsmiles:+c");
I do get the coordinates;
But when I use the web services to store the Chemical structure,
<addStructure xmlns="http://webservice.jchem.chemaxon"><connectionHandlerId>connectionHandlerID1536034240</connectionHandlerId><tableName>en_chemstruct</tableName><structure>C1CCCCC1 |(-6.16,1.98,;-7.49,1.21,;-7.49,-.33,;-6.16,-1.1,;-4.83,-.33,;-4.83,1.21,)|</structure><additionalColumns>dataid</additionalColumns><additionalColumns>version</additionalColumns><additionalValues>35657</additionalValues><additionalValues>1</additionalValues></addStructure>
the cd_smiles column is C1CCCCC1, why am I losing the coordinates? am I using the add web_service incorrectly? or is it updating the cd_structure column with the correct data?
If its storing the coordinates now with the cxsmiles:+c, how can I get this coordinates and the structure loaded back into the applet?
Many Thanks again,
Karl
User c1ce6b3d19
04-02-2010 11:14:36
Karl,
My suggestion would be to use the mrv format to store into the database, because it contains the coordinates and other chemistry specific features as default.
marvinApplet.getMol("mrv");
The structure (with coordinates) can be retrieved by using the modified runCompleteSearch call you included in a previous email.
<runCompleteSearch xmlns="http://webservice.jchem.chemaxon"><connectionHandlerId>connectionHandlerID-1135095665</connectionHandlerId><tableName>en_chemstruct</tableName><queryMolecule>c1ccccc1</queryMolecule><queryOptions>sep=!
maxHitCount:100!maxTime:60000!returnNonHits:n!filterQuery:select
cd_structure
from en_chemstruct where dataid = 34337 and version =
1</queryOptions><beginIndex>0</beginIndex><count>1</count><outputFormat>mrv</outputFormat><dataFieldNames>cd_structure</dataFieldNames></runCompleteSearch>
The molecule structure is returned inside the <Molecule> tags of the WS response.
Your molecule will look something like this:
<?xml version="1.0" ?>
<cml>
<MDocument>
<MChemicalStruct>
<molecule molID="m1">
<atomArray
atomID="a1 a2 a3 a4 a5 a6"
elementType="C C C C C C"
x2="-6.16 -7.49 -7.49 -6.16 -4.83 -4.83"
y2="1.98 1.21 -0.33 -1.1 -0.33 1.21"
/>
<bondArray>
<bond atomRefs2="a1 a2" order="1" />
<bond atomRefs2="a2 a3" order="1" />
<bond atomRefs2="a3 a4" order="1" />
<bond atomRefs2="a4 a5" order="1" />
<bond atomRefs2="a5 a6" order="1" />
<bond atomRefs2="a1 a6" order="1" />
</bondArray>
</molecule>
</MChemicalStruct>
</MDocument>
</cml>
User 2c6aa21beb
04-02-2010 18:10:15
Hi Thanks for the suggestion;
I trying to do what you suggested but I'm having problems adding the mrv using the addstructure web service. So I didnt even get a chance to try the search for the mrv....
The error is saying format (?) Unrecognized file contents.
<addStructure xmlns="http://webservice.jchem.chemaxon"><connectionHandlerId>connectionHandlerID705397361</connectionHandlerId><tableName>en_chemstruct</tableName><structure><?xml version="1.0" ?>
<cml>
<MDocument>
<MChemicalStruct>
<molecule molID="m1">
<atomArray
atomID="a1 a2 a3 a4 a5 a6"
elementType="C C C C C C"
x2="-6.159999847412109 -7.493669188460368 -7.493669188460368 -6.159999847412109 -4.826330506363851 -4.826330506363851"
y2="-1.209966118881919 -1.9799830594409595 -3.5200169405590405 -4.290033881118081 -3.5200169405590405 -1.9799830594409595"
/>
<bondArray>
<bond atomRefs2="a1 a2" order="1" />
<bond atomRefs2="a1 a6" order="2" />
<bond atomRefs2="a2 a3" order="2" />
<bond atomRefs2="a3 a4" order="1" />
<bond atomRefs2="a4 a5" order="2" />
<bond atomRefs2="a5 a6" order="1" />
</bondArray>
</molecule>
</MChemicalStruct>
</MDocument>
</cml>
</structure><additionalColumns>dataid</additionalColumns><additionalColumns>version</additionalColumns><additionalValues>37531</additionalValues><additionalValues>1</additionalValues></addStructure>
Here is the response I'm getting
<?xml version=\'1.0\' encoding=\'UTF-8\'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><soapenv:Fault><soapenv:Code><soapenv:Value>soapenv:Receiver</soapenv:Value></soapenv:Code><soapenv:Reason><soapenv:Text xml:lang="en-US">Cannot recognize format (?)\nUnrecognized file contents:\n version="1.0" ?>\n</soapenv:Text></soapenv:Reason><soapenv:Detail /></soapenv:Fault></soapenv:Body></soapenv:Envelope>
I also tried to Web escape the mrv structure and I get the same error
<addStructure xmlns="http://webservice.jchem.chemaxon"><connectionHandlerId>connectionHandlerID-1025010257</connectionHandlerId><tableName>en_chemstruct</tableName><structure>%3C%3Fxml%20version%3D%221%2E0%22%20%3F%3E%0A%3Ccml%3E%0A%3CMDocument%3E%0A%20%20%3CMChemicalStruct%3E%0A%20%20%20%20%3Cmolecule%20molID%3D%22m1%22%3E%0A%20%20%20%20%20%20%3CatomArray%0A%20%20%20%20%20%20%20%20%20%20atomID%3D%22a1%20a2%20a3%20a4%20a5%20a6%22%0A%20%20%20%20%20%20%20%20%20%20elementType%3D%22C%20C%20C%20C%20C%20C%22%0A%20%20%20%20%20%20%20%20%20%20x2%3D%22%2D1%2E815000057220459%20%2D3%2E1486693982687175%20%2D3%2E1486693982687175%20%2D1%2E815000057220459%20%2D0%2E48133071617220047%20%2D0%2E48133071617220047%22%0A%20%20%20%20%20%20%20%20%20%20y2%3D%223%2E5200339001915673%202%2E750016959632527%201%2E2099830785144459%200%2E4399661379554054%201%2E2099830785144459%202%2E750016959632527%22%0A%20%20%20%20%20%20%20%20%20%20%2F%3E%0A%20%20%20%20%20%20%3CbondArray%3E%0A%20%20%20%20%20%20%20%20%3Cbond%20atomRefs2%3D%22a1%20a2%22%20order%3D%221%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3Cbond%20atomRefs2%3D%22a1%20a6%22%20order%3D%221%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3Cbond%20atomRefs2%3D%22a2%20a3%22%20order%3D%221%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3Cbond%20atomRefs2%3D%22a3%20a4%22%20order%3D%221%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3Cbond%20atomRefs2%3D%22a4%20a5%22%20order%3D%221%22%20%2F%3E%0A%20%20%20%20%20%20%20%20%3Cbond%20atomRefs2%3D%22a5%20a6%22%20order%3D%221%22%20%2F%3E%0A%20%20%20%20%20%20%3C%2FbondArray%3E%0A%20%20%20%20%3C%2Fmolecule%3E%0A%20%20%3C%2FMChemicalStruct%3E%0A%3C%2FMDocument%3E%0A%3C%2Fcml%3E%0A</structure><additionalColumns>dataid</additionalColumns><additionalColumns>version</additionalColumns><additionalValues>37530</additionalValues><additionalValues>1</additionalValues>
<?xml version=\'1.0\' encoding=\'UTF-8\'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><soapenv:Fault><soapenv:Code><soapenv:Value>soapenv:Receiver</soapenv:Value></soapenv:Code><soapenv:Reason><soapenv:Text xml:lang="en-US">Cannot recognize format (?)\nUnrecognized file contents:\n%3C%3Fxml%20version%3D%221%2E0%22%20%3F%3E%0A%3Ccml%3E%0A%3CMDocument%3E%0A%20%20%3CMChemicalStruct%3E%0A%20%20%20%20%3Cmolecule%20molID%3D%22m1%22%3E%0A%20%20%20%20%20%20%3CatomArray%0A%20%20%20%20%20%20%20%20%20%20atomID%3D%22a1%20a2%20a3%20a4%20a5%20...</soapenv:Text></soapenv:Reason><soapenv:Detail /></soapenv:Fault></soapenv:Body></soapenv:Envelope>
I even tried to adding the <format>mrv</format> to the addstructure webservice but this didnt help,
Am I doing something wrong here?? because in the example in
http://www.chemaxon.com/webservices/soap/DataManipulationWS.html
doesnt mention anything about format.... and I also tried this sample xml and this doesnt save either????
Many Thanks
Karl
User c1ce6b3d19
04-02-2010 18:27:04
Karl,
Instead of the web escape characters, try the html entities:
< <
> >
& &
" "
User 2c6aa21beb
05-02-2010 10:53:45
Many Thanks
I needed to HTML escape the xml text and not xml escape as you suggested...
Now I'm getting an error when searching for the mrv using the web service;
<runCompleteSearch xmlns="http://webservice.jchem.chemaxon"><connectionHandlerId>connectionHandlerID37043903</connectionHandlerId><tableName>en_chemstruct</tableName><queryMolecule>C1CCCCC1</queryMolecule><queryOptions>sep=! maxHitCount:100!maxTime:60000!returnNonHits:n!filterQuery:select cd_structure from en_chemstruct where dataid = 37749 and version = 1</queryOptions><beginIndex>0</beginIndex><count>100</count><outputFormat>mrv</outputFormat><dataFieldNames>cd_structure</dataFieldNames><hitColorAndAlignmentOptions xsi:nil="true" /></runCompleteSearch>
<?xml version=\'1.0\' encoding=\'UTF-8\'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><soapenv:Fault><soapenv:Code><soapenv:Value>soapenv:Receiver</soapenv:Value></soapenv:Code><soapenv:Reason><soapenv:Text xml:lang="en-US">The conversion from image to INTEGER is unsupported.</soapenv:Text></soapenv:Reason><soapenv:Detail /></soapenv:Fault></soapenv:Body></soapenv:Envelope>
I also tried to leave the queryMolecule element empty and I'm getting the same error
<runCompleteSearch xmlns="http://webservice.jchem.chemaxon"><connectionHandlerId>connectionHandlerID494374669</connectionHandlerId><tableName>en_chemstruct</tableName><queryMolecule></queryMolecule><queryOptions>sep=! maxHitCount:100!maxTime:60000!returnNonHits:n!filterQuery:select cd_structure from en_chemstruct where dataid = 37749 and version = 1</queryOptions><beginIndex>0</beginIndex><count>100</count><outputFormat>mrv</outputFormat><dataFieldNames>cd_structure</dataFieldNames></runCompleteSearch>
<?xml version=\'1.0\' encoding=\'UTF-8\'?><soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><soapenv:Fault><soapenv:Code><soapenv:Value>soapenv:Receiver</soapenv:Value></soapenv:Code><soapenv:Reason><soapenv:Text xml:lang="en-US">The conversion from image to INTEGER is unsupported.</soapenv:Text></soapenv:Reason><soapenv:Detail /></soapenv:Fault></soapenv:Body></soapenv:Envelope>
Am I doing something wrong here??? because I'm using the format mrv as you suggested in the earlier post,
Any help will be appreciated. I have also attached the exception from Tomcat.
Kind Regards
Karl
User 2c6aa21beb
05-02-2010 11:41:04
I have the search working now, I'm working on the display, I'll post more if I get it working,
Thanks
Karl
User c1ce6b3d19
05-02-2010 11:47:11
That's great. what did you change to fix it?
Jon
User c1ce6b3d19
05-02-2010 12:10:29
Karl,
Try translating the escaped characters back into regular characters before sending them to the applet.
< <
> >
& &
" "
User 2c6aa21beb
05-02-2010 12:12:39
User 2c6aa21beb
08-02-2010 11:55:14
I need assistance to save, retrieve and edit a chemical stucture using the MarvinSketch & the WebServices technologies using a suitable 2d format (not smiles)
- I can save the chemical structure using the 'addStructure' SAOP message from the Chemaxon WebSevice The structure is saved using the 'mrv' format.
Is this correct ?
- To edit this saved stucture, I understand from previous discussions that I must first search for that structure using the 'runCompleteSearch' which contains a subquery to identify the cd_id value. Is this correct ?
I have tried both 'mrv' and 'mol' as the retireved format value, neither of which I can sucessfully load in the marvin Sketch.
- Now to load the structure into MarvinSketch, I have tried the approach as detailed in discussion -
http://www.chemaxon.com/forum/viewpost26573.html&highlight=msketch+mol#26573
using the mol format, but have received errors shown in the attached file 'Chemaxon_1.jpg'
What is the correct format to load the chemical structure and what are the Msketch parameters to do so ?
ChemAxon 7c2d26e5cf
08-02-2010 16:09:36
We are checking the issue.
ChemAxon 7c2d26e5cf
09-02-2010 16:15:27
Marvin could not read the embedded molecule string since it is not encoded by the proper way.
Encode quotes and linebreaks.
" -> \"
linebreak -> \n
If you encode the string properly, you got a long string without linebreaks.
Please see the following examples. They demonstrates how to embed mol and mrv string into applet source:
MarvinSketch Example - Inline mol source
MarvinSketch Example - Inline mrv source