comparison qiime2-2020.8/qiime_sample-classifier_split-table.xml @ 20:d93d8888f0b0 draft

Uploaded
author florianbegusch
date Fri, 04 Sep 2020 12:44:24 +0000
parents
children
comparison
equal deleted inserted replaced
19:6c48f8d82424 20:d93d8888f0b0
1 <?xml version="1.0" ?>
2 <tool id="qiime_sample-classifier_split-table" name="qiime sample-classifier split-table"
3 version="2020.8">
4 <description>Split a feature table into training and testing sets.</description>
5 <requirements>
6 <requirement type="package" version="2020.8">qiime2</requirement>
7 </requirements>
8 <command><![CDATA[
9 qiime sample-classifier split-table
10
11 --i-table=$itable
12 # if $input_files_mmetadatafile:
13 # def list_dict_to_string(list_dict):
14 # set $file_list = list_dict[0]['additional_input'].__getattr__('file_name')
15 # for d in list_dict[1:]:
16 # set $file_list = $file_list + ' --m-metadata-file=' + d['additional_input'].__getattr__('file_name')
17 # end for
18 # return $file_list
19 # end def
20 --m-metadata-file=$list_dict_to_string($input_files_mmetadatafile)
21 # end if
22
23 #if '__ob__' in str($mmetadatacolumn):
24 #set $mmetadatacolumn_temp = $mmetadatacolumn.replace('__ob__', '[')
25 #set $mmetadatacolumn = $mmetadatacolumn_temp
26 #end if
27 #if '__cb__' in str($mmetadatacolumn):
28 #set $mmetadatacolumn_temp = $mmetadatacolumn.replace('__cb__', ']')
29 #set $mmetadatacolumn = $mmetadatacolumn_temp
30 #end if
31 #if 'X' in str($mmetadatacolumn):
32 #set $mmetadatacolumn_temp = $mmetadatacolumn.replace('X', '\\')
33 #set $mmetadatacolumn = $mmetadatacolumn_temp
34 #end if
35 #if '__sq__' in str($mmetadatacolumn):
36 #set $mmetadatacolumn_temp = $mmetadatacolumn.replace('__sq__', "'")
37 #set $mmetadatacolumn = $mmetadatacolumn_temp
38 #end if
39 #if '__db__' in str($mmetadatacolumn):
40 #set $mmetadatacolumn_temp = $mmetadatacolumn.replace('__db__', '"')
41 #set $mmetadatacolumn = $mmetadatacolumn_temp
42 #end if
43
44 --m-metadata-column=$mmetadatacolumn
45
46
47 --p-test-size=$ptestsize
48
49 #if str($prandomstate):
50 --p-random-state=$prandomstate
51 #end if
52 #if $pnostratify:
53 --p-no-stratify
54 #end if
55
56 #if str($pmissingsamples) != 'None':
57 --p-missing-samples=$pmissingsamples
58 #end if
59
60 --o-training-table=otrainingtable
61
62 --o-test-table=otesttable
63
64 #if str($examples) != 'None':
65 --examples=$examples
66 #end if
67
68 ;
69 cp otesttable.qza $otesttable
70
71 ]]></command>
72 <inputs>
73 <param format="qza,no_unzip.zip" label="--i-table: ARTIFACT FeatureTable[Frequency¹ | RelativeFrequency² | PresenceAbsence³ | Balance⁴ | PercentileNormalized⁵ | Design⁶] Feature table containing all features that should be used for target prediction. [required]" name="itable" optional="False" type="data" />
74 <repeat name="input_files_mmetadatafile" optional="True" title="--m-metadata-file">
75 <param format="tabular,qza,no_unzip.zip" label="--m-metadata-file: METADATA" name="additional_input" optional="True" type="data" />
76 </repeat>
77 <param label="--m-metadata-column: COLUMN MetadataColumn[Numeric | Categorical] Numeric metadata column to use as prediction target. [required]" name="mmetadatacolumn" optional="False" type="text" />
78 <param exclude_min="True" label="--p-test-size: PROPORTION Range(0.0, 1.0, inclusive_start=False) Fraction of input samples to exclude from training set and use for classifier testing. [default: 0.2]" max="1.0" min="0.0" name="ptestsize" optional="True" type="float" value="0.2" />
79 <param label="--p-random-state: INTEGER Seed used by random number generator. [optional]" name="prandomstate" optional="False" type="text" />
80 <param label="--p-no-stratify: Do not evenly stratify training and test data among metadata categories. If True, all values in column must match at least two samples. [default: True]" name="pnostratify" selected="False" type="boolean" />
81 <param label="--p-missing-samples: " name="pmissingsamples" optional="True" type="select">
82 <option selected="True" value="None">Selection is Optional</option>
83 <option value="error">error</option>
84 <option value="ignore">ignore</option>
85 </param>
86 <param label="--examples: Show usage examples and exit." name="examples" optional="False" type="data" />
87
88 </inputs>
89
90 <outputs>
91 <data format="qza" label="${tool.name} on ${on_string}: trainingtable.qza" name="otrainingtable" />
92 <data format="qza" label="${tool.name} on ${on_string}: testtable.qza" name="otesttable" />
93
94 </outputs>
95
96 <help><![CDATA[
97 Split a feature table into training and testing sets.
98 ###############################################################
99
100 Split a feature table into training and testing sets. By default stratifies
101 training and test sets on a metadata column, such that values in that
102 column are evenly represented across training and test sets.
103
104 Parameters
105 ----------
106 table : FeatureTable[Frequency¹ | RelativeFrequency² | PresenceAbsence³ | Balance⁴ | PercentileNormalized⁵ | Design⁶]
107 Feature table containing all features that should be used for target
108 prediction.
109 metadata : MetadataColumn[Numeric | Categorical]
110 Numeric metadata column to use as prediction target.
111 test_size : Float % Range(0.0, 1.0, inclusive_start=False), optional
112 Fraction of input samples to exclude from training set and use for
113 classifier testing.
114 random_state : Int, optional
115 Seed used by random number generator.
116 stratify : Bool, optional
117 Evenly stratify training and test data among metadata categories. If
118 True, all values in column must match at least two samples.
119 missing_samples : Str % Choices('error', 'ignore'), optional
120 How to handle missing samples in metadata. "error" will fail if missing
121 samples are detected. "ignore" will cause the feature table and
122 metadata to be filtered, so that only samples found in both files are
123 retained.
124
125 Returns
126 -------
127 training_table : FeatureTable[Frequency¹ | RelativeFrequency² | PresenceAbsence³ | Balance⁴ | PercentileNormalized⁵ | Design⁶]
128 Feature table containing training samples
129 test_table : FeatureTable[Frequency¹ | RelativeFrequency² | PresenceAbsence³ | Balance⁴ | PercentileNormalized⁵ | Design⁶]
130 Feature table containing test samples
131 ]]></help>
132 <macros>
133 <import>qiime_citation.xml</import>
134 </macros>
135 <expand macro="qiime_citation"/>
136 </tool>