Question: How can I set a directory as planemo tool_init --example_input?
0
gravatar for Seongmin Choi
6 months ago by
South Korea
Seongmin Choi • 20 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 • 372 views
ADD COMMENT • link • written 6 months ago by Seongmin Choi • 20
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 REPLY • link written 6 months ago by Martin Čech ♦♦ 4.9k

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 REPLY • link modified 6 months ago • written 6 months ago by Seongmin Choi • 20

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

ADD REPLY • link written 6 months ago by Seongmin Choi • 20
3
gravatar for Seongmin Choi
6 months ago by
South Korea
Seongmin Choi • 20 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 COMMENT • link written 6 months ago by Seongmin Choi • 20
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: 172 users visited in the last hour