Question: How can I set a directory as planemo tool_init --example_input?
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/ /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/' \
planemo • 68 views
ADD COMMENTlink written 10 days ago by Seongmin Choi10

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.



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/ /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/' \

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/", line 316, in test_tool
  File "/tmp/tmprXFbdU/galaxy-dev/test/functional/", 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/", 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/", 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
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.


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