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: 2
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: 2
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 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
Previous Topic: Round numbers by decimal places?
Goto Forum:
  


Current Time: Mon Feb 02 08:59:53 CET 2026

Total time taken to generate the page: 0.00674 seconds