0
|
1 <?xml version="1.0" ?>
|
|
2 <tool id="qiime_sample-classifier_classify-samples" name="qiime sample-classifier classify-samples" version="2019.4">
|
|
3 <description> - Train and test a cross-validated supervised learning classifier.</description>
|
|
4 <requirements>
|
|
5 <requirement type="package" version="2019.4">qiime2</requirement>
|
|
6 </requirements>
|
|
7 <command><![CDATA[
|
|
8 qiime sample-classifier classify-samples
|
|
9
|
|
10 --i-table=$itable
|
|
11 --m-metadata-column="$mmetadatacolumn"
|
|
12
|
5
|
13 #if str($ptestsize):
|
0
|
14 --p-test-size=$ptestsize
|
|
15 #end if
|
|
16
|
5
|
17 #if str($pstep):
|
0
|
18 --p-step=$pstep
|
|
19 #end if
|
|
20
|
5
|
21 #if str($pcv):
|
0
|
22 --p-cv=$pcv
|
|
23 #end if
|
|
24
|
|
25 #if str($prandomstate):
|
|
26 --p-random-state="$prandomstate"
|
|
27 #end if
|
|
28
|
|
29 #set $pnjobs = '${GALAXY_SLOTS:-4}'
|
|
30
|
|
31 #if str($pnjobs):
|
|
32 --p-n-jobs="$pnjobs"
|
|
33 #end if
|
|
34
|
|
35
|
|
36 #if $pnestimators:
|
|
37 --p-n-estimators=$pnestimators
|
|
38 #end if
|
|
39
|
|
40 #if str($pestimator) != 'None':
|
|
41 --p-estimator=$pestimator
|
|
42 #end if
|
|
43
|
|
44 #if $poptimizefeatureselection:
|
|
45 --p-optimize-feature-selection
|
|
46 #end if
|
|
47
|
|
48 #if $pparametertuning:
|
|
49 --p-parameter-tuning
|
|
50 #end if
|
|
51
|
|
52 #if str($ppalette) != 'None':
|
|
53 --p-palette=$ppalette
|
|
54 #end if
|
|
55
|
|
56 #if str($pmissingsamples) != 'None':
|
|
57 --p-missing-samples=$pmissingsamples
|
|
58 #end if
|
|
59
|
|
60
|
5
|
61 #if $metadatafile:
|
|
62 --m-metadata-file=$metadatafile
|
0
|
63 #end if
|
|
64
|
|
65
|
5
|
66
|
0
|
67 --o-sample-estimator=osampleestimator
|
|
68 --o-feature-importance=ofeatureimportance
|
|
69 --o-predictions=opredictions
|
|
70 --o-model-summary=omodelsummary
|
|
71 --o-accuracy-results=oaccuracyresults
|
|
72 ;
|
|
73 cp osampleestimator.qza $osampleestimator;
|
|
74 cp ofeatureimportance.qza $ofeatureimportance;
|
|
75 cp opredictions.qza $opredictions;
|
|
76 qiime tools export --input-path omodelsummary.qzv --output-path out && mkdir -p '$omodelsummary.files_path'
|
|
77 && cp -r out/* '$omodelsummary.files_path'
|
|
78 && mv '$omodelsummary.files_path/index.html' '$omodelsummary';
|
|
79 qiime tools export --input-path oaccuracyresults.qzv --output-path out && mkdir -p '$oaccuracyresults.files_path'
|
|
80 && cp -r out/* '$oaccuracyresults.files_path'
|
|
81 && mv '$oaccuracyresults.files_path/index.html' '$oaccuracyresults'
|
|
82 ]]></command>
|
|
83 <inputs>
|
|
84 <param format="qza,no_unzip.zip" label="--i-table: ARTIFACT FeatureTable[Frequency] Feature table containing all features that should be used for target prediction. [required]" name="itable" optional="False" type="data"/>
|
|
85 <param label="--m-metadata-column: COLUMN MetadataColumn[Categorical] Categorical metadata column to use as prediction target. [required]" name="mmetadatacolumn" optional="False" type="text"/>
|
|
86 <param 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]" name="ptestsize" optional="True" type="float" value="0.2" min="0" max="1" exclusive_start="True"/>
|
|
87 <param label="--p-step: PROPORTION Range(0.0, 1.0, inclusive_start=False) If optimize-feature-selection is True, step is the percentage of features to remove at each iteration. [default: 0.05]" name="pstep" optional="True" type="float" value="0.05" min="0" max="1" exclusive_start="True"/>
|
|
88 <param label="--p-cv: INTEGER Number of k-fold cross-validations to perform. Range(1, None) [default: 5]" name="pcv" optional="True" type="integer" value="5" min="1"/>
|
|
89 <param label="--p-random-state: INTEGER Seed used by random number generator. [optional]" name="prandomstate" optional="True" type="integer"/>
|
|
90 <param label="--p-n-estimators: INTEGER Range(1, None) Number of trees to grow for estimation. More trees will improve predictive accuracy up to a threshold level, but will also increase time and memory requirements. This parameter only affects ensemble estimators, such as Random Forest, AdaBoost, ExtraTrees, and GradientBoosting. [default: 100]" name="pnestimators" optional="True" type="integer" value="100" min="1"/>
|
|
91 <param label="--p-estimator: " name="pestimator" optional="True" type="select">
|
|
92 <option selected="True" value="None">Selection is Optional</option>
|
|
93 <option value="RandomForestClassifier">RandomForestClassifier</option>
|
|
94 <option value="ExtraTreesClassifier">ExtraTreesClassifier</option>
|
|
95 <option value="GradientBoostingClassifier">GradientBoostingClassifier</option>
|
|
96 <option value="AdaBoostClassifier">AdaBoostClassifier</option>
|
|
97 <option value="KNeighborsClassifier">KNeighborsClassifier</option>
|
|
98 <option value="LinearSVC">LinearSVC</option>
|
|
99 <option value="SVC">SVC</option>
|
|
100 </param>
|
|
101 <param label="--p-optimize-feature-selection: --p-no-optimize-feature-selection Automatically optimize input feature selection using recursive feature elimination. [default: False]" name="poptimizefeatureselection" selected="False" type="boolean"/>
|
|
102 <param label="--p-parameter-tuning: --p-no-parameter-tuning Automatically tune hyperparameters using random grid search. [default: False]" name="pparametertuning" selected="False" type="boolean"/>
|
|
103 <param label="--p-palette: " name="ppalette" optional="True" type="select">
|
|
104 <option selected="True" value="None">Selection is Optional</option>
|
|
105 <option value="YellowOrangeBrown">YellowOrangeBrown</option>
|
|
106 <option value="YellowOrangeRed">YellowOrangeRed</option>
|
|
107 <option value="OrangeRed">OrangeRed</option>
|
|
108 <option value="PurpleRed">PurpleRed</option>
|
|
109 <option value="RedPurple">RedPurple</option>
|
|
110 <option value="BluePurple">BluePurple</option>
|
|
111 <option value="GreenBlue">GreenBlue</option>
|
|
112 <option value="PurpleBlue">PurpleBlue</option>
|
|
113 <option value="YellowGreen">YellowGreen</option>
|
|
114 <option value="summer">summer</option>
|
|
115 <option value="copper">copper</option>
|
|
116 <option value="viridis">viridis</option>
|
|
117 <option value="plasma">plasma</option>
|
|
118 <option value="inferno">inferno</option>
|
|
119 <option value="magma">magma</option>
|
|
120 <option value="sirocco">sirocco</option>
|
|
121 <option value="drifting">drifting</option>
|
|
122 <option value="melancholy">melancholy</option>
|
|
123 <option value="enigma">enigma</option>
|
|
124 <option value="eros">eros</option>
|
|
125 <option value="spectre">spectre</option>
|
|
126 <option value="ambition">ambition</option>
|
|
127 <option value="mysteriousstains">mysteriousstains</option>
|
|
128 <option value="daydream">daydream</option>
|
|
129 <option value="solano">solano</option>
|
|
130 <option value="navarro">navarro</option>
|
|
131 <option value="dandelions">dandelions</option>
|
|
132 <option value="deepblue">deepblue</option>
|
|
133 <option value="verve">verve</option>
|
|
134 <option value="greyscale">greyscale</option>
|
|
135 </param>
|
|
136 <param label="--p-missing-samples: " name="pmissingsamples" optional="True" type="select">
|
|
137 <option selected="True" value="None">Selection is Optional</option>
|
|
138 <option value="error">error</option>
|
|
139 <option value="ignore">ignore</option>
|
|
140 </param>
|
|
141
|
5
|
142 <param label="--m-metadata-file METADATA" name="metadatafile" type="data" format="tabular,qza,no_unzip.zip" />
|
0
|
143
|
|
144 </inputs>
|
|
145 <outputs>
|
|
146 <data format="qza" label="${tool.name} on ${on_string}: sampleestimator.qza" name="osampleestimator"/>
|
|
147 <data format="qza" label="${tool.name} on ${on_string}: featureimportance.qza" name="ofeatureimportance"/>
|
|
148 <data format="qza" label="${tool.name} on ${on_string}: predictions.qza" name="opredictions"/>
|
|
149 <data format="html" label="${tool.name} on ${on_string}: modelsummary.qzv" name="omodelsummary"/>
|
|
150 <data format="html" label="${tool.name} on ${on_string}: accuracyresults.qzv" name="oaccuracyresults"/>
|
|
151 </outputs>
|
|
152 <help><![CDATA[
|
|
153 Train and test a cross-validated supervised learning classifier.
|
|
154 ################################################################
|
|
155
|
|
156 Predicts a categorical sample metadata column using a supervised learning
|
|
157 classifier. Splits input data into training and test sets. The training set
|
|
158 is used to train and test the estimator using a stratified k-fold cross-
|
|
159 validation scheme. This includes optional steps for automated feature
|
|
160 extraction and hyperparameter optimization. The test set validates
|
|
161 classification accuracy of the optimized estimator. Outputs classification
|
|
162 results for test set. For more details on the learning algorithm, see
|
|
163 http://scikit-learn.org/stable/supervised_learning.html
|
|
164
|
|
165 Parameters
|
|
166 ----------
|
|
167 table : FeatureTable[Frequency]
|
|
168 Feature table containing all features that should be used for target
|
|
169 prediction.
|
|
170 metadata : MetadataColumn[Categorical]
|
|
171 Categorical metadata column to use as prediction target.
|
|
172 test_size : Float % Range(0.0, 1.0, inclusive_start=False), optional
|
|
173 Fraction of input samples to exclude from training set and use for
|
|
174 classifier testing.
|
|
175 step : Float % Range(0.0, 1.0, inclusive_start=False), optional
|
|
176 If optimize_feature_selection is True, step is the percentage of
|
|
177 features to remove at each iteration.
|
|
178 cv : Int % Range(1, None), optional
|
|
179 Number of k-fold cross-validations to perform.
|
|
180 random_state : Int, optional
|
|
181 Seed used by random number generator.
|
|
182 n_estimators : Int % Range(1, None), optional
|
|
183 Number of trees to grow for estimation. More trees will improve
|
|
184 predictive accuracy up to a threshold level, but will also increase
|
|
185 time and memory requirements. This parameter only affects ensemble
|
|
186 estimators, such as Random Forest, AdaBoost, ExtraTrees, and
|
|
187 GradientBoosting.
|
|
188 estimator : Str % Choices('RandomForestClassifier', 'ExtraTreesClassifier', 'GradientBoostingClassifier', 'AdaBoostClassifier', 'KNeighborsClassifier', 'LinearSVC', 'SVC'), optional
|
|
189 Estimator method to use for sample prediction.
|
|
190 optimize_feature_selection : Bool, optional
|
|
191 Automatically optimize input feature selection using recursive feature
|
|
192 elimination.
|
|
193 parameter_tuning : Bool, optional
|
|
194 Automatically tune hyperparameters using random grid search.
|
|
195 palette : Str % Choices('YellowOrangeBrown', 'YellowOrangeRed', 'OrangeRed', 'PurpleRed', 'RedPurple', 'BluePurple', 'GreenBlue', 'PurpleBlue', 'YellowGreen', 'summer', 'copper', 'viridis', 'plasma', 'inferno', 'magma', 'sirocco', 'drifting', 'melancholy', 'enigma', 'eros', 'spectre', 'ambition', 'mysteriousstains', 'daydream', 'solano', 'navarro', 'dandelions', 'deepblue', 'verve', 'greyscale'), optional
|
|
196 The color palette to use for plotting.
|
|
197 missing_samples : Str % Choices('error', 'ignore'), optional
|
|
198 How to handle missing samples in metadata. "error" will fail if missing
|
|
199 samples are detected. "ignore" will cause the feature table and
|
|
200 metadata to be filtered, so that only samples found in both files are
|
|
201 retained.
|
|
202
|
|
203 Returns
|
|
204 -------
|
|
205 sample_estimator : SampleEstimator[Classifier]
|
|
206 Trained sample estimator.
|
|
207 feature_importance : FeatureData[Importance]
|
|
208 Importance of each input feature to model accuracy.
|
|
209 predictions : SampleData[ClassifierPredictions]
|
|
210 Predicted target values for each input sample.
|
|
211 model_summary : Visualization
|
|
212 Summarized parameter and (if enabled) feature selection information for
|
|
213 the trained estimator.
|
|
214 accuracy_results : Visualization
|
|
215 Accuracy results visualization.
|
|
216 ]]></help>
|
|
217 <macros>
|
|
218 <import>qiime_citation.xml</import>
|
|
219 </macros>
|
|
220 <expand macro="qiime_citation"/>
|
|
221 </tool>
|