comparison list_spaln_tables.xml @ 1:37b5e1f0b544 draft

"planemo upload for repository https://github.com/ogotoh/spaln commit 4cfc21ef8456ca8b8da0a8a8c045b8a472858608"
author iuc
date Thu, 16 Jul 2020 07:57:10 -0400
parents
children dd0cd2319ae5
comparison
equal deleted inserted replaced
0:95ea8d97abb4 1:37b5e1f0b544
1 <tool id="list_spaln_tables" name="List spaln parameter tables" version="@TOOL_VERSION@+galaxy0">
2 <description>Given a query species, list the spaln settings tables that exist, from closest related species to most different</description>
3 <macros>
4 <import>macros.xml</import>
5 </macros>
6 <requirements>
7 <requirement type="package" version="3.8">python</requirement>
8 <requirement type="package" version="@TOOL_VERSION@">spaln</requirement>
9 <requirement type="package" version="1.0.7">rust-ncbitaxonomy</requirement>
10 </requirements>
11 <command detect_errors="aggressive"><![CDATA[
12 #if $gnm2tab.gnm2tab_source == "spaln_tool"
13 SPALN_LOCATION=\$(dirname \$(dirname \$(which spaln))) &&
14 GNM2TAB_PATH="\$SPALN_LOCATION/share/spaln/table/gnm2tab" &&
15 if [[ -f "\$GNM2TAB_PATH" ]] ; then
16 ln -s "\$GNM2TAB_PATH" gnm2tab ;
17 else
18 echo "Cannot find builtin gnm2tab file \$SPALN_LOCATION : \$GNM2TAB_PATH" >&2 ; exit 1 ;
19 fi &&
20 #else
21 ln -s '${gnm2tab.gnm2tab_file}' gnm2tab &&
22 #end if
23 #if $taxonomy.taxonomy_source == "cached"
24 ln -s '${taxonomy.taxonomy_sqlite_table.fields.path}/tax.ncbitaxonomy.sqlite' tax.ncbitaxonomy.sqlite &&
25 #else
26 ln -s '${taxonomy.taxonomy_sqlite_file}' tax.ncbitaxonomy.sqlite &&
27 #end if
28 python '${__tool_directory__}/list_spaln_tables.py' --taxonomy_db tax.ncbitaxonomy.sqlite --gnm2tab_file gnm2tab '$taxon' | sort -k1n > '${output}'
29 ]]></command>
30 <inputs>
31 <param name="taxon" label="Scientific name" type="text" />
32 <conditional name="gnm2tab">
33 <param name="gnm2tab_source" type="select" label="Choose source of gnm2tab file">
34 <option value="spaln_tool" selected="true">From the spaln tool installation</option>
35 <option value="history">From dataset in history</option>
36 </param>
37 <when value="spaln_tool" />
38 <when value="history">
39 <param name="gnm2tab_file" type="data" format="tabular" label="gnm2tab file from spaln" help="The gnm2tab file should be from the table directory of spaln v. @TOOL_VERSION@" />
40 </when>
41 </conditional>
42 <conditional name="taxonomy">
43 <param type="select" name="taxonomy_source">
44 <option value="cached" selected="true">Use built-in NCBI Taxonomy SQLite database</option>
45 <option value="history">Use NCBI Taxonomy SQLite database from history</option>
46 </param>
47 <when value="cached">
48 <param type="select" name="taxonomy_sqlite_table" label="NCBI Taxonomy SQLite database">
49 <options from_data_table="ncbi_taxonomy_sqlite">
50 <filter type="sort_by" column="1" />
51 <validator type="no_options" message="No NCBI Taxonomy SQLite database is available" />
52 </options>
53 </param>
54 </when>
55 <when value="history">
56 <param name="taxonomy_sqlite_file" type="data" format="sqlite" label="NCBI Taxonomy SQLite database" />
57 </when>
58 </conditional>
59 </inputs>
60 <outputs>
61 <data name="output" format="tabular">
62 <actions>
63 <action name="column_names" type="metadata" default="dist_all,dist_canonical,common_ancestor,species_code,settings_group,scientific_name" />
64 </actions>
65 </data>
66 </outputs>
67
68 <tests>
69 <test>
70 <param name="taxon" value="Lates calcarifer" />
71 <conditional name="gnm2tab">
72 <param name="gnm2tab_source" value="spaln_tool" />
73 </conditional>
74 <conditional name="taxonomy">
75 <param name="taxonomy_source" value="history" />
76 <param name="taxonomy_sqlite_file" ftype="sqlite" value="sqlite_taxdb/tax.ncbitaxonomy.sqlite" />
77 </conditional>
78 <output name="output">
79 <assert_contents>
80 <has_line_matching expression="5\t4\tActinopteri\tcynosemi\tFish_mdl\tCynoglossus semilaevis" />
81 <has_line_matching expression="30\t7\tEukaryota\tzea_mays\tMagnolio\tZea mays" />
82 </assert_contents>
83 </output>
84 </test>
85 <test>
86 <param name="taxon" value="Lates calcarifer" />
87 <conditional name="gnm2tab">
88 <param name="gnm2tab_source" value="spaln_tool" />
89 </conditional>
90 <conditional name="taxonomy">
91 <param name="taxonomy_source" value="cached" />
92 <param name="taxonomy_sqlite_table" value="sample" />
93 </conditional>
94 <output name="output">
95 <assert_contents>
96 <has_line_matching expression="5\t4\tActinopteri\tcynosemi\tFish_mdl\tCynoglossus semilaevis" />
97 <has_line_matching expression="30\t7\tEukaryota\tzea_mays\tMagnolio\tZea mays" />
98 </assert_contents>
99 </output>
100 </test>
101 <test>
102 <param name="taxon" value="Lates calcarifer" />
103 <conditional name="gnm2tab">
104 <param name="gnm2tab_source" value="history" />
105 <param name="gnm2tab_file" ftype="tabular" value="gnm2tab" />
106 </conditional>
107 <conditional name="taxonomy">
108 <param name="taxonomy_source" value="cached" />
109 <param name="taxonomy_sqlite_table" value="sample" />
110 </conditional>
111 <output name="output">
112 <assert_contents>
113 <has_line_matching expression="5\t4\tActinopteri\tcynosemi\tFish_mdl\tCynoglossus semilaevis" />
114 <has_line_matching expression="30\t7\tEukaryota\tzea_mays\tMagnolio\tZea mays" />
115 </assert_contents>
116 </output>
117 </test>
118 </tests>
119 <help><![CDATA[
120 Spaln has a number of pre-computed settings files to tune its predictions for different species. These
121 are listed in a file named gnm2tab_ in the package. This tool uses the NCBI Taxonomy database to search
122 that able for a suitable (i.e. taxonomically close) set of settings for optimising spaln's alignment
123 predictions.
124
125 Input is the scientific name of a species (as reflected in the NCBI Taxonomy DB), output is
126 information from the gnm2tab file sorted by taxonomic distance from the query species.
127
128 .. _gnm2tab: https://github.com/ogotoh/spaln/blob/master/table/gnm2tab
129 ]]></help>
130 <citations>
131 </citations>
132 </tool>