Re: [galaxy-dev] Inform tool interface with data specific to selected dataset

2014-05-09 Thread Dooley, Damion
Sure.  I'll try to be concise; approach was sketched out about a month ago on 
the board.   I'll be uploading our generalized reporting tool which can be an 
example of this once it has tests, but for now the bare bones:

Background: we wanted the ability to launch a Blast search of a number of fasta 
sequences, and then have the results displayed in an HTML form, by query and 
hits, and then allow a user to select hits for particular queries and have them 
show up in their own datasets, each ready to have a phylogenetic tree 
visualization pipeline of tools.  The reason an HTML form was called for is 
that one can then see for each hit various columns of information, that then 
allow you to make a decision about whether you want that hit or not in the next 
stage.  

So first we have a dataset containing choice information, say this combo of 
BLAST nucleotide sequence search and hit info. (search query row indicated by 
"1" in query column):

Accession IDpident  length  sequenceQuery   Row 
Assembly_67_BCC1-   -   AGGAC...TGCA1   1   

gi|158343637|gb|EU057648.1| 99.55   442 AGGAC...TGCA0   2
gi|158343987|gb|EU057686.1| 99.10   442 AGGAC...TGCA0   3
gi|158343677|gb|EU057652.1| 98.87   387 TGGAC...TGCA0   4 
...
Assembly_67_BCC8-   -   ATGG...CCC  1   5
...

Tool A: "Selection Form": takes in above info, provides an HTML report in which 
an HTML form provides the necessary input to Tool B.

Tool B: "Selection Tool": takes in same dataset as above, but generates output 
file that includes only selected rows of data (and only desired columns).  (The 
nice thing about Tool B is that it can be set up to work directly on the above 
dataset without needing to be fed by Tool A, its just that when called up 
directly, it only offers a selection list as provided by its own XML form spec.)


Tool A:
 
Starting in tool XML, we indicate a) input type of data to select in history, 
b) html output file where form is built, c) some useful ids related to the 
input data file (don't confuse id with hid or dataset_id!).  
"tool_input_dataset_file.id" is the one we need to pass to Tool B. 


...

my_python.py $tool_input_dataset_file $html_file 
$tool_input_dataset_file.hid:$tool_input_dataset_file.dataset_id:$tool_input_dataset_file.id
-f "
...

...

 
...
   

...



Tool A builds the html form.  The only trick here is that you have to load the 
Tool B form in galaxy, and view its frame's source code to see the right values 
for tool_id and tool_state (an initial tool_state value seems to work fine).  I 
use a dictionary lookup to store these, and combine with string replacement in 
a multi-line string for simple html templating.  Below is code slightly adapted 
for this writeup. 

in_file, out_html_file, selection_file_data = args
sel_file_fields = selection_file_data.split(':')

self.lookup = {
'timestamp': time.strftime('%Y/%m/%d'),
'tool_id': 'bccdcSelectSubset',
'tool_state':'800.71002e',
'select_row':0,
'dataset_selection_id': sel_file_fields[2]
}

form_html = """


Print











""" % self.lookup

with open(html_file, 'w') as fp_out:
fp_out.write(HTML_REPORT_HEADER_FILE)
fp_out.write(form_html)
...
And now write out all the table stuff for each row in input file with a 
checkbox selector:
with open(in_file) as f_in:
for line in f_in:
rowdata = line.split('\t')
self.lookup['select_row'] +=1
tdTags = ''
for (col, field) in 
enumerate(self.display_columns):
lookup['value'] = rowdata[col]

if (col == 0):
tdTags += '%(value)s' % 
self.lookup
else:
tdTags += '%(value)s' 
% self.lookup

fp_out.write("""\n\t\t\t%s""" % tdTags)
...

fp_out.write(HTML_REPORT_FOOTER_FILE)


Tool B:

To keep it simple this one just does a single output dataset but I can show a 

Re: [galaxy-dev] Inform tool interface with data specific to selected dataset

2014-05-09 Thread Igor Topcin
Hi Damion,
Would you mind sharing your approach with us all?
Thanks!
Igor
On May 9, 2014 1:51 PM, "Dooley, Damion"  wrote:

> Hello, Eric,
>
> If the dynamic filters approach doesn't work out I can send you an
> approach that worked for me.  It involves creating a tool-generated html
> report that contains a form which provides selection choices; and the form
> is set to submit to a 2nd tool of your choice tool (it contains the
> necessary fields to prime the tool).  Not sure if it works on every breed
> of galaxy out there though.
>
> d.
> ___
> 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/
>
> To search Galaxy mailing lists use the unified search at:
>   http://galaxyproject.org/search/mailinglists/
>
___
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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/

Re: [galaxy-dev] Inform tool interface with data specific to selected dataset

2014-05-09 Thread Dooley, Damion
Hello, Eric,

If the dynamic filters approach doesn't work out I can send you an approach 
that worked for me.  It involves creating a tool-generated html report that 
contains a form which provides selection choices; and the form is set to submit 
to a 2nd tool of your choice tool (it contains the necessary fields to prime 
the tool).  Not sure if it works on every breed of galaxy out there though.

d.
___
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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/


Re: [galaxy-dev] Inform tool interface with data specific to selected dataset

2014-05-09 Thread Eric Rasche
Hi Björn,

Brilliant, thank you. That should be exactly what I need. Good to know all of 
these dynamic options filters exist.

09.05.2014, 15:54, "Björn Grüning" :
> Hi Eric,
>
> the following should work, but is a real hack and not recommended, I think.
>
> https://galaxy-dist.readthedocs.org/en/latest/_modules/galaxy/tools/parameters/dynamic_options.html
>
> 
>  label  = "one input"
> format = "data"
> type   = "select"
> dynamic_options = "get_genomes_from_b($input_b)" />
>
> Hope that will work for you.
> Bjoern
>
> Am 09.05.2014 16:42, schrieb Eric Rasche:
>
>>  Howdy All,
>>
>>  I have a set of tools in two parts; the first part builds some databases and
>>  prepares some data structures, the second tool plots a subset of the data 
>> in the
>>  data structure. Specifically, the data in the structures are named genomes. 
>> The
>>  second tools needs to know which genomes, and I'd like to allow the user to 
>> be
>>  able to select from a list rather than typing in manually.
>>
>>  Essentially what I'd like to be able to do is create a set of options for an
>>   from the results of executing a perl/python script. Is
>>  there any way to do this as of now? (ugly hacks are OK as this is a private 
>> server)
>>
>>  --
>>  Eric Rasche
>>  Programmer II
>>  Center for Phage Technology
>>  Texas A&M University
>>  College Station, TX 77843
>>  404-692-2048 
>>  e...@tamu.edu 
>>
>>  ___
>>  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/
>>
>>  To search Galaxy mailing lists use the unified search at:
>> http://galaxyproject.org/search/mailinglists/

-- 
Eric Rasche
Programmer II
Center for Phage Technology
Texas A&M Univesity
College Station, TX 77843
Ph: 4046922048
___
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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/

Re: [galaxy-dev] Inform tool interface with data specific to selected dataset

2014-05-09 Thread Björn Grüning

Hi Eric,

the following should work, but is a real hack and not recommended, I think.

https://galaxy-dist.readthedocs.org/en/latest/_modules/galaxy/tools/parameters/dynamic_options.html




Hope that will work for you.
Bjoern


Am 09.05.2014 16:42, schrieb Eric Rasche:

Howdy All,

I have a set of tools in two parts; the first part builds some databases and
prepares some data structures, the second tool plots a subset of the data in the
data structure. Specifically, the data in the structures are named genomes. The
second tools needs to know which genomes, and I'd like to allow the user to be
able to select from a list rather than typing in manually.

Essentially what I'd like to be able to do is create a set of options for an
 from the results of executing a perl/python script. Is
there any way to do this as of now? (ugly hacks are OK as this is a private 
server)

--
Eric Rasche
Programmer II
Center for Phage Technology
Texas A&M University
College Station, TX 77843
404-692-2048 
e...@tamu.edu 



___
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/

To search Galaxy mailing lists use the unified search at:
   http://galaxyproject.org/search/mailinglists/


___
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/

To search Galaxy mailing lists use the unified search at:
 http://galaxyproject.org/search/mailinglists/


[galaxy-dev] Inform tool interface with data specific to selected dataset

2014-05-09 Thread Eric Rasche
Howdy All,  I have a set of tools in two parts; the first part builds some databases and prepares some data structures, the second tool plots a subset of the data in the data structure. Specifically, the data in the structures are named genomes. The second tools needs to know which genomes, and I'd like to allow the user to be able to select from a list rather than typing in manually.   Essentially what I'd like to be able to do is create a set of options for an  from the results of executing a perl/python script. Is there any way to do this as of now? (ugly hacks are OK as this is a private server) -- Eric Rasche Programmer II Center for Phage Technology Texas A&M University College Station, TX 77843 404-692-2048 e...@tamu.edu
___
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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/

Re: [galaxy-dev] Upload a file

2014-05-09 Thread Peter Cock
On Fri, May 9, 2014 at 12:46 PM,   wrote:
> Hi,
>
> I am a student who's trying to implement a simple galaxy tool. I am trying
> to provide the user with the option of uploading a file. I have copied code
> from another tool ...

The upload tool is special (and separate). Normally the user must
separately upload their file(s) or import them from a shared library
BEFORE trying to use any of the analysis tools.

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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/


[galaxy-dev] Upload a file

2014-05-09 Thread def87
Hi,

 

I am a student who's trying to implement a simple galaxy tool. I am trying to provide the user with the option of uploading a file. I have copied code from another tool:

 


    
    not ( ( isinstance( value, unicode ) or isinstance( value, str ) ) and value != "" ) 
  
  
  
    

 

 

If I just copy this, I get an error saying

KeyError: 'file_type'

+ some cryptic lines

 

I cannot find any documentation for these tags, is there any ? If not how can I find out how things work?

 

Regards,

Robert
___
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/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/

Re: [galaxy-dev] Taking backups of my galaxy instance

2014-05-09 Thread Hans-Rudolf Hotz

Hi Nilaksha

I don't really understand your question, but a simple answer is:

Make a backup of the complete galaxy directory tree and make a backup of 
your PostgreSQL database. You should do this anyway on a regularly 
basis, if you use your Galaxy server in production. Since much more 
likely, you will run into a storage failure, than experiencing "galaxy 
stop responding".


Regards, Hans-Rudolf


On 05/09/2014 06:52 AM, Nilaksha Neththikumara wrote:

Hi all,

I have installed and currently running a local galaxy instance
successfully, customized with desired tools and datasets but suddenly
got realized what would I do if anything goes wrong and galaxy stop
responding :O. Is there a specific way to take backups of a locally
installed galaxy instance with its own settings, so i can perform that
task regularly.
Thanks in advance :)

Sincerely,
Nilaksha.


___
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/

To search Galaxy mailing lists use the unified search at:
   http://galaxyproject.org/search/mailinglists/


___
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/

To search Galaxy mailing lists use the unified search at:
 http://galaxyproject.org/search/mailinglists/