Difference between revisions of "Creating Galaxy tool"
Ivan Yevshin (Talk | contribs) (→Multiselect parameter type) |
Ivan Yevshin (Talk | contribs) (→BioUML extensions to Galaxy standard) |
||
(One intermediate revision by one user not shown) | |||
Line 28: | Line 28: | ||
=== Multiselect parameter type === | === Multiselect parameter type === | ||
Example: | Example: | ||
− | <code> | + | |
+ | <code><param name="inputs" type="data-multi" format="tabular" label="Input tables"/></code> | ||
+ | |||
In Cheetah template this parameter will be expanded to *.tabular (depending on the format), that can be used in the bash script to get the list of files. | In Cheetah template this parameter will be expanded to *.tabular (depending on the format), that can be used in the bash script to get the list of files. | ||
For example, to concatenate input files use: | For example, to concatenate input files use: | ||
− | <code> | + | |
+ | <code><command>cat $inputs > out<command></code> | ||
+ | |||
+ | === Output name templates === | ||
+ | Allow to generate output file names based on other parameter values, such as names of input files. | ||
+ | Example: | ||
+ | |||
+ | <code><data format="vcf" name="output" label="Mapped coordinates" template="$input$_mapped"></code> | ||
+ | |||
+ | where "input" is the name of input parameter. | ||
== Reloading tool configuration == | == Reloading tool configuration == |
Latest revision as of 14:04, 17 January 2018
If you have BioUML server installed and Galaxy installed, you can add your own tools to BioUML.
Contents |
[edit]
If you properly integrated Galaxy with BioUML, Galaxy tools appear in BioUML repository under analyses/Galaxy path. This subtree is populated from Galaxy tool_conf.xml file.
Let's assume that $GALAXY_DIST
points to the root folder of Galaxy installation. Look into $GALAXY_DIST/tool_conf.xml
file. It contains a number of sections which may contain a number of sections which look like this:
<section name="Section title" id="section_id"> <tool file="tool/my_tool.xml" /> <label text="My label" id="my_label"/> <tool file="tool/my_other_tool.xml" /> </section>
In BioUML interface section is transformed into folder and label is rendered as a separator between tools. You can freely add, delete or rearrange sections, labels or tools here. To add new tool you should specify a path to the tool description XML file relative to $GALAXY_DIST/tools
directory.
[edit] Creating your own tool
When you added a link to new tool description XML file, you should create that file. Refer to Galaxy Wiki to learn how to create such files. Please note that not all Galaxy features are supported by BioUML. Ask for technical support if you have any doubts.
[edit] BioUML extensions to Galaxy standard
BioUML extends Galaxy tool configuration syntax Galaxy Wiki that allow closer interaction between Galaxy and BioUML systems.
[edit] Configurable file format
In Galaxy to define output (<data name="out1" format="tabular"/>
) or input parameter (<param type='data' format="tabular"/>
) you should set "format" attribute. The list of predefined formats is contained in the $GALAXY_DIST/datatypes_conf.xml
and the mapping of these formats to BioUML element types in ru.biosoft.galaxy.types (currently all these mappings are registered in ru.biosoft.galaxy plugin). For more flexibility BioUML allows to change format options "on the fly" when you specify parameter format. For example:
<data name="outTable" format="tabular" format.commentString="#" />
means that lines starting with "#" are comments and should be ignored,
<data name="outTrack" format="interval" format.fieldNames="pValue,FDR" />
set the names of additional columns in the Interval format.
In general format options can be changed by adding format.$OptionName="$OptionValue" attributes, the list of possible options for each format is defined by properties of corresponding DataElementImporter
or DataElementExporter
.
[edit] Multiselect parameter type
Example:
<param name="inputs" type="data-multi" format="tabular" label="Input tables"/>
In Cheetah template this parameter will be expanded to *.tabular (depending on the format), that can be used in the bash script to get the list of files. For example, to concatenate input files use:
<command>cat $inputs > out<command>
[edit] Output name templates
Allow to generate output file names based on other parameter values, such as names of input files. Example:
<data format="vcf" name="output" label="Mapped coordinates" template="$input$_mapped">
where "input" is the name of input parameter.
[edit] Reloading tool configuration
Once you finish editing a tool you should reload Galaxy configuration. You can do this using Script viewpart in BioUML interface and typing the following command here:
galaxy.reload();
Please note that for security reasons this command is available for BioUML server administrators only.