Question: Creating Appropriate Tool Dependencies for Custom Tool in Galaxy
1
gravatar for katherine.beaulieu014
2.5 years ago by
katherine.beaulieu01480 wrote:

Hello everyone, I am trying to create my own custom tool in Galaxy using the python API for iRODS, python-irodsclient. I have included my tool.xml file and my tool_dependencies.xml file:

<tool id="test" name="Test Tool" version="0.1.0">
      <description>Testing tool</description>
      <requirements>
            <requirement type="package" version="0.1.0">test_package</requirement>
            <requirement type="set_environment">python-irodsclient</requirement>
      <requirements>
     <command interpreter="python">test.py $input</command>
     <inputs>
             <param format="data" name="input" type="data" label="Select file"/>
     </inputs>
     <outputs>
            <data format="data" name="output" />
     </outputs>
</tool>

tool_dependencies.xml:


<tool_dependency>
        <set_environment version="1.0">
                <install version="1.0">
                        <actions>
                                <action type="setup_virtualenv" python="python2.7" use_requirements_file="False">
                                         git+https://github.com/irods/python-irodsclient.git
                                    </action>
                        </actions>
                </install>
        </set_environment>
        <package name="test_package" version="0.1.0">
                <repository toolshed="localhost:9009" name="push_tool1" owner="katherine"/>
        </package>
    </tool_dependency>

When I upload this to my local tool shed, I don't run into any problems, but if I try to install it in my local galaxy instance it says the complete dependency hierarchy could not be determined for this repository so no required repositories could be installed. The way my repo is set up is I have my test.py file in a folder called test_package and I have my test.xml and tool_dependecies.xml files outside that folder. Any help in getting this tool up and running would be appreciated!

ADD COMMENTlink modified 2.5 years ago • written 2.5 years ago by katherine.beaulieu01480
1

Hi Bjoern, I seemed to have fixed the problem but thank you so much for the help, much appreciated!

ADD REPLYlink written 2.5 years ago by katherine.beaulieu01480
1

Sure, anytime, no Problem!

ADD REPLYlink written 2.5 years ago by Bjoern Gruening5.1k
4
gravatar for Bjoern Gruening
2.5 years ago by
Bjoern Gruening5.1k
Germany
Bjoern Gruening5.1k wrote:

Hi,

you are using <set_environment version="1.0"> in a wrong way. Please look at this example how to create proper python packages https://github.com/galaxyproject/tools-iuc/blob/master/packages/package_matplotlib_1_4/tool_dependencies.xml or consider using conda-packages as dependencies.

Ciao, Bjoern

ADD COMMENTlink written 2.5 years ago by Bjoern Gruening5.1k
3
gravatar for Martin Čech
2.5 years ago by
Martin Čech ♦♦ 4.9k
United States
Martin Čech ♦♦ 4.9k wrote:

This is not how set_environment works, please see https://wiki.galaxyproject.org/ToolDependenciesTagSets and look at https://github.com/galaxyproject/tools-devteam/ or https://github.com/galaxyproject/tools-iuc/ for examples. edit: Bjoern is quick!

ADD COMMENTlink modified 2.5 years ago • written 2.5 years ago by Martin Čech ♦♦ 4.9k
1
gravatar for Bjoern Gruening
2.5 years ago by
Bjoern Gruening5.1k
Germany
Bjoern Gruening5.1k wrote:

Hi Katherine,

if you have a python file next to your tool.xml file, you don't need to have a requirement or a tool_dependencies.xml file. Do you have your code on github? I might help you with a pull request.

Thanks, Bjoern

ADD COMMENTlink written 2.5 years ago by Bjoern Gruening5.1k
0
gravatar for katherine.beaulieu014
2.5 years ago by
katherine.beaulieu01480 wrote:

Thank you for the responses. I have revised my tool_dependencies file and my tool id .xml file. I am still trying to get the hang of creating custom galaxy tools so I am still a little confused what my tool needs to depend on. If I have my .py file in the same repo as the tool id .xml file and the tool_dependencies.xml file, do I need to have a requirement for it? I believe my tool_dependencies file is correct but nothing is appearing in the galaxy panel even though there are no errors with the installation of the tool.

Here is the tool id .xml file:

<tool id="irods_push" name="Irods Push Tool" version="0.1.0">
    <description>Push file in workflow to irods</description>
    <requirements>
            <requriement type="package" version="0.4.0">python-irodsclient</requirement>
    <!--unsure about this   <requirement type="package" version="0.1.0">irods_push</requirement> -->

    <requirements>

    <command interpreter="python">irods_push.py $input2 $input</command>
    <inputs>
             <param format="data" name="input2" type="text" label="File name: " />
             <param format="data" name="input" type="data" label="Push file" />
    </inputs>


    <outputs>
            <data format="data" name="output" />
    </outputs>
    <help>
    This tool will push a given file to the administrators main collection in irods.
    </help>

</tool> ~

Here is the tool_dependencies.xml file (I put my .py file on git in case galaxy couldn't find it in the repo tool_dependencies and tool id .xml resides in):


<tool_dependency>
    <package name="pythonirodsclient" version="0.4.0">
            <install version="1.0">
                    <actions>
                            <action type="setup_virtualenv" pyhton="python2.7">python-irodsclient</action>
                    </actions>
            </install>
    </package>
    <package name="irods_push" version="0.1.0">
            <install version="1.0">
                    <actions>
                            <action type="shell_command">git clone --recursive https://github.com/katbeaulieu/galaxyTool.git irods_push
                            </action>
                            <action type="move_directory_files">
                                    <source_directory>.</source_directory>
                                    <destination_directory>$INSTALL_DIR</destination_directory>
                            </action>
                            <action type="set_environment">
                                    <environment_variable name="IRODS_PUSH_PATH" action="prepend_to">$INSTALL_DIR</environment_variable>
                            </action>

                    </actions>
            </install>
    </package>


   </tool_dependency>

P.S. I was able to run this tool in galaxy by manually adding it, but want to make it available through toolshed.

ADD COMMENTlink modified 2.5 years ago • written 2.5 years ago by katherine.beaulieu01480
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: 171 users visited in the last hour