annotate qiime2-2020.8/qiime_sample-classifier_classify-samples-ncv.xml @ 22:292c84bd5ab6 draft

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