Question: New Tool Question - How To Copy Meta Data From Input To Output?
0
gravatar for Assaf Gordon
10.3 years ago by
Assaf Gordon320
United States
Assaf Gordon320 wrote:
Hello, I'm writing a tool which accepts interval files and output interval files. The input file has the metadata set (chr/start/end columns). How can I copy the metadata to the generated output file? Currently, the output file's metadata is always set to chrom=1, start=2, end=3 (which I guess is the default for BED format). Other galaxy tools do it, so I'm sure it's possible. Which python code is responsible for that (to be included in my tool's XML) ? Thanks, Gordon.
galaxy • 1.0k views
ADD COMMENTlink modified 10.3 years ago by Greg Von Kuster840 • written 10.3 years ago by Assaf Gordon320
0
gravatar for Greg Von Kuster
10.3 years ago by
Greg Von Kuster840 wrote:
Hello Assaf, In your tool config, add the "metadata_source" attribute to the <outputs> tag set, something like the following. <outputs> <data format="input" name="output" metadata_source="input1"/> </outputs>
ADD COMMENTlink written 10.3 years ago by Greg Von Kuster840
Thanks! Another tool-related question, if I may: I want to pass a string to a tool, and this string may contains CR/LF, double quotes, Dollar signs, etc. The simple XML looks like this: <command interpreter="sh">my_tool.sh '$input > $output </command> <inputs> <param type="text" name="input" area="true" size="5x35"/> However, when I enter non alpha numeric characters, they are converted to X (the actual character 'X') before being sent to my script. double quotes are converted to "__dq__" and single quotes are converted to "__sq__". Is there a way to pass the string intact to my program ? (Let's assume for now that I'm well aware of the security problems in allowing a string to be passed on to a shell script...) Thanks, Gordon. Greg Von Kuster wrote, On 08/18/2008 08:17 AM:
ADD REPLYlink written 10.3 years ago by Assaf Gordon320
Answering to myself... Assaf Gordon wrote, On 08/18/2008 08:49 AM: Found the beautiful hack at 'lib/galaxy/util/__init__.py' line 142... if the parameter name is 'url_paste' then the value won't be sanitized... :-) This is actually quite useful, please don't change this. -Gordon.
ADD REPLYlink written 10.3 years ago by Assaf Gordon320
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 173 users visited in the last hour