Components

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Components

Mariette
Hi everyone,

I'm new in galaxy and I want to create a component, so I have multiple
questions.
The component executes a script which takes different formats :
fasta|fastq|sff. As output it takes a folder, to do so I used the
extra_files_path attribute of an output data
(--out='$output.extra_files_path'). The result file is stored in this
folder with the log file and should be in the same format as the input one.
I wrote the xml file and it works just fine, however as it's a folder
there is no way to use the result file(s) for further analysis. How can
I manage this ?
Also it can happen that there is more than 1 file outputted, how can I
manage multiple outputs ?

An other question about the input format, I have an option to the script
to specify the format. I saw there is auto-format detection routines in
galaxy, there is a way so I can call them to automatically complete this
option ?

thx,
Jerome
___________________________________________________________
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/
Reply | Threaded
Open this post in threaded view
|

Re: Components

Peter Cock
On Mon, Jun 6, 2011 at 2:45 PM, Mariette <[hidden email]> wrote:

> Hi everyone,
>
> I'm new in galaxy and I want to create a component, so I have multiple
> questions.
> The component executes a script which takes different formats :
> fasta|fastq|sff. As output it takes a folder, to do so I used the
> extra_files_path attribute of an output data
> (--out='$output.extra_files_path'). The result file is stored in this folder
> with the log file and should be in the same format as the input one.
> I wrote the xml file and it works just fine, however as it's a folder there
> is no way to use the result file(s) for further analysis. How can I manage
> this ?

I use a wrapper script which moves the output file from the sub-directory
to the location Galaxy requested.

Regarding the file format, if you only have one input file you can use
format="input", otherwise use the change_format tag in the XML.

> Also it can happen that there is more than 1 file outputted, how can I
> manage multiple outputs ?
>
> An other question about the input format, I have an option to the script to
> specify the format. I saw there is auto-format detection routines in galaxy,
> there is a way so I can call them to automatically complete this option ?

Normally the wrapper specifies the output format explicitly.

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/
Reply | Threaded
Open this post in threaded view
|

Re: Components

Mariette

Thanks for the answer,

so I tryed to write a wrapper, but the main script is not recognize.
When I'm calling my wrapper in the xml file, I don't have to specify
the full path but then from my wrapper if I want to call my main script
I can't if this one is not on the PATH ? the wrapper current directory
is the job_working_directory, there is anyway to access my main script
just like it's done for the wrapper ?

thanks for your answer,
Jerome





Peter Cock a écrit :

> On Mon, Jun 6, 2011 at 2:45 PM, Mariette <[hidden email]> wrote:
>  
>> Hi everyone,
>>
>> I'm new in galaxy and I want to create a component, so I have multiple
>> questions.
>> The component executes a script which takes different formats :
>> fasta|fastq|sff. As output it takes a folder, to do so I used the
>> extra_files_path attribute of an output data
>> (--out='$output.extra_files_path'). The result file is stored in this folder
>> with the log file and should be in the same format as the input one.
>> I wrote the xml file and it works just fine, however as it's a folder there
>> is no way to use the result file(s) for further analysis. How can I manage
>> this ?
>>    
>
> I use a wrapper script which moves the output file from the sub-directory
> to the location Galaxy requested.
>
> Regarding the file format, if you only have one input file you can use
> format="input", otherwise use the change_format tag in the XML.
>
>  
>> Also it can happen that there is more than 1 file outputted, how can I
>> manage multiple outputs ?
>>
>> An other question about the input format, I have an option to the script to
>> specify the format. I saw there is auto-format detection routines in galaxy,
>> there is a way so I can call them to automatically complete this option ?
>>    
>
> Normally the wrapper specifies the output format explicitly.
>
> 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/
>  

___________________________________________________________
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/
Reply | Threaded
Open this post in threaded view
|

Re: Components

Peter Cock
On Tue, Jun 7, 2011 at 9:24 AM, Mariette <[hidden email]> wrote:
>
> Thanks for the answer,
>
> so I tryed to write a wrapper, but the main script is not recognize.
> When I'm calling my wrapper in the xml file, I don't have to specify
> the full path but then from my wrapper if I want to call my main script
> I can't if this one is not on the PATH ? the wrapper current directory
> is the job_working_directory, there is anyway to access my main script
> just like it's done for the wrapper ?

Generally put the wrapper script next to your tool XML file, and don't
prefix it with any path in the <command> tag in the XML, e.g.

/opt/galaxy/tools/mariette/my_tool.xml
/opt/galaxy/tools/mariette/my_tool.sh

(or my_tool.py or my_tool.pl etc depending on what language you used)

Your wrapper script then has to call the real executable, and the
normal way to do this on Unix is to have it on the PATH. You could
also hard code an absolute path.

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/
Reply | Threaded
Open this post in threaded view
|

Re: Components

Mariette

Thanks for the answer,
Still considering the number of outputed files problem. In my script I
know that if
a cleaning option is set 2 other files will be created, so I check if
the option is asked by the
user and try this :

  <outputs>
    <data name="log" format="txt" />
    #if $clean_pairends.clean_pairends_select=="y":
        <data name="output" format="input"/>
    #end if
  </outputs>

but this is not working ... there is a way to do what I want ?
thx
Jerome




Peter Cock a écrit :

> On Tue, Jun 7, 2011 at 9:24 AM, Mariette <[hidden email]> wrote:
>  
>> Thanks for the answer,
>>
>> so I tryed to write a wrapper, but the main script is not recognize.
>> When I'm calling my wrapper in the xml file, I don't have to specify
>> the full path but then from my wrapper if I want to call my main script
>> I can't if this one is not on the PATH ? the wrapper current directory
>> is the job_working_directory, there is anyway to access my main script
>> just like it's done for the wrapper ?
>>    
>
> Generally put the wrapper script next to your tool XML file, and don't
> prefix it with any path in the <command> tag in the XML, e.g.
>
> /opt/galaxy/tools/mariette/my_tool.xml
> /opt/galaxy/tools/mariette/my_tool.sh
>
> (or my_tool.py or my_tool.pl etc depending on what language you used)
>
> Your wrapper script then has to call the real executable, and the
> normal way to do this on Unix is to have it on the PATH. You could
> also hard code an absolute path.
>
> 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/
>  

___________________________________________________________
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/
Reply | Threaded
Open this post in threaded view
|

Re: Components

Peter Cock
On Tue, Jun 7, 2011 at 10:56 AM, Mariette <[hidden email]> wrote:

>
> Thanks for the answer,
> Still considering the number of outputed files problem. In my script I know
> that if
> a cleaning option is set 2 other files will be created, so I check if the
> option is asked by the
> user and try this :
>
>  <outputs>
>   <data name="log" format="txt" />
>   #if $clean_pairends.clean_pairends_select=="y":
>       <data name="output" format="input"/>
>   #end if
>  </outputs>
>
> but this is not working ... there is a way to do what I want ?
> thx
> Jerome

The #if stuff is Cheetah syntax, and only applies within the <command>
tag - not to the XML file in general.

You probably want a conditional output using <when>, see:
https://bitbucket.org/galaxy/galaxy-central/wiki/ToolConfigSyntax

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/
Reply | Threaded
Open this post in threaded view
|

Re: Components

Mariette

I can only see the usage of the <when> tag into the <outputs>
to change format, is that correct ?

I tryed :
  <outputs>
    <data name="log" format="txt" />
       <data name="output" format="input">
           <when input="clean_pairends.clean_pairends_select" value="y"
format="interval"/>
       </data>
  </outputs>

but even if the option is not selected, I have 2 outputs !

Am I missing something with the <when> tag ? Because it looks to me
that it is pretty limited to the change_format tag, isn't it ?

thx for your answers,
Jerome




Peter Cock a écrit :

> On Tue, Jun 7, 2011 at 10:56 AM, Mariette <[hidden email]> wrote:
>  
>> Thanks for the answer,
>> Still considering the number of outputed files problem. In my script I know
>> that if
>> a cleaning option is set 2 other files will be created, so I check if the
>> option is asked by the
>> user and try this :
>>
>>  <outputs>
>>   <data name="log" format="txt" />
>>   #if $clean_pairends.clean_pairends_select=="y":
>>       <data name="output" format="input"/>
>>   #end if
>>  </outputs>
>>
>> but this is not working ... there is a way to do what I want ?
>> thx
>> Jerome
>>    
>
> The #if stuff is Cheetah syntax, and only applies within the <command>
> tag - not to the XML file in general.
>
> You probably want a conditional output using <when>, see:
> https://bitbucket.org/galaxy/galaxy-central/wiki/ToolConfigSyntax
>
> 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/
>  

___________________________________________________________
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/
Reply | Threaded
Open this post in threaded view
|

Re: Components

Peter Cock
On Tue, Jun 7, 2011 at 11:38 AM, Mariette <[hidden email]> wrote:
>
> I can only see the usage of the <when> tag into the <outputs>
> to change format, is that correct ?
>

On re-reading the wiki page, yes, I think you are right. I should have
said <filter> with <data>, as in tools/filters/sff_extractor.xml

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/
Reply | Threaded
Open this post in threaded view
|

Re: Components

Mariette

Thanks this is what I was looking for !!
I succeded to make it work when checking the value on a simple param
using the name like this

<inputs>
<param name="qual_file" type="data" format="qual" optional="true"
label="Quality reads file (if input is a fasta)" />
</input>
...
<outputs>
<data name="out_qual" format="qual">
      <filter>qual_file != None</filter>
</data>
</outputs>

however when I'm in a conditional tag like this, I tryed :

<inputs>
<conditional name="clean_pairends">
     <param name="clean_pairends_select" type="select" label="Clean
pairends">
           <option value="y">Yes</option>
           <option selected="true" value="n">No</option>
     </param>
     <when value="y">
           <param name="border_limit" type="integer" size="10"
value="70" label="Minimal length between the spacer and the read
extremity"/>
           <param name="missmatch" type="integer" size="10" value="10"
label="Limit of missmatch"/>
      </when>
      <when value="n">
      </when>
</conditional>
</input>
...
<outputs>
<data name="out_pe_fasta" format="fasta">
       <filter>clean_pairends.clean_pairends_select == "y"</filter>
</data>


but it's not working ... it looks like between filter tag I should
provide a python test, am I missing something ?
thx,
Jerome



Peter Cock a écrit :

> On Tue, Jun 7, 2011 at 11:38 AM, Mariette <[hidden email]> wrote:
>  
>> I can only see the usage of the <when> tag into the <outputs>
>> to change format, is that correct ?
>>
>>    
>
> On re-reading the wiki page, yes, I think you are right. I should have
> said <filter> with <data>, as in tools/filters/sff_extractor.xml
>
> 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/
>  

___________________________________________________________
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/
Reply | Threaded
Open this post in threaded view
|

Re: Components

Mariette

So I tryed an other way to access the value :

       <data name="out_pe_fasta" format="fasta">
           <filter>${clean_pairends.clean_pairends_select} == "y"</filter>
       </data>

but it's not working either ... I tryed to add a label to the data like
this :

       <data name="out_pe_fasta" format="fasta"
label="${clean_pairends.clean_pairends_select}">
           <filter>${clean_pairends.clean_pairends_select} == "y"</filter>
       </data>

the data file is created with a label "n" ! Is it not weird ?

Jerome




Mariette a écrit :

>
> Thanks this is what I was looking for !!
> I succeded to make it work when checking the value on a simple param
> using the name like this
>
> <inputs>
> <param name="qual_file" type="data" format="qual" optional="true"
> label="Quality reads file (if input is a fasta)" />
> </input>
> ...
> <outputs>
> <data name="out_qual" format="qual">
>      <filter>qual_file != None</filter>
> </data>
> </outputs>
>
> however when I'm in a conditional tag like this, I tryed :
>
> <inputs>
> <conditional name="clean_pairends">
>     <param name="clean_pairends_select" type="select" label="Clean
> pairends">
>           <option value="y">Yes</option>
>           <option selected="true" value="n">No</option>
>     </param>
>     <when value="y">
>           <param name="border_limit" type="integer" size="10"
> value="70" label="Minimal length between the spacer and the read
> extremity"/>
>           <param name="missmatch" type="integer" size="10" value="10"
> label="Limit of missmatch"/>
>      </when>
>      <when value="n">
>      </when>
> </conditional>
> </input>
> ...
> <outputs>
> <data name="out_pe_fasta" format="fasta">
>       <filter>clean_pairends.clean_pairends_select == "y"</filter>
> </data>
>
>
> but it's not working ... it looks like between filter tag I should
> provide a python test, am I missing something ?
> thx,
> Jerome
>
>
>
> Peter Cock a écrit :
>> On Tue, Jun 7, 2011 at 11:38 AM, Mariette <[hidden email]>
>> wrote:
>>  
>>> I can only see the usage of the <when> tag into the <outputs>
>>> to change format, is that correct ?
>>>
>>>    
>>
>> On re-reading the wiki page, yes, I think you are right. I should have
>> said <filter> with <data>, as in tools/filters/sff_extractor.xml
>>
>> 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/
>>  
>
> ___________________________________________________________
> 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/

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