Question: How can I set a directory as planemo tool_init --example_input?
0
gravatar for Seongmin Choi
10 days ago by
South Korea
Seongmin Choi10 wrote:

Hi all,
I'm trying to publish a script that takes a directory which includes dozens of SNP VCFs as a planemo example input.
However, whenever I run planemo t mytool.xml, I get a IOError: ... Is a directory.
Does anyone know how to set a directory as plenemo --example_input?

planemo tool_init --force \
--id 'OneKG_filter' \
--name 'Filter out common variants in 1000G SNP DB \
--requirement python \
--requirement pytabix \
--example_command 'python /dat1/github/rainbow/scripts/dbflt_1000g.py /dat1/github/rainbow/examples/test.vcf /dat1/rgkorea/bam_files/rainbow/data/db/snp_db/1000G > /dat1/github/rainbow/examples/test_1000g.vcf' \
--example_input /dat1/github/rainbow/examples/test.vcf \
--example_input /dat1/rgkorea/bam_files/rainbow/data/db/snp_db/1000G \
--example_output /dat1/github/rainbow/examples/test_1000g.vcf \
--test_case \
--help_from_command 'python /dat1/github/rainbow/scripts/dbflt_1000g.py' \
--cite_url https://github.com/alexbmp/rainbow
planemo • 68 views
ADD COMMENTlink written 10 days ago by Seongmin Choi10
1

Could you please show us the command and the error it results in? planemo t will test everything that looks like a tool in the current directory.

ADD REPLYlink written 9 days ago by Martin Čech ♦♦ 4.6k

Hello Martin,

The following lines are the command and the resulting error. Inside the code, /dat1/rgkorea/bam_files/rainbow/data/db/snp_db/1000G is a directory that the python file uses as an input.

* THIS THREAD HAS BEEN EDITED FOR CLARITY IN MAY 16TH 20:20 (KST) *

Code:

planemo tool_init --force \
    --id 'EVS_filter' \
    --name 'Filter out common variants in EVS' \
    --requirement python \
    --requirement pytabix \
    --example_command 'python /dat1/github/rainbow/scripts/dbflt_evs.py /dat1/github/rainbow/examples/test_gonl.vcf /dat1/rgkorea/bam_f
    --example_input /dat1/github/rainbow/examples/test_gonl.vcf \
    --example_input /dat1/rgkorea/bam_files/rainbow/data/db/snp_db/EVS \
    --example_output /dat1/github/rainbow/examples/test_evs.vcf \
    --test_case \
    --help_from_command 'python /dat1/github/rainbow/scripts/dbflt_evs.py' \
    --cite_url https://github.com/alexbmp/rainbow

Error (excerpt from error.log) :

======================================================================
ERROR: Filter out common variants in EVS ( EVS_filter ) > Test-1
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/tmprXFbdU/galaxy-dev/test/functional/test_toolbox.py", line 316, in test_tool
    self.do_it(td)
  File "/tmp/tmprXFbdU/galaxy-dev/test/functional/test_toolbox.py", line 47, in do_it
    stage_data_in_history(galaxy_interactor, testdef.test_data(), test_history, shed_tool_id)
  File "/tmp/tmprXFbdU/galaxy-dev/test/base/interactor.py", line 49, in stage_data_in_history
    upload_wait = galaxy_interactor.stage_data_async(test_data, history, shed_tool_id)
  File "/tmp/tmprXFbdU/galaxy-dev/test/base/interactor.py", line 211, in stage_data_async
    "files_0|file_data": open(file_name, 'rb')
IOError: [Errno 21] Is a directory: '/dat1/rgkorea/bam_files/rainbow/data/db/snp_db/EVS'

----------------------------------------------------------------------
XML: /tmp/tmprXFbdU/xunit.xml
----------------------------------------------------------------------
Ran 1 test in 5.972s

FAILED (errors=1)
ADD REPLYlink modified 5 days ago • written 6 days ago by Seongmin Choi10

I've edited my reply for more clarity. As shown, the script emits an "Is a directory" error.

ADD REPLYlink written 5 days ago by Seongmin Choi10
1
gravatar for Seongmin Choi
5 days ago by
South Korea
Seongmin Choi10 wrote:

Problem solved. No worries now. It seems that if I set the type as a "text" for my <inputs> <param> for the directory input, the test passes. The problem was that planemo t recognized the directory input of my script as a "file", not a directory.

ADD COMMENTlink written 5 days ago by Seongmin Choi10
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: 107 users visited in the last hour