Re: [galaxy-dev] Display column headers in data_column parameter

2011-05-26 Thread Peter Cock
On Thu, May 26, 2011 at 3:45 PM, Johannes Eichner
johannes.eich...@uni-tuebingen.de wrote:
 Hi Peter,

 I defined an additional metadata element for the column names
 analogously to the column_types element in the module
 galaxy_basedir/lib/galaxy/tools/datatypes/tabular.py:
 MetadataElement( name=column_names, default=[], desc=Column names,
 param=metadata.ColumnTypesParameter, readonly=True, visible=False,
 no_value=[] )

 Then I read the column names in the function set.meta and saved them
 in the new metadata element:
 dataset.metadata.column_names = column_names

Do you look for a tab separated # header line at the start of the file
for these names?

 Finally, I changed a line of code in the function get.column.list in
 galaxy_basedir/lib/galaxy/tools/parameters/basic.py, such that
 Galaxy displays the column names in the data_column parameter:
 original line: column_list.append( str( i + 1 ) )
 changed line: column_list.append( str( i + 1 ) + :  +
 dataset.metadata.column_names[i]) )

 Kind regards,
 Johannes

From a Python style point of view, I'd use string formatting here:

column_list.append(%i: %s % (i+1, dataset.metadata.column_names[i]))

Do you have a branch on bitbucket for this, or a patch? I'd like to try it.
You could attach a patch to issue 554:
https://bitbucket.org/galaxy/galaxy-central/issue/554

Thanks,

Peter
___
Please keep all replies on the list by using reply all
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

  http://lists.bx.psu.edu/


Re: [galaxy-dev] Display column headers in data_column parameter

2011-05-24 Thread Peter Cock
On Tue, May 24, 2011 at 3:12 PM, Johannes Eichner
johannes.eich...@uni-tuebingen.de wrote:
 Dear Galaxy-Dev Team,

 is it possible to display the headers of the columns which can be
 selected in a data_column parameter? Currently, only the column index
 (e.g., c1, c2, etc.) is displayed in Galaxy. If it would be possible to
 additionally display the column headers, the selection of the desired
 columns would be easier for the user. Is there a way to do this using
 the current version of Galaxy?

 Kind regards,
 Johannes

I completely agree that in general the UI for column parameter isn't
as user friendly as it could be. The filter data UI is even worse for
non-programmers, but due to its complexity and flexibility, that is
harder to improve too.

This was one of the things I wanted to bring up with the Galaxy team
at the conference (starting tonight). Unfortunately due to the Grimsvotn
Volcano's cloud of ash I won't be there.

In some cases yes, Galaxy knows the column meaning. In many of my
data files there is a # header line with tab separated column names,
which could be detected and shown.

Given there may or not be suitable column meta data, what I was
picturing was an expanded column picking dialogue that could show
the first few rows of data in each column (not using a simple HTML
widget anymore), or simply the first value (less drastic change).

So, rather than having as now something like: Pick column(s):
[ ] c1
[ ] c2
[ ] c3
[ ] c4
[ ] c5

If Galaxy has names in the column meta data you might have
Pick columns(s):
[ ] c1 - Identifier
[ ] c2 - Start
[ ] c3 - End
[ ] c4 - Strand
[ ] c5 - Sequence

Or, showing the first data entry: Pick columns(s):
[ ] c1, e.g. gi|12345678
[ ] c2, e.g. 123
[ ] c3, e.g. 456
[ ] c4, e.g. +
[ ] c4, e.g. ACGTACTGT...

In the final example I envision truncating very long values with
an ellipsis.

Both the above proposals don't require drastic changes to the
HTML widget and layout.

I guess we should file an enhancement issue on bitbucket:
https://bitbucket.org/galaxy/galaxy-central/issues/new

Peter
___
Please keep all replies on the list by using reply all
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:

  http://lists.bx.psu.edu/