openmolecules.org

 
Home » DataWarrior » Cheminformatics » Use of calculated column functions
Use of calculated column functions [message #814] Wed, 11 March 2020 11:09 Go to next message
sansun is currently offline  sansun
Messages: 45
Registered: April 2019
Member
I have a file with the bioactivity column for several molecules.

I want to create a new column so that molecules with IC50 less than value 'x' are annotated as '1' while those with more than 'y' value labelled as '0'.

I understand that it can be done bey 'Calculated column' but I am not able to figure out the exact formula.
Any help is appreciated.
Re: Use of calculated column functions [message #815 is a reply to message #814] Wed, 11 March 2020 22:25 Go to previous messageGo to next message
nbehrnd is currently offline  nbehrnd
Messages: 204
Registered: June 2019
Senior Member
To showcase this function with a minimal working example (attached below), I set up
a new file with benzene, toluene, and the xylenes in the first column, and their then
molecular masses calculated by DW in the second column. Subsequently, a third column
was generated (Data -> Add Calculated Values). Instead of an IC50 value, the MW was
used as threshold criterion -- available from the pull-down menu next to «Add Variable»
-- which was combined into
(TotalMolweight < 80) == 1
as test condition.

index.php?t=getfile&id=160&private=0

Page http://www.openmolecules.org/help/jep.html offers additional insight about the
functions and syntax available.

[Updated on: Wed, 11 March 2020 22:35]

Report message to a moderator

Re: Use of calculated column functions [message #816 is a reply to message #815] Thu, 12 March 2020 11:43 Go to previous messageGo to next message
sansun is currently offline  sansun
Messages: 45
Registered: April 2019
Member
Thanks a lot.

However, with your example molecules with Mwt = 80 are labelled as 0 but all others are labelled as 1.

My problem is slightly different. For example, I want '1' only for the molecules with Mwt > 100.

I don't want any value (or want some distinct value e.g. '3'Wink for molecules with Mwt between 80-100.

I am trying to find other ways. Let me know if you get some idea.

Thanks again!
Re: Use of calculated column functions [message #817 is a reply to message #816] Thu, 12 March 2020 22:03 Go to previous messageGo to next message
nbehrnd is currently offline  nbehrnd
Messages: 204
Registered: June 2019
Senior Member
Your observation is true because I understood your question as aiming for a (Boolean) on/off or True / False categorical two-level criterion. Please clarify if this was misunderstood by mine.

So far, I did not mind that instead categorical "1" and "0" strings the calculated column reads like floating numbers "1.0", and "0.0" instead and seems to be limited to two levels. To label molecules of molecular weight greater than 100, the computation would be adjusted to (TotalMolweight > 100 ) == 1. If searching for molecules with a molecular weight either below 80 .OR. greater 100, a plausible instruction were (TotalMolweight > 100 || TotalMolweight < 80) == 1; and the toluene molecule as an example for the range of 80 < MW < 100 is identified by (TotalMolweight > 80 && TotalMolweight < 100) == 1.

I see that attributing a string as a result of such a computation may be useful, or to extend the Boolean two-level perspective for, e.g. annotating members of a compound list as basic / neuter / acidic. Even more so as such an attribution by Add Calculated Values may consider multiple criteria from multiple columns at once. For both however, I do not know if DW contains such a functionality.
Re: Use of calculated column functions [message #819 is a reply to message #817] Wed, 18 March 2020 19:19 Go to previous messageGo to next message
thomas is currently offline  thomas
Messages: 646
Registered: June 2014
Senior Member
This assigns molweights into three different string categories:

if(Molweight<200, "low", if(Molweight>400, "high",""))

[Updated on: Wed, 18 March 2020 19:19]

Report message to a moderator

Re: Use of calculated column functions [message #891 is a reply to message #819] Sun, 10 May 2020 06:00 Go to previous message
sansun is currently offline  sansun
Messages: 45
Registered: April 2019
Member
nbehrnd and Thomas, thanks a lot for your useful replies.
Previous Topic: SureChEMBL
Next Topic: Suggested addition: mirror access to Tautobase.dwar
Goto Forum:
  


Current Time: Thu Mar 28 14:45:37 CET 2024

Total time taken to generate the page: 0.08288 seconds