openmolecules.org

 
Home » DataWarrior » Functionality » Suggestion: add molecular weight calculation for individual compound
Suggestion: add molecular weight calculation for individual compound [message #2458] Thu, 29 January 2026 10:38 Go to next message
Laurent is currently offline  Laurent
Messages: 3
Registered: January 2026
Junior Member
Would it be possible to add a command to calculate the molecular weight for a single molecule instead of having to do it for all molecules in a database?
Re: Suggestion: add molecular weight calculation for individual compound [message #2460 is a reply to message #2458] Thu, 29 January 2026 15:32 Go to previous messageGo to next message
nbehrnd is currently offline  nbehrnd
Messages: 240
Registered: June 2019
Senior Member
Hello Laurent

by the title of your question, I thought you refer to identify the largest fragment in a structure (chemistry -> from chemical structure -> extract unconnected fragment; note: singular) to the result a new column (cf. attached screen photo) eventually used as reference to compute for instance the molecular weight. The body however reads more like i) screen a .dwar file and compute e.g., the molecular weight only if ii) a predefined (sub)structure matches the an entry in the structure column. Can you amend your question with details?

Best,
Norwid
Re: Suggestion: add molecular weight calculation for individual compound [message #2462 is a reply to message #2460] Thu, 29 January 2026 15:56 Go to previous messageGo to next message
Laurent is currently offline  Laurent
Messages: 3
Registered: January 2026
Junior Member
Hello Norwid,

To be more explicit: I add an empty line in my .dwar file that contains a column "Total Molweight". I draw my structure and would like to calculate the molecular weight for this structure alone and put its value in Total Molweight corresponding cell. Is it possible?

Regards,
Laurent
Re: Suggestion: add molecular weight calculation for individual compound [message #2463 is a reply to message #2462] Fri, 30 January 2026 20:02 Go to previous messageGo to next message
nbehrnd is currently offline  nbehrnd
Messages: 240
Registered: June 2019
Senior Member
Hello Laurent

Contrasting to molecule editors like ACD ChemSketch, or Biovia Draw which monitor and continuously monitor and if necessary automatically update the display of the molecular weight of a structure, such a check and revision in DataWarrior has to be initiated manually, explicitly. Click with the right-hand button on the column's head to open a pull-down menu to select "Re-calculate". This causes DW to the reference field (here: the potentially updated structure) and populate the dependent field about the molecular weight with the newly calculated value if necessary. This is quite similar to the deployment of user defined columns (data -> add calculated values) which later equally cause this pull-down menu to feature a re-calculate of this very column (and if there multiple, an entry to re-calculate all columns at once, too).

The .gif attached illustrates this for the molecular weight of an empty structure, then of benzene, and naphthalene with DW 06.05.02 (published by September 2025).

Regards,
Norwid
Re: Suggestion: add molecular weight calculation for individual compound [message #2464 is a reply to message #2463] Fri, 30 January 2026 20:22 Go to previous messageGo to next message
nbehrnd is currently offline  nbehrnd
Messages: 240
Registered: June 2019
Senior Member
Hello Thomas

Based on Laurent's question about an explicit run to update values, I notice this does not affect _every_ value assigned by DW. As an example, while replacing benzene by triazene, for instance, I expected the "re-calculate every value, if necessary" equally would replace SMILES and InChI string, too -- which however is not the case. However, only the calculated molecular weight, and the user defined `molecular weight, rounded to two decimals) changed accordingly.

Best regards,
Norwid
Re: Suggestion: add molecular weight calculation for individual compound [message #2465 is a reply to message #2458] Fri, 06 February 2026 11:04 Go to previous messageGo to next message
Laurent is currently offline  Laurent
Messages: 3
Registered: January 2026
Junior Member
Hello Norwid,

Thank you very much for this clear explanation!

Regards,

Laurent
Re: Suggestion: add molecular weight calculation for individual compound [message #2471 is a reply to message #2465] Sun, 22 March 2026 11:45 Go to previous message
thomas is currently offline  thomas
Messages: 744
Registered: June 2014
Senior Member
Hello Laurent and Norvid,

I indeed see the usefulness of an automatic re-calculation of values, structures, descriptors, SMILES, etc. whenever an interactive change of a value or structure occurs that was used as input to a formula, descriptor calculation, SAR-table generation, docking, ...

That would, however, require to change the DataWarrior architecture and its file format substantially, because all operations that take table data as input to calculate something out of it, would need to be traced. The total history would need to be part of any dwar files. Merging and appending of files would break this mechanism. Some algorithms (e.g. chemical space visualisations) need to know and process the entire table before calculating the position of an individual compound. An interactive change of a structure could cause a cascade of potentially expensive re-calculations of order-dependent calculations, which still would fail in certain cases, e.g. if rows have been deleted. Thus, the complete solution is impossible.

Currently, there is an event mechanism that triggers recalculation of structure descriptors when a structure is changed. This could be extended to also trigger repeating some other simple 'from chemical structure' tasks like property calculations. This would already require extending the file format, because DataWarrior currently does not know, whether a numerical value column contains calculated compound properties nor which structure column was used to create it. I will look into this...

Thomas
Previous Topic: Viewing 3D confs with protein
Goto Forum:
  


Current Time: Sun Mar 22 13:54:19 CET 2026

Total time taken to generate the page: 0.00700 seconds