Posted: Tue Oct 18, 2016 1:48 pmPost subject: util/calculate/molExport: how to set implicitH parameter?
hi,
i'm using the "util/calculate/molExport" endpoint to render png images. as parameters i pass the string "png:w400,h400,nosource,maxscale28,mono", and this works as expected.
but i did not find a way how to pass the "implicitH=off" parameter. how is this done?
thanks for any suggestions.
Péter ChemAxon personnel
Joined: 31 Aug 2012
Posts: 110
Posted: Mon Jan 30, 2017 3:05 pmPost subject: setHitColor
Hi,
i have a question depending the same API.
We make a substructure search and get a molecule with highlighted bonds. These bonds are red. I would like to change the color of these bonds. But when I use the parameter colors the background color changes.
It is possible to change the highlighted bonds color with a parameter?
e.g. like "png:w200,h200,maxscale28,H_hetero,setHitColor#3465A4";
Best Ann
Péter ChemAxon personnel
Joined: 31 Aug 2012
Posts: 110
It is a bit tricky as I need the binaryStructure which is offered if I use parameter = png but in this structure the cd_structure display parameter are not provided.
If I use the linke of the response instead of the binaryStructure I have to make another request to the webservices what I would like to avoid.
Best Ann
Péter ChemAxon personnel
Joined: 31 Aug 2012
Posts: 110
Sorry, you wrote you are doing substructure search, my sample is working when you are doing a substucture search in the database on a JChem table url like here: https://restdemo.chemaxon.com/apidocs#advancedsearch
Table's url looks ike /rest-v0/data/sample/table/{tableName}/search
For doing highlighting on a single structure, you can use this: POST/rest-v0/util/calculate/jsonImage
{
"structure": "aspirin",
"parameters": { // these are the parameters of the generated image
"width": 300
},
"filterChain": [
{
"filter": "highlight",
"parameters": {
"queryStructure": "C1=CC=CC=C1",
"displayOptions": {
"hitColor": "FF00FF"
}
}
}
]
}
The filter chain is doing highlighting on the target structure with the provided quey and color.
It is also possible to return also the structure in any format in a single request, so I can show you more examples if needed.
thank you again. I thought it would be enough to commit the highlighted structure once.
/calculate/jsonImage looks a lot better only that the highlighted part of the structure is the one I do not want to highlight and the automapping information is turned on.
I see... "reactionConverter" filter cannot remove existing mapping from the input. Can you provide a sample reaction you are trying to display?
Also "highlighter" filter is doing a substructure search with the query and will highlight the first hit. What kind of other parameters can you imagine for that to work as expected?
"jsonImage" calculator is using the existing coloring in the structure to render it. Is it a possible solution for you to prepare the structure with the part already colored?
Yes I am doing a substructure search but at that point where I request the image it is no substructure search any more as I only need to convert the mol file into an image. In this molecule all information are already in (see attachement).
In the PNG/SVG the bonds are red (from molExport or jsonImage without any parameters).
When I send this mol file to /jsonImage with the highlighter I compare it with the queryStructure but now I compare it with itself. As there are some highlight infomation in the molecule these are not recognized (I think). In my opinion that is the reason why the colors are exchanged. At that point I do not have the search information any more.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum