openmolecules.org

 
Home » DataWarrior » Cheminformatics » can you give an example on how to use refvalue()...
can you give an example on how to use refvalue()... [message #67] Tue, 30 June 2015 16:40 Go to next message
chemist69 is currently offline  chemist69
Messages: 7
Registered: June 2015
Location: Germany
Junior Member
...in order to be able to create tree-like structures?
Many thanks in advance.


If you're not part of the solution - you're part of the precipitate.
Re: can you give an example on how to use refvalue()... [message #68 is a reply to message #67] Wed, 01 July 2015 21:43 Go to previous messageGo to next message
thomas is currently offline  thomas
Messages: 715
Registered: June 2014
Senior Member
could you please a little more specific with the question. I realize also that my description of the refvalue()
function is not really clear. I try again:
If a dataset has three columns:
'A' with some category assignments (e.g. and experiment date)
'B' with row specific IDs that are unique within every category, but repeat throughout the categories (e.g. compound IDs)
'C' any values, e.g. measured numerical values
If one compound with ID xxxx serves as a reference compound in all experiments and if we wanted to use its
measured value as a reference value to be used for all compounds in the same experiment, then we use the refvalue()
function.

I this what you had in mind?

Kind regards, Thomas
Re: can you give an example on how to use refvalue()... [message #69 is a reply to message #68] Thu, 02 July 2015 09:07 Go to previous messageGo to next message
chemist69 is currently offline  chemist69
Messages: 7
Registered: June 2015
Location: Germany
Junior Member
Dear Thomas,

thanks a lot for coming back to me, DataWarrior is a great project!
refvalue takes four parameters. In the example that you give above, what would be the call to the function?

My concrete case involves a set of compounds which are categorized into scaffold fragments. Every compound belongs only to one fragment and the fragments are uniquely named and hierarchically dependent on each other:
Hierarchy    scaf_smiles    cpd_smiles    cpd_id    Activity
12    C1CC=CN1    Cc1cc[nH]c1    1    5
12    C1CC=CN1    O=C(O)c1cc[nH]c1    2    7
012_013    c1ccc2[nH]ccc2c1    O=C(O)c1c[nH]c2ccccc12    3    6
012_013    c1ccc2[nH]ccc2c1    NC(=O)c1c[nH]c2ccccc12    4    8
012_013    c1ccc2[nH]ccc2c1    COc2ccc1[nH]cc(C(N)=O)c1c2    5    9

I would like to display the data in a tree-like way so that the scaffold fragments (column Hierarchy) are displayed as nodes and the individual compounds are leaves in the tree.
Would that be possible?

Many thanks again for your help!

Kind regards,
Axel


If you're not part of the solution - you're part of the precipitate.
Re: can you give an example on how to use refvalue()... [message #70 is a reply to message #69] Thu, 02 July 2015 21:56 Go to previous messageGo to next message
thomas is currently offline  thomas
Messages: 715
Registered: June 2014
Senior Member
Dear Axel,

the refvalue(ref-ID-column, category-column, value-column, ref-ID) syntax would be:
refvalue("B","A","C","xxxx")

Your second question is more difficult to answer: DataWarrior out-of-the-box doesn't have a simple solution.
But with a little programming it should be possible to even generate such a tree of hierarchical increasing
scaffolds contained in a dataset and to attach all compounds as leaves.

Currently, DataWarrior does support graph data, which includes tree structures. Various functions generate
such data, e.g. the evolutionary library and most prominent the similarity analysis. Last week I used an
unpublished and still experimental extention to layout a graph from a few thousand diseases connected over
their similarites, which were estimated by commonly mentioned genes in the literature.
But DataWarrior does not allow from the user interface to define a column to contain references to other rows.
If you want to construct a dwar file from tabular data in a way that DataWarrior recognized graph
relationsships, then you have to do it manually. First you need a column with unique row identifiers.
Second you need another column that contains references of the respective row to one or more other rows.
This is done by putting uniwue IDs from the first row into the second one, one ID per reference, delimited
by "; ". Third you need to define the second row as 'referencing column' and state whether references are
bi-directional or only one way. This is done by adding column properties to the file; Example:
<columnName="child">
<columnProperty="refColumn ID">
<columnProperty="refType topdown">

I have created a small dwar file from your example that illustrates the options. The file contains
three different tree views: one with static coordinates of all structures and two dynamic one, which
always use the selected molecule as root, both use a kind of forcefield approach for the layout
(circular and standard vertical tree)

Kind regards,

Thomas
Re: can you give an example on how to use refvalue()... [message #71 is a reply to message #70] Mon, 06 July 2015 14:22 Go to previous message
chemist69 is currently offline  chemist69
Messages: 7
Registered: June 2015
Location: Germany
Junior Member
Dear Thomas,

thanks a lot for the extensive answer and the work you put into creating the extremely helpful example!!
This is exactly what I was looking for!

Kind regards,
Axel


If you're not part of the solution - you're part of the precipitate.
Next Topic: Show multiple values as...
Goto Forum:
  


Current Time: Thu Nov 21 18:39:44 CET 2024

Total time taken to generate the page: 0.03308 seconds