Dear all, I have managed to use something like <outputs> <data format="fasta" name="output" label="#echo os.path.splitext (str ($input.name))[0]#-ORF.fasta"/> </outputs> to display the wanted label for the dataset in the history. However when I applied the same code to other tool wrappers, some weird things happened: the wrapper can still be loaded in the web page, but when I click the execute button to submit the job, nothing happened except the web browser giving the status "wait for localhost". I cannot think of any reason for that. The main difference I can think of between the successful wrapper and the failed ones is that in the failed ones I have to do some file manipulations as galaxy always stores its dataset with the file suffix .dat which is not acceptable in the tool, e.g. proteowizard. I have to rename it with the correct suffix and move the final result to the output file. Additional related questions: 1. How to display the selected value of a conditional element in the label? $conditional.value? 2. How to display different strings according to the conditional selection? Similar to command element to use #if #elsif #end if? 3. When using <data name="output" format="csv"> <change_format> <when input="type" value="html" format="html"/> </change_format> </data>, could I use label attribute in the data and when elements? Look forward to your kind answers. Many thanks in advance. Best regards! Jun
Hi Jun,
I have managed to use something like
<outputs>
<data format="fasta" name="output" label="#echo os.path.splitext (str ($input.name))[0]#-ORF.fasta"/>
</outputs> to display the wanted label for the dataset in the history.
However when I applied the same code to other tool wrappers, some weird things happened: the wrapper can still be loaded in the web page, but when I click the execute button to submit the job, nothing happened except the web browser giving the status “wait for localhost”.
I cannot think of any reason for that. The main difference I can think of between the successful wrapper and the failed ones is that in the failed ones I have to do some file manipulations as galaxy always stores its dataset with the file suffix .dat which is not acceptable in the tool, e.g. proteowizard. I have to rename it with the correct suffix and move the final result to the output file.
I do not think its related to your label attribute. Can you post you complete wrapper? For the file manipulation I usually use symlinks to $TEMP and use these symlink as input.
Additional related questions:
1. How to display the selected value of a conditional element in the label? $conditional.value?
Normally you have something like that in your condition, or? <conditional name="scaling"> <param name="type" type="select" label="Scaling/Normalization method" > .... You can access the value of param with $scaling.type
2. How to display different strings according to the conditional selection? Similar to command element to use #if #elsif #end if?
Not tested, but your example above uses cheetah for the splitext function, maybe you can try something like that: label="#if $scaling.type == 'no': print 'no' #else print 'yes'#"/>
3. When using <data name="output" format="csv"> <change_format> <when input="type" value="html" format="html"/> </change_format> </data>, could I use label attribute in the data and when elements?
No clue, but I don't think that is possible. Please keep in mind that the label should be easy to read and to remember, I'm not sure your approach to put in every single parameter is ideal. We had some discussion about that at the last GCC and we will work on some guidelines or better default lables in the future. http://wiki.galaxyproject.org/Events/GCC2013/BoF/ToolDevelopers Cheers, Bjoern
Look forward to your kind answers. Many thanks in advance.
Best regards!
Jun
___________________________________________________________ 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/
Hi Bjoern, Many thanks for your reply. Here is the wrapper: <tool id="proteowizard" name="Convert spectral file into mzML file" version="1.0.0"> <description>Convert non PSI standard mass spectral file into the PSI standard format mzML</description> <command interpreter="perl">$__root_dir__/../gio_applications/proteowizard/proteowizard.pl $input $type.input_type $output $output.id $__new_file_path__</command> <inputs> <conditional name="type"> <param name="input_type" type="select" label="Input Type"> <option value="mgf">mgf</option> <option value="mzxml">mzXML</option> <option value="ms2">ms2</option> </param> <when value="mgf"> <param format="mgf" name="input" type="data" label="Input mgf"/> </when> <when value="mzxml"> <param format="mzxml" name="input" type="data" label="Input mzXML"/> </when> <when value="ms2"> <param format="ms2" name="input" type="data" label="Input ms2"/> </when> </conditional> </inputs> <outputs> <data name="output" format="mzml"/> </outputs> </tool> and the corresponding perl script: #!/usr/bin/perl -w use strict; my $input = $ARGV[0]; my $type = $ARGV[1]; my $output = $ARGV[2]; my $id = $ARGV[3]; my $path = $ARGV[4]; system("cp $input /$path/tmp_$id.$type"); #copy the input file to the temp folder and rename it to a temp file using the job id to be unique system("/$path/../../../gio_applications/proteowizard/msconvert /$path/tmp_$id.$type --outfile tmp_$id.mzML -o $path"); #do the conversion and keeps the result file in the temp folder system("mv /$path/tmp_$id.mzML $output"); #move the result file from the temp folder to the galaxy system("rm /$path/tmp_$id.$type"); #delete the temp file Best regards! Jun -----Original Message----- From: Bjoern Gruening [mailto:bjoern.gruening@gmail.com] Sent: 14 August 2013 08:29 To: Jun Fan Cc: galaxy-dev@lists.bx.psu.edu Subject: Re: [galaxy-dev] outputs label attribute Hi Jun,
I have managed to use something like
<outputs>
<data format="fasta" name="output" label="#echo os.path.splitext (str ($input.name))[0]#-ORF.fasta"/>
</outputs> to display the wanted label for the dataset in the history.
However when I applied the same code to other tool wrappers, some weird things happened: the wrapper can still be loaded in the web page, but when I click the execute button to submit the job, nothing happened except the web browser giving the status “wait for localhost”.
I cannot think of any reason for that. The main difference I can think of between the successful wrapper and the failed ones is that in the failed ones I have to do some file manipulations as galaxy always stores its dataset with the file suffix .dat which is not acceptable in the tool, e.g. proteowizard. I have to rename it with the correct suffix and move the final result to the output file.
I do not think its related to your label attribute. Can you post you complete wrapper? For the file manipulation I usually use symlinks to $TEMP and use these symlink as input.
Additional related questions:
1. How to display the selected value of a conditional element in the label? $conditional.value?
Normally you have something like that in your condition, or? <conditional name="scaling"> <param name="type" type="select" label="Scaling/Normalization method" > .... You can access the value of param with $scaling.type
2. How to display different strings according to the conditional selection? Similar to command element to use #if #elsif #end if?
Not tested, but your example above uses cheetah for the splitext function, maybe you can try something like that: label="#if $scaling.type == 'no': print 'no' #else print 'yes'#"/>
3. When using <data name="output" format="csv"> <change_format> <when input="type" value="html" format="html"/> </change_format> </data>, could I use label attribute in the data and when elements?
No clue, but I don't think that is possible. Please keep in mind that the label should be easy to read and to remember, I'm not sure your approach to put in every single parameter is ideal. We had some discussion about that at the last GCC and we will work on some guidelines or better default lables in the future. http://wiki.galaxyproject.org/Events/GCC2013/BoF/ToolDevelopers Cheers, Bjoern
Look forward to your kind answers. Many thanks in advance.
Best regards!
Jun
___________________________________________________________ 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/
Hi Jun, please have a look at https://github.com/bgruening/galaxytools/blob/master/chemicaltoolbox/simsear... the else clause will create some symlinks you can use directly with msconvert. For debugging purpose just add msconvert at first to your PATH and avoid the $__root_dir__/ hack. Later there are better approaches to do so. Also pleaes note that msconvert is already in the toolshed: http://toolshed.g2.bx.psu.edu/view/galaxyp/msconvert There is an entire project called galaxyp (https://bitbucket.org/galaxyp) driven by John Chilton and Ira Cooke. Cheers, Bjoern
Hi Bjoern,
Many thanks for your reply. Here is the wrapper: <tool id="proteowizard" name="Convert spectral file into mzML file" version="1.0.0"> <description>Convert non PSI standard mass spectral file into the PSI standard format mzML</description> <command interpreter="perl">$__root_dir__/../gio_applications/proteowizard/proteowizard.pl $input $type.input_type $output $output.id $__new_file_path__</command> <inputs> <conditional name="type"> <param name="input_type" type="select" label="Input Type"> <option value="mgf">mgf</option> <option value="mzxml">mzXML</option> <option value="ms2">ms2</option> </param> <when value="mgf"> <param format="mgf" name="input" type="data" label="Input mgf"/> </when> <when value="mzxml"> <param format="mzxml" name="input" type="data" label="Input mzXML"/> </when> <when value="ms2"> <param format="ms2" name="input" type="data" label="Input ms2"/> </when> </conditional> </inputs> <outputs> <data name="output" format="mzml"/> </outputs> </tool> and the corresponding perl script: #!/usr/bin/perl -w use strict;
my $input = $ARGV[0]; my $type = $ARGV[1]; my $output = $ARGV[2]; my $id = $ARGV[3]; my $path = $ARGV[4];
system("cp $input /$path/tmp_$id.$type"); #copy the input file to the temp folder and rename it to a temp file using the job id to be unique system("/$path/../../../gio_applications/proteowizard/msconvert /$path/tmp_$id.$type --outfile tmp_$id.mzML -o $path"); #do the conversion and keeps the result file in the temp folder system("mv /$path/tmp_$id.mzML $output"); #move the result file from the temp folder to the galaxy system("rm /$path/tmp_$id.$type"); #delete the temp file
Best regards! Jun
-----Original Message----- From: Bjoern Gruening [mailto:bjoern.gruening@gmail.com] Sent: 14 August 2013 08:29 To: Jun Fan Cc: galaxy-dev@lists.bx.psu.edu Subject: Re: [galaxy-dev] outputs label attribute
Hi Jun,
I have managed to use something like
<outputs>
<data format="fasta" name="output" label="#echo os.path.splitext (str ($input.name))[0]#-ORF.fasta"/>
</outputs> to display the wanted label for the dataset in the history.
However when I applied the same code to other tool wrappers, some weird things happened: the wrapper can still be loaded in the web page, but when I click the execute button to submit the job, nothing happened except the web browser giving the status “wait for localhost”.
I cannot think of any reason for that. The main difference I can think of between the successful wrapper and the failed ones is that in the failed ones I have to do some file manipulations as galaxy always stores its dataset with the file suffix .dat which is not acceptable in the tool, e.g. proteowizard. I have to rename it with the correct suffix and move the final result to the output file.
I do not think its related to your label attribute. Can you post you complete wrapper? For the file manipulation I usually use symlinks to $TEMP and use these symlink as input.
Additional related questions:
1. How to display the selected value of a conditional element in the label? $conditional.value?
Normally you have something like that in your condition, or?
<conditional name="scaling"> <param name="type" type="select" label="Scaling/Normalization method" > ....
You can access the value of param with $scaling.type
2. How to display different strings according to the conditional selection? Similar to command element to use #if #elsif #end if?
Not tested, but your example above uses cheetah for the splitext function, maybe you can try something like that:
label="#if $scaling.type == 'no': print 'no' #else print 'yes'#"/>
3. When using <data name="output" format="csv"> <change_format> <when input="type" value="html" format="html"/> </change_format> </data>, could I use label attribute in the data and when elements?
No clue, but I don't think that is possible.
Please keep in mind that the label should be easy to read and to remember, I'm not sure your approach to put in every single parameter is ideal. We had some discussion about that at the last GCC and we will work on some guidelines or better default lables in the future.
http://wiki.galaxyproject.org/Events/GCC2013/BoF/ToolDevelopers
Cheers, Bjoern
Look forward to your kind answers. Many thanks in advance.
Best regards!
Jun
___________________________________________________________ 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/
participants (2)
-
Bjoern Gruening
-
Jun Fan