optional integer value in tool config
Hello, in the config of a tool I want to integrate into Galaxy I would like to have a parameter with the following properties: <param name="var" type="integer" label="Var" value="50" optional="true" min="10" max="100" /> So it should be possible to leave this field empty, but when you choose to enter a number it should be between 10 and 100. The problem now is that Galaxy refuses to accept it when this field is empty. After encountering this problem I tried to solve the issue within Cheetah and tried the following: #if $var.value < 10 or $var.value > 100 #set $var.value = "" #end if Galaxy however throws the following error when loading the tool: galaxy.tools ERROR 2011-07-04 14:04:14,231 error reading tool from path: path/to/tool.xml Traceback (most recent call last): File "/galaxy/galaxy_server/lib/galaxy/tools/__init__.py", line 77, in load_tool tool = self.load_tool( os.path.join( self.tool_root_dir, path ) ) File "/galaxy/galaxy_server/lib/galaxy/tools/__init__.py", line 131, in load_tool tree = util.parse_xml( config_file ) File "/galaxy/galaxy_server/lib/galaxy/util/__init__.py", line 104, in parse_xml tree = ElementTree.parse(fname) File "/galaxy/galaxy_server/eggs/elementtree-1.2.6_20050316-py2.6.egg/elementtree/ElementTree.py", line 859, in parse tree.parse(source, parser) File "/galaxy/galaxy_server/eggs/elementtree-1.2.6_20050316-py2.6.egg/elementtree/ElementTree.py", line 583, in parse parser.feed(data) File "/galaxy/galaxy_server/eggs/elementtree-1.2.6_20050316-py2.6.egg/elementtree/ElementTree.py", line 1242, in feed self._parser.Parse(data, 0) ExpatError: not well-formed (invalid token): line 230, column 21 The token it is complaining about is the <. I searched the Cheetah documentation and also Google but was not able to come up with a solution. Could anyone of you knowledgeable guys help me find a solution to this, please? I would be very grateful! Thanks in advance! Best regards, Sarah
On Mon, Jul 4, 2011 at 1:46 PM, Sarah Diehl <diehl@immunbio.mpg.de> wrote:
Hello,
in the config of a tool I want to integrate into Galaxy I would like to have a parameter with the following properties:
<param name="var" type="integer" label="Var" value="50" optional="true" min="10" max="100" />
So it should be possible to leave this field empty, but when you choose to enter a number it should be between 10 and 100. The problem now is that Galaxy refuses to accept it when this field is empty.
Which version of Galaxy are you running? Optional float and integer parameters was only recently made possible under issue 403 with an initial fix committed two weeks ago, https://bitbucket.org/galaxy/galaxy-central/issue/403 https://bitbucket.org/galaxy/galaxy-central/changeset/adcc600effa4
After encountering this problem I tried to solve the issue within Cheetah and tried the following:
#if $var.value < 10 or $var.value > 100 #set $var.value = "" #end if
You'd need to try something like this: #if int($var.value) < 10 or int($var.value) > 100 #set $var.value = "" #end if but you also have to first exclude the case where is is already empty as then int would fail. Peter
Hi Peter, thank you very much for your help! I guess the Galaxy version we are currently running is about two months old. I really need to update... Best regards, Sarah On 07/04/2011 03:04 PM, Peter Cock wrote:
On Mon, Jul 4, 2011 at 1:46 PM, Sarah Diehl<diehl@immunbio.mpg.de> wrote:
Hello,
in the config of a tool I want to integrate into Galaxy I would like to have a parameter with the following properties:
<param name="var" type="integer" label="Var" value="50" optional="true" min="10" max="100" />
So it should be possible to leave this field empty, but when you choose to enter a number it should be between 10 and 100. The problem now is that Galaxy refuses to accept it when this field is empty.
Which version of Galaxy are you running? Optional float and integer parameters was only recently made possible under issue 403 with an initial fix committed two weeks ago,
https://bitbucket.org/galaxy/galaxy-central/issue/403 https://bitbucket.org/galaxy/galaxy-central/changeset/adcc600effa4
After encountering this problem I tried to solve the issue within Cheetah and tried the following:
#if $var.value< 10 or $var.value> 100 #set $var.value = "" #end if
You'd need to try something like this:
#if int($var.value)< 10 or int($var.value)> 100 #set $var.value = "" #end if
but you also have to first exclude the case where is is already empty as then int would fail.
Peter
I use the latest stable version of Galaxy, which seems to have the fix. However, I still experience some issues with optional parameters: https://bitbucket.org/galaxy/galaxy-central/issue/661/optional-arguments-pro... Florent On 04/07/11 23:27, Sarah Diehl wrote:
Hi Peter,
thank you very much for your help! I guess the Galaxy version we are currently running is about two months old. I really need to update...
Best regards, Sarah
On 07/04/2011 03:04 PM, Peter Cock wrote:
On Mon, Jul 4, 2011 at 1:46 PM, Sarah Diehl<diehl@immunbio.mpg.de> wrote:
Hello,
in the config of a tool I want to integrate into Galaxy I would like to have a parameter with the following properties:
<param name="var" type="integer" label="Var" value="50" optional="true" min="10" max="100" />
So it should be possible to leave this field empty, but when you choose to enter a number it should be between 10 and 100. The problem now is that Galaxy refuses to accept it when this field is empty.
Which version of Galaxy are you running? Optional float and integer parameters was only recently made possible under issue 403 with an initial fix committed two weeks ago,
https://bitbucket.org/galaxy/galaxy-central/issue/403 https://bitbucket.org/galaxy/galaxy-central/changeset/adcc600effa4
After encountering this problem I tried to solve the issue within Cheetah and tried the following:
#if $var.value< 10 or $var.value> 100 #set $var.value = "" #end if
You'd need to try something like this:
#if int($var.value)< 10 or int($var.value)> 100 #set $var.value = "" #end if
but you also have to first exclude the case where is is already empty as then int would fail.
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:
participants (3)
-
Florent Angly
-
Peter Cock
-
Sarah Diehl