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