Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use local tool dirs #128

Open
lldelisle opened this issue Apr 1, 2021 · 2 comments
Open

Use local tool dirs #128

lldelisle opened this issue Apr 1, 2021 · 2 comments

Comments

@lldelisle
Copy link

Hi,
I noticed that when you use directories for your local tool instead of just a xml (for example, if you need another python script), it will not update the local_tool_conf.xml:

{% if tool.endswith('.xml') %}
<tool file="{{ tool }}" />
{% endif %}

In my case I put in my group_var:

galaxy_local_tools:
  - splitbedGraphFromBed
  - ScaleBedGraph

And I have:

$ tree files/galaxy/tools/
files/galaxy/tools/
├── ScaleBedGraph
│   ├── ScaleBedGraph.sh
│   └── ScaleBedGraph.xml
└── splitbedGraphFromBed
    ├── splitbedGraphFromBed.py
    └── splitbedGraphFromBed.xml

2 directories, 4 files

Then I needed to put a templates/galaxy/config/tool_conf.xml.j2 with all the default tools + at the end:

  <section id="LDtools" name="LDtools">
    <tool file="{{ galaxy_local_tools_dir }}/splitbedGraphFromBed/splitbedGraphFromBed/splitbedGraphFromBed.xml" />
    <tool file="{{ galaxy_local_tools_dir }}/ScaleBedGraph/ScaleBedGraph/ScaleBedGraph.xml" />
  </section>

Were there a better way?
Something like:

{% for tool in galaxy_local_tools %}
{% if not tool.endswith('.xml') %}
    <tool file="{{ galaxy_local_tools_dir }}/{{ tool }}/{{ tool }}/{{ tool }}.xml" />
{% endif %}
{% endfor %}

?
Also I found a bit strange there the tool directory is put in a directory tool...

@elichad
Copy link

elichad commented Nov 24, 2021

I just ran into this also. It would be useful for the local tool template to loop through the tool directory looking for XML files if you can determine that it's a directory and not an XML file, but I don't know if that's within the scope of possibility with the templates.

I'll also use a custom tool_conf.xml.j2 template to work around this for now.

@jarrah42
Copy link

Changing tasks/static_setup.yml as follows may fix the directory in directory problem:

    - name: Install local tools
      copy:
        src: "{{ galaxy_local_tools_src_dir }}/{{ item }}"
        dest: "{{ galaxy_local_tools_dir }}"
        mode: preserve
      with_items: "{{ galaxy_local_tools | default([]) }}"
      when: galaxy_local_tools is defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants