Re: [galaxy-dev] Conditionally showing certain form elements on tool page
On 08/15/2012 08:59 PM, Dan Tenenbaum wrote: Hi all, I'm trying to wrap my head around what the conditional tag does...it looks like it doesn't do what I would like. I want to create a tool that allows the user to upload a data file and then have it run through one or more filters. Each filter takes one or more parameters. I was thinking I could do something like this: inputs conditional name=mycond param name=checktest type=boolean label=foo value=yessir /param when value=yessir param name=param1 type=text label=bar value=twunk /param /when /conditional /inputs The idea being, if the user checks the box labeled foo, a text box labeled bar will appear. And I would have several such checkboxes and their accompanying parameters. But what I get is just the checkbox, and nothing happens when I click it. Is it possible to do what I have in mind, and if so, how? Also note that these conditions are not mutually exclusive. A user can select one *or more* filters. So I'm not sure how the body of my command tag should look. Is there a way I can just pass every possible parameter to my script like this: myscript.py param1=foo param2=bar If a parameter is not defined (because the user didn't click its associated checkbox), then the script will receive e.g. param1= param2=bar but it can deal with that. I realize I can make several tools and chain them together in a workflow, but that seems like overkill for this use case, and it would be nice if the user could set up their desired filters on one screen. Is this possible? Thanks! Dan ___ 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/ Hello Dan, The easiest way to go about this, since you said that none of your filters are mutually exclusive, is to use the select datatype. I don't think you even need the conditional tags. Galaxy says that you need when tag sets when you use conditionals, but this is not true, as I have similar code as I have written below. Use type=select in your parameter. This gives you a button that can have a multitude of options, but most of mine are simply used like booleans. Something like this: inputs param name=param1 type=select label=filterName help=helpful tips option value=yesyes/option option value=nono/option /param param name=param2 type=select label=filter2Name help=more helpful tips option value=yesyes/option option value=nono/option /param /inputs I had certain options that WERE mutually exclusive, and required nested conditional statements, where I had an outer conditional for the extra options, and an inner conditional around each parameter. As for the command tag, the select type parameters make it easy because you can just check the string values with an if statement, like so: (assuming python) command interpreter=python tool.py #if $param1 == yes: --YourGetOptFlag #else: ##dont even need an else, just ignore #end if /command If I am not mistaken, this should be sufficient if all you need to pass is a flag indicating your program to use the filter. If you need to pass a flag AND integer values, you are going to have to wrap your parameters in conditional tags and use a set of when: inputs conditional name=firstConditional param name=param1 type=select label=filterName help=helpful tips option value=yesyes/option option value=nono/option /param when value=yes param name=IntegerBox type=integer value=[default value] min=(optional) max=(optional) label=UseParamName help=helpful text / /when when value=no / !--Doesnt show integer text box when no is chosen in the select-- /conditional /inputs Rinse and repeat, adding conditionals around each select. I think this is actually what you want to do, as you say you want a box to appear after a user selects whether or not to use the filter. Also, quick note, the text between the option tags are what appear on the select buttons, so they can be whatever you want. The value= is the important thing, as this is what you will evaluate the if/else to in the command tag. One last thing, The cheetah command is really no different. command interpreter=python tool.py #if $firstConditional.param1 == yes: --testGetOpt $firstConditional.IntegerBox #end if /command The second command tag is how I pass a few parameters into my command line tool. Anyway, I hope this helped a little bit. If you need anything else, let me know and I will see If I can help. A lot of this was trial and error and I am sure there are trickier ways to doing it, but this worked for the scope of my program. -John
Re: [galaxy-dev] code example for improved error handling
On 08/16/2012 03:02 PM, Birgit Crain wrote: Hi I'm writing a tools for an executable that writes results to stdout and reports success message to stderr, so it really need the improved error handling. Is there any sample code or documentation available? Thanks *Birgit Crain, Ph.D.*| Sr. Professional Services Scientist | Complete Genomics, Inc. (650) 428-6023 office | (408) 605-3938 mobile bcr...@completegenomics.com mailto:bcr...@completegenomics.com From: Nicole Rockweiler n.rockwei...@gmail.com mailto:n.rockwei...@gmail.com Date: Friday, July 20, 2012 10:53 AM To: Brian Haas bh...@broadinstitute.org mailto:bh...@broadinstitute.org Cc: galaxy-...@bx.psu.edu mailto:galaxy-...@bx.psu.edu galaxy-...@bx.psu.edu mailto:galaxy-...@bx.psu.edu Subject: Re: [galaxy-dev] pipeline execution succeeds but galaxy shows failure Hi Brian, A couple of days ago, smcmanus https://bitbucket.org/smcmanus pushed the following change to the repo: Tools can now specify their own handling of stderr and stdout regular expressions as well as exit code ranges. https://bitbucket.org/galaxy/galaxy-central/issue/325/allow-tool-authors-to-decide-whether-to-use-return-codes-or-stderr-for-detecting-job It looks like the documentation has yet to be written. Hope this helps, Nicole On Fri, Jul 20, 2012 at 12:46 PM, Brad Chapman chapm...@50mail.com mailto:chapm...@50mail.com wrote: Brian; I wrote a pipeline (xml attached) that, from what I can gather, succeeds, but galaxy shows it as an error and doesn't make the output file accessible as a new data set. Is it possible the software is writing to standard error? Galaxy doesn't check status codes, but rather check for stderr and assumes that output indicates a problem. You can wrap the problematic programs with a little script to eat up stderr and check that everything is okay: http://wiki.g2.bx.psu.edu/Future/Job%20Failure%20When%20stderr Brad From the server log, I can see that the command line is being constructed correctly, and it even indicates that it's captured the output, but in the display of the web browser, it just shows up in the error state. The script being run exits (0) on success. Any ideas? Here's what the output section of my xml file looks like: outputs data format=bam name=coordSortedBam label=${tool.name http://tool.name} on ${on_string}: coord-sorted read alignments from_work_dir=alignment/alignment.coordSorted.bam/ /outputs and here's what the server log states: galaxy.jobs.handler INFO 2012-07-20 09:52:05,240 (30) Job dispatched galaxy.jobs.runners.local DEBUG 2012-07-20 09:52:05,453 executing: alignReads.pl --target /Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/files/000/dataset_26.dat -o alignment --aligner bowtie --single /Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/files/000/dataset_23.dat --seqType fq galaxy.jobs http://galaxy.jobs DEBUG 2012-07-20 09:52:16,673 finish(): Moved /Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/job_working_directory/000/30/alignment/alignment.coordSorted.bam to /Users/bhaas/BioIfx/Galaxy/galaxy-dist/database/files/000/dataset_50.dat as directed by from_work_dir Again, as far as I can tell, everything worked - but the browser doesn't think so. I've run the exact command above on the command-line, and it exits(0) indicating success. Also, I've verified that when run through my galaxy instance, the galaxy-relocated output file is as expected. Many thanks for your help. I'm still getting my feet wet with galaxy, reading through all the documentation and searching the mailing list for additional help. best regards, -brian -- -- Brian J. Haas Manager, Genome Annotation and Analysis, Research and Development The Broad Institute http://broad.mit.edu/~bhaas http://broad.mit.edu/%7Ebhaas tool id=alignreads name=alignReads version=0.0.1 descriptionalignReads: short read alignment tool wrapper/description requirements requirement type=packagetrinity/requirement /requirements command alignReads.pl --target $target -o alignment --aligner $aligner_selection.aligner ## Inputs. #if str($inputs.paired_or_single) == paired: --left $inputs.left_input --right $inputs.right_input #if $inputs.left_input.ext == 'fa': --seqType fa #else: --seqType fq #end if #if str($inputs.library_type) != None: --SS_lib_type $inputs.library_type #end if
Re: [galaxy-dev] Conditionally showing certain form elements on tool page
On 08/15/2012 08:59 PM, Dan Tenenbaum wrote: Hi all, I'm trying to wrap my head around what the conditional tag does...it looks like it doesn't do what I would like. I want to create a tool that allows the user to upload a data file and then have it run through one or more filters. Each filter takes one or more parameters. I was thinking I could do something like this: inputs conditional name=mycond param name=checktest type=boolean label=foo value=yessir /param when value=yessir param name=param1 type=text label=bar value=twunk /param /when /conditional /inputs The idea being, if the user checks the box labeled foo, a text box labeled bar will appear. And I would have several such checkboxes and their accompanying parameters. But what I get is just the checkbox, and nothing happens when I click it. Is it possible to do what I have in mind, and if so, how? Also note that these conditions are not mutually exclusive. A user can select one *or more* filters. So I'm not sure how the body of my command tag should look. Is there a way I can just pass every possible parameter to my script like this: myscript.py param1=foo param2=bar If a parameter is not defined (because the user didn't click its associated checkbox), then the script will receive e.g. param1= param2=bar but it can deal with that. I realize I can make several tools and chain them together in a workflow, but that seems like overkill for this use case, and it would be nice if the user could set up their desired filters on one screen. Is this possible? Thanks! Dan ___ 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/ Hello Dan, This page really helped me understand how the tags worked as well as looking at some older tools: http://wiki.g2.bx.psu.edu/Admin/Tools/Tool%20Config%20Syntax I will take a look at my tool when I get to the office tomorrow. John ___ 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/
[galaxy-dev] Multi-level conditional output files
Hello! The wiki entry on dealing with the filter tags is wonderful, but I seem to hit its limitations, unless someone has experience with multi-level conditionals in the input. For example in my XML, conditional name=Build_Settings param name=SettingsType type=select label=Settings to use option value=preSetUse Defaults/option option value=fullFull parameter list/option /param when value=preSet / when value=full conditional name=Bam param name=Bam_Output type=select label=Bam Output option value=noNo/option option value=yesYes/option /param /conditional /when /conditional The bam conditional sets an argument in my program to generate bam instead of sam (default) which is the reason for the conditional. There are two cases for sam output, when the option is preset, or when full parametersbam_output == no. for this reason It wouldnt work to filter this on the bam_output boolean because it would evaluate to false if preset was chosen. I cannot do a simple change format for the same reason. Do the filter tags only support one boolean check? How would I actually get past the settings parameter and into the bam_output parameter? ___ 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/
[galaxy-dev] Galaxy output not showing on tool success, indicating job failure.
Hello. I am an undergraduate working on a tool very similar to Tophat. My question is probably very basic, but I am having issues displaying the output. I am assuming is giving me the failed run boxes, even though my tool completes execution and generates its files. Note that I am not working on a cluster, as I am simply trying out galaxy with this tool. I have modified universe_wsgi.ini cleanup_job = onsuccess to keep the output from being deleted due to the failure. Every file that is queued up in the history pane for each run appears in the working directory after execution, and I confirm successful runs with stdout and logs. If you click on the boxes in the history pane, you can download the output files correctly. I just cannot see previews of them or see them in the middle screen. output in my tool XML is specified as follows: data format=sam name=alignments label=${tool.name} on ${on_string}: alignments from_work_dir=mapsplice_out/alignments.sam / where mapsplice out is a sub directory created to contain all output of my command line tool. The reason I have it contained is because it runs its own combine and clean-up jobs before it is done executing, and you are left with logs. If you do not specify 'from_work_dir' in the output, the output files are there, but if you do specify, galaxy seems to be moving them into the database. stderr prints: (also I am aware stderr causes galaxy failures, I have nothing printing to stderr) /home//galaxy-dist/database/files/000/dataset_387.dat is fasta format which suggests to me that galaxy is trying to copy the contents of the output files into this particular file which is not what needs to happen. If I do not include the optional from_work_dir in the data tag I am not able to download the files that are created. On the wiki, the output tag set says that You specify the number and type of your output files using the containeddatatags. You must pass them to your tool executable through using line variables just like the parameters described in the previous sections. For this, I have created variables to hold the output and pass them in the command string, but my tool takes no parameters to specify output. It simply creates various output files based on the parameters passed in. However it still runs regardless. The preview I get after execution is the print to stdout (exact copy of the log) that indicate a successful run. I apologize for the length, I am just trying to give most the helpful information. If more is needed, let me know. I am running my own instance of galaxy. John P - Undergraduate Research University of Kentucky Bioniformatics ___ 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/