annotate qiime2/qiime_sample-classifier_fit-classifier.xml @ 29:3ba9833030c1 draft

Uploaded
author florianbegusch
date Fri, 04 Sep 2020 13:12:49 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
1 <?xml version="1.0" ?>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
2 <tool id="qiime_sample-classifier_fit-classifier" name="qiime sample-classifier fit-classifier"
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
3 version="2020.8">
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
4 <description>Fit a supervised learning classifier.</description>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
5 <requirements>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
6 <requirement type="package" version="2020.8">qiime2</requirement>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
7 </requirements>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
8 <command><![CDATA[
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
9 qiime sample-classifier fit-classifier
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
10
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
11 --i-table=$itable
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
12 # if $input_files_mmetadatafile:
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
13 # def list_dict_to_string(list_dict):
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
14 # set $file_list = list_dict[0]['additional_input'].__getattr__('file_name')
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
15 # for d in list_dict[1:]:
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
16 # set $file_list = $file_list + ' --m-metadata-file=' + d['additional_input'].__getattr__('file_name')
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
17 # end for
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
18 # return $file_list
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
19 # end def
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
20 --m-metadata-file=$list_dict_to_string($input_files_mmetadatafile)
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
21 # end if
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
22
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
23 #if '__ob__' in str($mmetadatacolumn):
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
24 #set $mmetadatacolumn_temp = $mmetadatacolumn.replace('__ob__', '[')
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
25 #set $mmetadatacolumn = $mmetadatacolumn_temp
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
26 #end if
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
27 #if '__cb__' in str($mmetadatacolumn):
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
28 #set $mmetadatacolumn_temp = $mmetadatacolumn.replace('__cb__', ']')
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
29 #set $mmetadatacolumn = $mmetadatacolumn_temp
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
30 #end if
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
31 #if 'X' in str($mmetadatacolumn):
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
32 #set $mmetadatacolumn_temp = $mmetadatacolumn.replace('X', '\\')
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
33 #set $mmetadatacolumn = $mmetadatacolumn_temp
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
34 #end if
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
35 #if '__sq__' in str($mmetadatacolumn):
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
36 #set $mmetadatacolumn_temp = $mmetadatacolumn.replace('__sq__', "'")
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
37 #set $mmetadatacolumn = $mmetadatacolumn_temp
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
38 #end if
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
39 #if '__db__' in str($mmetadatacolumn):
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
40 #set $mmetadatacolumn_temp = $mmetadatacolumn.replace('__db__', '"')
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
41 #set $mmetadatacolumn = $mmetadatacolumn_temp
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
42 #end if
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
43
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
44 --m-metadata-column=$mmetadatacolumn
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
45
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
46
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
47 --p-step=$pstep
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
48
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
49 --p-cv=$pcv
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
50
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
51 #if str($prandomstate):
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
52 --p-random-state=$prandomstate
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
53 #end if
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
54 --p-n-jobs=$pnjobs
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
55
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
56 --p-n-estimators=$pnestimators
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
57
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
58 #if str($pestimator) != 'None':
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
59 --p-estimator=$pestimator
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
60 #end if
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
61
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
62 #if $poptimizefeatureselection:
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
63 --p-optimize-feature-selection
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
64 #end if
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
65
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
66 #if $pparametertuning:
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
67 --p-parameter-tuning
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
68 #end if
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
69
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
70 #if str($pmissingsamples) != 'None':
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
71 --p-missing-samples=$pmissingsamples
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
72 #end if
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
73
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
74 --o-sample-estimator=osampleestimator
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
75
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
76 --o-feature-importance=ofeatureimportance
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
77
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
78 #if str($examples) != 'None':
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
79 --examples=$examples
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
80 #end if
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
81
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
82 ;
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
83 cp ofeatureimportance.qza $ofeatureimportance
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
84
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
85 ]]></command>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
86 <inputs>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
87 <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" />
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
88 <repeat name="input_files_mmetadatafile" optional="True" title="--m-metadata-file">
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
89 <param format="tabular,qza,no_unzip.zip" label="--m-metadata-file: METADATA" name="additional_input" optional="True" type="data" />
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
90 </repeat>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
91 <param label="--m-metadata-column: COLUMN MetadataColumn[Categorical] Numeric metadata column to use as prediction target. [required]" name="mmetadatacolumn" optional="False" type="text" />
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
92 <param exclude_min="True" 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]" max="1.0" min="0.0" name="pstep" optional="True" type="float" value="0.05" />
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
93 <param label="--p-cv: INTEGER Number of k-fold cross-validations to perform. Range(1, None) [default: 5]" min="1" name="pcv" optional="True" type="integer" value="5" />
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
94 <param label="--p-random-state: INTEGER Seed used by random number generator. [optional]" name="prandomstate" optional="False" type="text" />
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
95 <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]" min="1" name="pnestimators" optional="True" type="integer" value="100" />
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
96 <param label="--p-estimator: " name="pestimator" optional="True" type="select">
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
97 <option selected="True" value="None">Selection is Optional</option>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
98 <option value="RandomForestClassifier">RandomForestClassifier</option>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
99 <option value="ExtraTreesClassifier">ExtraTreesClassifier</option>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
100 <option value="GradientBoostingClassifier">GradientBoostingClassifier</option>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
101 <option value="AdaBoostClassifier">AdaBoostClassifier</option>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
102 <option value="KNeighborsClassifier">KNeighborsClassifier</option>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
103 <option value="LinearSVC">LinearSVC</option>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
104 <option value="SVC">SVC</option>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
105 </param>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
106 <param label="--p-optimize-feature-selection: --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" />
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
107 <param label="--p-parameter-tuning: --p-parameter-tuning: / --p-no-parameter-tuning Automatically tune hyperparameters using random grid search. [default: False]" name="pparametertuning" selected="False" type="boolean" />
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
108 <param label="--p-missing-samples: " name="pmissingsamples" optional="True" type="select">
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
109 <option selected="True" value="None">Selection is Optional</option>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
110 <option value="error">error</option>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
111 <option value="ignore">ignore</option>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
112 </param>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
113 <param label="--examples: Show usage examples and exit." name="examples" optional="False" type="data" />
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
114
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
115 </inputs>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
116
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
117 <outputs>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
118 <data format="qza" label="${tool.name} on ${on_string}: sampleestimator.qza" name="osampleestimator" />
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
119 <data format="qza" label="${tool.name} on ${on_string}: featureimportance.qza" name="ofeatureimportance" />
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
120
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
121 </outputs>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
122
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
123 <help><![CDATA[
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
124 Fit a supervised learning classifier.
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
125 ###############################################################
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
126
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
127 Fit a supervised learning classifier. Outputs the fit estimator (for
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
128 prediction of test samples and/or unknown samples) and the relative
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
129 importance of each feature for model accuracy. Optionally use k-fold cross-
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
130 validation for automatic recursive feature elimination and hyperparameter
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
131 tuning.
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
132
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
133 Parameters
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
134 ----------
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
135 table : FeatureTable[Frequency]
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
136 Feature table containing all features that should be used for target
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
137 prediction.
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
138 metadata : MetadataColumn[Categorical]
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
139 Numeric metadata column to use as prediction target.
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
140 step : Float % Range(0.0, 1.0, inclusive_start=False), optional
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
141 If optimize_feature_selection is True, step is the percentage of
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
142 features to remove at each iteration.
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
143 cv : Int % Range(1, None), optional
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
144 Number of k-fold cross-validations to perform.
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
145 random_state : Int, optional
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
146 Seed used by random number generator.
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
147 n_jobs : Int, optional
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
148 Number of jobs to run in parallel.
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
149 n_estimators : Int % Range(1, None), optional
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
150 Number of trees to grow for estimation. More trees will improve
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
151 predictive accuracy up to a threshold level, but will also increase
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
152 time and memory requirements. This parameter only affects ensemble
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
153 estimators, such as Random Forest, AdaBoost, ExtraTrees, and
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
154 GradientBoosting.
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
155 estimator : Str % Choices('RandomForestClassifier', 'ExtraTreesClassifier', 'GradientBoostingClassifier', 'AdaBoostClassifier', 'KNeighborsClassifier', 'LinearSVC', 'SVC'), optional
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
156 Estimator method to use for sample prediction.
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
157 optimize_feature_selection : Bool, optional
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
158 Automatically optimize input feature selection using recursive feature
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
159 elimination.
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
160 parameter_tuning : Bool, optional
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
161 Automatically tune hyperparameters using random grid search.
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
162 missing_samples : Str % Choices('error', 'ignore'), optional
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
163 How to handle missing samples in metadata. "error" will fail if missing
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
164 samples are detected. "ignore" will cause the feature table and
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
165 metadata to be filtered, so that only samples found in both files are
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
166 retained.
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
167
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
168 Returns
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
169 -------
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
170 sample_estimator : SampleEstimator[Classifier]
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
171 Trained sample classifier.
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
172 feature_importance : FeatureData[Importance]
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
173 Importance of each input feature to model accuracy.
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
174 ]]></help>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
175 <macros>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
176 <import>qiime_citation.xml</import>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
177 </macros>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
178 <expand macro="qiime_citation"/>
3ba9833030c1 Uploaded
florianbegusch
parents:
diff changeset
179 </tool>