openmolecules.org

 
Home » DataWarrior » Functionality » Saving 2D-structure with labels
Saving 2D-structure with labels [message #1614] Fri, 20 May 2022 17:04 Go to next message
vijaymasand is currently offline  vijaymasand
Messages: 6
Registered: May 2022
Junior Member
Dear all
Recently, I started using Datawarrior for research work, especially for QSAR and allied areas. It is really wonderful and useful for cheminformatics. I have three requirements from developers.
(1) I want to save the 2D-structure along with the labels, please see the ‘structure view’ panel in the attached image. I tried ‘copy view image’ but it copied only the structure and not the data labels. Is there any method to copy and paste (or save) the structure along with labels?
(2) Right now, it is providing data from Chembl 28. Recently, Chembl 30 was released. Is possible to force it to download data from Chembl 30?
(3) In ‘Look and Feel’ menu could you please add ‘white’ as an option.
Thanks in advance.
From
Vijay
Re: Saving 2D-structure with labels [message #1622 is a reply to message #1614] Sun, 05 June 2022 16:35 Go to previous messageGo to next message
nbehrnd is currently offline  nbehrnd
Messages: 224
Registered: June 2019
Senior Member
Dear Vijay,

addressing point 1) and a set of locally defined molecules to use the «copy new image» from a structure view, the export of structures and annotations as .png, or .svg worked well for me. Both exported illustrations contain a representation of the structure and the property previously selected:

/forum/index.php?t=getfile&id=555&private=0

The files exported were read easily by inkscape.[1] Here, I opted for the .png with a solid white background, though it is possible to opt-in for a transparent one. These observations refer to DW 5.5.0 for Linux in Debian 12/bookworm (branch testing) including DW's update by May 13, 2022. Thus, to ease replication of your problem, may you state the DW version you use and share a minimal .dwar file?

Norwid


[1] https://inkscape.org


Re: Saving 2D-structure with labels [message #1624 is a reply to message #1622] Mon, 06 June 2022 07:37 Go to previous messageGo to next message
vijaymasand is currently offline  vijaymasand
Messages: 6
Registered: May 2022
Junior Member
Dear Norwid
Thank you for the reply. The solution provided by you is really simple and useful. I also developed images with required labels using your method without any problem. This also solved my third requirement of inclusion of ‘white’ as an option in 'Look and Feel'.
However, when I tried it for more than 100 molecules, I got error message that it is out of memory. So, it has some limitations. I am using Windows 11 (64 bit), 32 GB RAM, and Datawarrior 05.05.00.
For point number 2, I hope the developers will develop a solution to download data from ChEMBL30.
With regards
Vijay
Re: Saving 2D-structure with labels [message #1629 is a reply to message #1624] Mon, 06 June 2022 19:14 Go to previous messageGo to next message
nbehrnd is currently offline  nbehrnd
Messages: 224
Registered: June 2019
Senior Member
Dear Vijay,

lacking access to Windows 11, I'm unable to replicate your findings. Thus, the operation system, or/and the executable of DW specifically released for Windows might contribute to this.

However, because DW* does not provide a progress bar when generating a .png or .svg from the array / structure view, a (perhaps hasty) perception may be anywhere between «the request to export the table wasn't yet launched» and «because of the computational load, the computer froze». In my case, it takes some time i) before an icon about the new file is displayed in the file browser, ii) the CPU monitor records a significant increase in computation, iii) the new file starts to be written, iv) writing all the data into the new file is completed. Do you consider a library of 5k random molecules DW generated a lager one (attached below)? The annotated structure array, exported as .svg is larger than 100 MB; for inkscape, this represents a larger file.

Difficult to tell if a sequential generation of these small illustrations (one frame with one molecular structure & selected description) as individual .png/.svg in a pattern like 001.png, 002.png, 003.png, etc. (or their .svg analogues) would be an advantage for you.

Norwid

*) tested with DW 5.5.0 for Linux including the update by 2022-06-04 in Debian 12/bookworm (branch testing)
Re: Saving 2D-structure with labels [message #1630 is a reply to message #1629] Tue, 07 June 2022 03:44 Go to previous messageGo to next message
vijaymasand is currently offline  vijaymasand
Messages: 6
Registered: May 2022
Junior Member
Dear Norwid,
Once again thank you for solving another issue. I found that not selecting all molecules before using "Copy View Image", generates the error message. When I selected all molecules using Ctrl+A before using "Copy View Image", then it was very easy to save 2D-strcuture with labels for all molecules as a .svg or .png file.
However, I couldn't find a suitable method for sequential generation of multiple small illustrations (one frame with one molecular structure & labels) as individual .png/.svg in a pattern like 001.png, 002.png, 003.png, etc. (or their .svg analogues).
Again thank you for the support.
with regards
Vijay
Re: Saving 2D-structure with labels [message #1631 is a reply to message #1630] Tue, 07 June 2022 09:26 Go to previous messageGo to next message
vijaymasand is currently offline  vijaymasand
Messages: 6
Registered: May 2022
Junior Member
Dear Norwid,
I found another simple way to export all 2D-structures with labels as a PDF file with a superb publication quality resolution.
First, I selected all the molecules in 'Structure view', then from 'File' menu option, I selected 'Print...'. This opened a new small window. In this new window, I opted for "Microsoft Print To PDF' and also checked 'Print to file'. Then, I was able to save it as pdf. However, it is mandatory to add file extension '.pdf' after the desired name for the file.
I hope this will be useful to other users.
Have a nice day.
Vijay
Re: Saving 2D-structure with labels [message #1632 is a reply to message #1631] Tue, 07 June 2022 19:30 Go to previous messageGo to next message
nbehrnd is currently offline  nbehrnd
Messages: 224
Registered: June 2019
Senior Member
Dear Vijay,

indeed, the «print to pdf» is an attractive alternative. Not only that the depictions don't pixelate as in the .png bitmap, the .pdf retains a searchable text layer. This then allows to identify /the/ entry of particular interest by a label set (SMILES string, catalogue number, etc.) after the document was exported.

Norwid

[Updated on: Tue, 07 June 2022 19:30]

Report message to a moderator

Re: Saving 2D-structure with labels [message #1655 is a reply to message #1632] Mon, 27 June 2022 18:45 Go to previous messageGo to next message
thomas is currently offline  thomas
Messages: 715
Registered: June 2014
Senior Member
Dear Vijay,

the ChEMBL server was updated recently to ChEMBL version 30.

If you select a structure view, which shows labels, and if you then select print from the File menu and choose a PDF-printer, then you should get a nice paginated PDF document with as many pages as needed to cover all your structures. The following picture shows a fraction of the pdf...

/forum/index.php?t=getfile&id=571&private=0
  • Attachment: t.png
    (Size: 102.37KB, Downloaded 1004 times)
Re: Saving 2D-structure with labels [message #1657 is a reply to message #1655] Wed, 29 June 2022 04:05 Go to previous messageGo to next message
vijaymasand is currently offline  vijaymasand
Messages: 6
Registered: May 2022
Junior Member
Dear Thomas
Thank you for updating the server to ChEMBL30.
In my recently published paper (Pharmaceuticals 2022, 15, 745. https://doi.org/10.3390/ph15060745Wink, I used molecular descriptors calculated by Datawarrior. The paper is full of mechanistic interpretations and new findings.
I am exploring Datawarrior. Thank you for creating Datawarrior.

Vijay
Re: Saving 2D-structure with labels [message #1663 is a reply to message #1657] Thu, 30 June 2022 20:03 Go to previous messageGo to next message
nbehrnd is currently offline  nbehrnd
Messages: 224
Registered: June 2019
Senior Member
Dear Vijay,

congratulations to your publication.

Note, table 1 includes some examples of «counting patterns» which indeed exceed DW's set of pre-set statistics (e.g., counting small saturated carbon-only cycles) available via chemistry -> from chemical structure -> calculate properties. However, the development version of DW offers an additional functionality via chemistry -> from chemical structure -> add substructure count. Assisted by the program's sketcher, you may define countable pattern matching your needs like «excluding S of sulfone, the eighth atom should be an aromatic carbon atom»

/forum/index.php?t=getfile&id=572&private=0

By selection (lasso) and double click, the properties of the atoms in question may be specified further. The documentation calls this «substructure count»,[1] just prior to the section header «The Structure Filter».

With best regards,

Norwid

[1] https://openmolecules.org/help/chemistry.html#StructureFilte r

Re: Saving 2D-structure with labels [message #1665 is a reply to message #1663] Sat, 02 July 2022 04:36 Go to previous message
vijaymasand is currently offline  vijaymasand
Messages: 6
Registered: May 2022
Junior Member
Thank you, dear Norwid
I am aware about the 'substructure count' and 'calculate properties' functionalities, which are really excellent and useful. I will definitely use them in future work.
Have a nice day.
Vijay
Previous Topic: macro buildEvolutionaryLibrary from a mac terminal
Next Topic: Row wise chemical reaction
Goto Forum:
  


Current Time: Fri Nov 22 00:22:50 CET 2024

Total time taken to generate the page: 0.03447 seconds