0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Galaxy の Planemo Virtual Applianceを利用する その2

Posted at

Galaxy の Planemo Virtual Applianceを利用する その1でPlanemo Virtual Applianceの利用方法と入力ファイルと出力ファイルがそれぞれ1ファイルの場合の処理方法に触れた

以下はDocker を利用したPlanemo Virtual Applianceの中での操作

入力ファイルが複数の場合

入力ファイルが2つで、出力ファイルが1つの例を考える

入力ファイルの作成

# seq 1 9 > target1.txt
# seq 11 19 > target2.txt
# paste target1.txt target2.txt > result.txt

target1.txtには各行に1から9までの数字、target2.txtには各行に11から19までの数字
この2つのファイルのそれぞれの行の数字をタブ区切りで並べた1つのファイルを作るためのGalaxyのxmlファイルを作成する

2つの入力ファイルを処理する場合には、--example_inputを2回指定すれば良い

# planemo tool_init --force \
--id 'paste' \
--name 'Paste two files to one (paste command)' \
--example_command 'paste target1.txt target2.txt > result.txt' \
--example_input target1.txt \
--example_input target2.txt \
--example_output result.txt \
--test_case
Tool written to paste.xml
Copying test-file target1.txt
cp 'target1.txt' 'test-data'
Copying test-file target2.txt
cp 'target2.txt' 'test-data'
Copying test-file result.txt
cp 'result.txt' 'test-data'

lint

作成されたxmlの構文をplanemo lintでチェックする

# planemo lint paste.xml 
Linting tool /opt/galaxy/tools/planemo/twofiles/paste.xml
Applying linter tests... CHECK
.. CHECK: 1 test(s) found.
Applying linter output... CHECK
.. INFO: 1 outputs found.
Applying linter inputs... CHECK
.. INFO: Found 2 input parameters.
Applying linter help... WARNING
.. WARNING: Help contains TODO text.
.. CHECK: Tool contains help section.
.. CHECK: Help contains valid reStructuredText.
Applying linter general... CHECK
.. CHECK: Tool defines a version [0.1.0].
.. CHECK: Tool defines a name [Paste two files to one (paste command)].
.. CHECK: Tool defines an id [paste].
.. CHECK: Tool targets 16.01 Galaxy profile.
Applying linter command... CHECK
.. INFO: Tool contains a command.
Applying linter citations... WARNING
.. WARNING: No citations found, consider adding citations to your tool.
Applying linter tool_xsd... CHECK
.. INFO: File validates against XML schema.
Failed linting

lintでWarningが出力されているが、理由はGalaxy の Planemo Virtual Applianceを利用する その1のそれと同じなので、ここではそのままテストを実行
...部分は省略

# planemo test paste.xml 
...
All 1 test(s) executed passed.
paste[0]: passed

テストが成功した

入力ファイルや出力ファイルの数に応じて、planemo tool_initに下記の

  • --example_input 入力ファイル
  • --example_output 出力ファイル

オプションをそれぞれ必要な数だけ繰り返し指定すれば良い

今日はここまで:smile:

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?