openmolecules.org

 
Home » DataWarrior » Functionality » Suggest: select within cluster by property
Suggest: select within cluster by property [message #920] Fri, 29 May 2020 04:06 Go to next message
DrCJM is currently offline  DrCJM
Messages: 5
Registered: September 2019
Location: Australia
Junior Member
Something I'd find really useful, that I can't see how to do at present, is to select compounds after clustering by a particular property. The "representative" compound in a cluster is identified, I assume, as the most "central" compound in the cluster, which is fine. But sometimes I want to select the most active compound in the cluster, or the smallest MW in the cluster etc. etc.

If that's already possible, advice on how would be great!

Otherwise, a method of saying "Select from each cluster by value of property X" is something I'd use a lot.

Cheers,

Craig.
Re: Suggest: select within cluster by property [message #921 is a reply to message #920] Sat, 30 May 2020 17:19 Go to previous messageGo to next message
thomas is currently offline  thomas
Messages: 715
Registered: June 2014
Senior Member
Assuming you have cluster numbers in a column called 'Cluster No' and molecular weights in a column called 'Molweight', then you could use "Data->Add Calculated Values...", configure the dialog as follows:
index.php?t=getfile&id=202&private=0
This creates a new column with a '1' value for all cluster members that have the lowest molecular weight within their own cluster. All other rows have a '0' in that column. Note that the Molweight column should not be set to use logarithmic behaviour. I need to fix an issue there.

Thomas

[Updated on: Sat, 30 May 2020 17:22]

Report message to a moderator

Re: Suggest: select within cluster by property [message #932 is a reply to message #921] Mon, 01 June 2020 03:35 Go to previous messageGo to next message
DrCJM is currently offline  DrCJM
Messages: 5
Registered: September 2019
Location: Australia
Junior Member
Hi Thomas,

when I try that I get an error: Function "categoryMin" requires 3 parameters

I'll play around and see if I can figure out how to get it working, but any further advice would be great.

EDIT

OK, got it to work, it needed the category value defined, so format is:

categoryMin(ClusterNo,"Cluster No","Molweight")

which generates a new column with the lowest Molweight for the cluster added to every row (same value for all members of the cluster). With that, and my now finding the appropriate functions in the Help page Rolling Eyes I think I can do what I need to do.

Cheers,

Craig.

[Updated on: Mon, 01 June 2020 03:56]

Report message to a moderator

Re: Suggest: select within cluster by property [message #941 is a reply to message #932] Fri, 05 June 2020 16:34 Go to previous message
thomas is currently offline  thomas
Messages: 715
Registered: June 2014
Senior Member
Hi Craig,

sorry this slipped my attention. The category functions were simplified during recent months to only use two parameters. The official version 5.2.1 still uses the 3 parameter form. Under this link you always find about weekly releases of replacement files of the most recent development cycle: openmolecules/datawarrior/dw521win.zip (Windows) and dw521x.zip (Mac/Linux). The have many fixes, new features, but often not up-to-date manual pages. And new features are sometimes in experimental state.

Best wishes, Thomas
Previous Topic: Feature Request: Expand Column Headers
Next Topic: Feature request: Creating Row List
Goto Forum:
  


Current Time: Mon Nov 25 04:20:24 CET 2024

Total time taken to generate the page: 0.03501 seconds