Re: [galaxy-dev] galaxy-dev] format="input"

2011-06-14 Thread James Johnson
I put a patch for   lib/galaxy/workflow/modules.py in:
https://bitbucket.org/galaxy/galaxy-central/issue/582/output-format_source-not-supported-in

On Thu, Jun 9, 2011 at 11:24 AM, Peter Cock wrote:

> On Thu, Jun 9, 2011 at 8:39 AM, Peter Cock 
> wrote:
> >
> > Thanks for this, I can think of several of my own tools where this
> > will work much more cleanly than the current solution using
> >  and .
> >
>
> There is still a bit of work needed:
> https://bitbucket.org/galaxy/galaxy-central/issue/582
> #582 output format_source not supported in workflow editor
>
> Peter
>
> P.S. I found your original email on this approach,
> http://lists.bx.psu.edu/pipermail/galaxy-dev/2011-February/004334.html
>
___
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] galaxy-dev] format="input"

2011-06-09 Thread Peter Cock
On Thu, Jun 9, 2011 at 8:39 AM, Peter Cock  wrote:
>
> Thanks for this, I can think of several of my own tools where this
> will work much more cleanly than the current solution using
>  and .
>

There is still a bit of work needed:
https://bitbucket.org/galaxy/galaxy-central/issue/582
#582 output format_source not supported in workflow editor

Peter

P.S. I found your original email on this approach,
http://lists.bx.psu.edu/pipermail/galaxy-dev/2011-February/004334.html
___
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] format="input"

2011-06-09 Thread Mariette


Hi and thanks to you both !

Jim : I tryed your solution and it works just fine !
Peter : thanks for the advice, I'll support only sff/fastq as inputs 
you're right it makes think easier !


Jerome



Peter Cock a écrit :

On Wed, Jun 8, 2011 at 4:36 PM, Mariette  wrote:
  

Hi everyone,

I'm facing a little problem ...
Any ideas ?
thx,



I don't know what kind of tool you are working on, but personally I'd
consider dropping support for FASTA+QUAL and try and work with either
SFF or FASTQ only. It makes so many things easier.

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/


Re: [galaxy-dev] galaxy-dev] format="input"

2011-06-09 Thread Jim Johnson


I added an example taken from trim.seqs.xml in the Mothur metagenomics 
tool_suite to:
https://bitbucket.org/galaxy/galaxy-central/wiki/ToolConfigSyntax

The following will create datasets in the history panel, setting the output data type to 
be the same as that of an input dataset named by the "format_source" attribute. 
Note that a conditional name is not included, so 2 separate conditional blocks should not 
contain parameters with the same name.






no
yes











(qual['add'] == 'yes')




On 6/9/11 2:39 AM, Peter Cock wrote:

On Wed, Jun 8, 2011 at 9:59 PM, Jim Johnson  wrote:

It went into galaxy-central:

$ hg log -pr 5082
changeset:   5082:a86e1fa82a89
user:Kanwei Li
date:Thu Feb 17 15:35:07 2011 -0500
summary: Add a "format_source" attribute to the ToolConfig output data
element [JJ Johnson]. Closes #470

...

And I should have put an example in:
https://bitbucket.org/galaxy/galaxy-central/wiki/ToolConfigSyntax

Oh right - better late than never ;)

On the bright side because this commit was a while ago, it has
already been included in the stable Galaxy releases.

Thanks for this, I can think of several of my own tools where this
will work much more cleanly than the current solution using
  and.

Regards,

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] galaxy-dev] format="input"

2011-06-09 Thread Peter Cock
On Wed, Jun 8, 2011 at 9:59 PM, Jim Johnson  wrote:
>
> It went into galaxy-central:
>
> $ hg log -pr 5082
> changeset:   5082:a86e1fa82a89
> user:        Kanwei Li 
> date:        Thu Feb 17 15:35:07 2011 -0500
> summary:     Add a "format_source" attribute to the ToolConfig output data
> element [JJ Johnson]. Closes #470
>
> ...
>
> And I should have put an example in:
> https://bitbucket.org/galaxy/galaxy-central/wiki/ToolConfigSyntax

Oh right - better late than never ;)

On the bright side because this commit was a while ago, it has
already been included in the stable Galaxy releases.

Thanks for this, I can think of several of my own tools where this
will work much more cleanly than the current solution using
 and .

Regards,

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] galaxy-dev] format="input"

2011-06-08 Thread Jim Johnson


It went into galaxy-central:

$ hg log -pr 5082
changeset:   5082:a86e1fa82a89
user:Kanwei Li 
date:Thu Feb 17 15:35:07 2011 -0500
summary: Add a "format_source" attribute to the ToolConfig output data 
element [JJ Johnson]. Closes #470

diff -r 885f04ae671e -r a86e1fa82a89 lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py  Thu Feb 17 14:48:53 2011 -0500
+++ b/lib/galaxy/tools/__init__.py  Thu Feb 17 15:35:07 2011 -0500
@@ -249,10 +249,11 @@
   (format, metadata_source, parent)
 """

-def __init__( self, name, format=None, metadata_source=None,
+def __init__( self, name, format=None, format_source=None, 
metadata_source=None,
   parent=None, label=None, filters = None, actions = None ):
 self.name = name
 self.format = format
+self.format_source = format_source
 self.metadata_source = metadata_source
 self.parent = parent
 self.label = label
@@ -559,6 +560,7 @@
 output = ToolOutput( data_elem.get("name") )
 output.format = data_elem.get("format", "data")
 output.change_format = data_elem.findall("change_format")
+output.format_source = data_elem.get("format_source", None)
 output.metadata_source = data_elem.get("metadata_source", "")
 output.parent = data_elem.get("parent", None)
 output.label = util.xml_text( data_elem, "label" )
diff -r 885f04ae671e -r a86e1fa82a89 lib/galaxy/tools/actions/__init__.py
--- a/lib/galaxy/tools/actions/__init__.py  Thu Feb 17 14:48:53 2011 -0500
+++ b/lib/galaxy/tools/actions/__init__.py  Thu Feb 17 15:35:07 2011 -0500
@@ -244,6 +244,12 @@
 ext = output.format
 if ext == "input":
 ext = input_ext
+if output.format_source is not None and 
output.format_source in inp_data:
+try:
+ext = inp_data[output.format_source].ext
+except Exception, e:
+pass
+
 #process change_format tags
 if output.change_format:
 if params is None:



And I should have put an example in:   
https://bitbucket.org/galaxy/galaxy-central/wiki/ToolConfigSyntax



On 6/8/11 3:32 PM, Peter Cock wrote:

On Wed, Jun 8, 2011 at 9:26 PM, Jim Johnson  wrote:

I added an attribute "format_source"  (analogous to metadata_source)
  to the  tag to deal with that kind of issue:
see:   https://bitbucket.org/galaxy/galaxy-central/wiki/ToolConfigSyntax


Where is the code to handle this? Maybe I missed the commit
with all the recent activity.

What happens if both format and format_source are given? I
would hope an error - which means the wiki is misleading in
that format is listed as required.

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] format="input"

2011-06-08 Thread Peter Cock
On Wed, Jun 8, 2011 at 4:36 PM, Mariette  wrote:
> Hi everyone,
>
> I'm facing a little problem ...
> Any ideas ?
> thx,

I don't know what kind of tool you are working on, but personally I'd
consider dropping support for FASTA+QUAL and try and work with either
SFF or FASTQ only. It makes so many things easier.

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] galaxy-dev] format="input"

2011-06-08 Thread Peter Cock
On Wed, Jun 8, 2011 at 9:26 PM, Jim Johnson  wrote:
> I added an attribute "format_source"  (analogous to metadata_source)
> to the  tag to deal with that kind of issue:
> see:   https://bitbucket.org/galaxy/galaxy-central/wiki/ToolConfigSyntax
>

Where is the code to handle this? Maybe I missed the commit
with all the recent activity.

What happens if both format and format_source are given? I
would hope an error - which means the wiki is misleading in
that format is listed as required.

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] galaxy-dev] format="input"

2011-06-08 Thread Jim Johnson

I added an attribute "format_source"  (analogous to metadata_source)  to the 
 tag to deal with that kind of issue:
see:   https://bitbucket.org/galaxy/galaxy-central/wiki/ToolConfigSyntax


  
  



  
  
qual_file != None
  


JJ


Hi everyone,

I'm facing a little problem ...

I have the following input :



and the following output:


 qual_file != None


If I provide the tool a sff file, the output is sff, if I only provide a
fasta file and no qual file the output will be a fasta.
However if I provide a fasta+qual the output will be considered as qual
file even if it's a fasta file.

I don't get how it can mark my output file as a qual file knowing it's
not a valid input file format.

Any ideas ?
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/


[galaxy-dev] format="input"

2011-06-08 Thread Mariette

Hi everyone,

I'm facing a little problem ...

I have the following input :

label="Quality reads file (if input is a fasta)" />


and the following output:



   qual_file != None


If I provide the tool a sff file, the output is sff, if I only provide a 
fasta file and no qual file the output will be a fasta.
However if I provide a fasta+qual the output will be considered as qual 
file even if it's a fasta file.


I don't get how it can mark my output file as a qual file knowing it's 
not a valid input file format.


Any ideas ?
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/