diff qiime2/qiime_sample-classifier_classify-samples.xml @ 14:a0a8d77a991c draft

Uploaded
author florianbegusch
date Thu, 03 Sep 2020 09:51:29 +0000
parents f190567fe3f6
children
line wrap: on
line diff
--- a/qiime2/qiime_sample-classifier_classify-samples.xml	Thu Sep 03 09:46:00 2020 +0000
+++ b/qiime2/qiime_sample-classifier_classify-samples.xml	Thu Sep 03 09:51:29 2020 +0000
@@ -1,44 +1,64 @@
 <?xml version="1.0" ?>
-<tool id="qiime_sample-classifier_classify-samples" name="qiime sample-classifier classify-samples" version="2019.7">
-	<description> - Train and test a cross-validated supervised learning classifier.</description>
-	<requirements>
-		<requirement type="package" version="2019.7">qiime2</requirement>
-	</requirements>
-	<command><![CDATA[
+<tool id="qiime_sample-classifier_classify-samples" name="qiime sample-classifier classify-samples"
+      version="2020.8">
+  <description>Train and test a cross-validated supervised learning classifier.</description>
+  <requirements>
+    <requirement type="package" version="2020.8">qiime2</requirement>
+  </requirements>
+  <command><![CDATA[
 qiime sample-classifier classify-samples
 
 --i-table=$itable
---m-metadata-column="$mmetadatacolumn"
+# if $input_files_mmetadatafile:
+  # def list_dict_to_string(list_dict):
+    # set $file_list = list_dict[0]['additional_input'].__getattr__('file_name')
+    # for d in list_dict[1:]:
+      # set $file_list = $file_list + ' --m-metadata-file=' + d['additional_input'].__getattr__('file_name')
+    # end for
+    # return $file_list
+  # end def
+--m-metadata-file=$list_dict_to_string($input_files_mmetadatafile)
+# end if
 
-#if str($ptestsize):
- --p-test-size=$ptestsize
+#if '__ob__' in str($mmetadatacolumn):
+  #set $mmetadatacolumn_temp = $mmetadatacolumn.replace('__ob__', '[')
+  #set $mmetadatacolumn = $mmetadatacolumn_temp
+#end if
+#if '__cb__' in str($mmetadatacolumn):
+  #set $mmetadatacolumn_temp = $mmetadatacolumn.replace('__cb__', ']')
+  #set $mmetadatacolumn = $mmetadatacolumn_temp
+#end if
+#if 'X' in str($mmetadatacolumn):
+  #set $mmetadatacolumn_temp = $mmetadatacolumn.replace('X', '\\')
+  #set $mmetadatacolumn = $mmetadatacolumn_temp
+#end if
+#if '__sq__' in str($mmetadatacolumn):
+  #set $mmetadatacolumn_temp = $mmetadatacolumn.replace('__sq__', "'")
+  #set $mmetadatacolumn = $mmetadatacolumn_temp
+#end if
+#if '__db__' in str($mmetadatacolumn):
+  #set $mmetadatacolumn_temp = $mmetadatacolumn.replace('__db__', '"')
+  #set $mmetadatacolumn = $mmetadatacolumn_temp
 #end if
 
-#if str($pstep):
- --p-step=$pstep
-#end if
+--m-metadata-column=$mmetadatacolumn
+
 
-#if str($pcv):
- --p-cv=$pcv
-#end if
+--p-test-size=$ptestsize
+
+--p-step=$pstep
+
+--p-cv=$pcv
 
 #if str($prandomstate):
- --p-random-state="$prandomstate"
+  --p-random-state=$prandomstate
 #end if
-
-#set $pnjobs = '${GALAXY_SLOTS:-4}'
+--p-n-jobs=$pnjobs
 
-#if str($pnjobs):
- --p-n-jobs="$pnjobs"
-#end if
-
-
-#if $pnestimators:
- --p-n-estimators=$pnestimators
-#end if
+--p-n-estimators=$pnestimators
 
 #if str($pestimator) != 'None':
- --p-estimator=$pestimator
+--p-estimator=$pestimator
 #end if
 
 #if $poptimizefeatureselection:
@@ -50,111 +70,121 @@
 #end if
 
 #if str($ppalette) != 'None':
- --p-palette=$ppalette
+--p-palette=$ppalette
 #end if
 
 #if str($pmissingsamples) != 'None':
- --p-missing-samples=$pmissingsamples
+--p-missing-samples=$pmissingsamples
 #end if
 
+--o-sample-estimator=osampleestimator
 
-#if $metadatafile:
- --m-metadata-file=$metadatafile
-#end if
+--o-feature-importance=ofeatureimportance
+
+--o-predictions=opredictions
 
+--o-model-summary=omodelsummary
 
+--o-accuracy-results=oaccuracyresults
 
 --o-probabilities=oprobabilities
---o-sample-estimator=osampleestimator
---o-feature-importance=ofeatureimportance
---o-predictions=opredictions
---o-model-summary=omodelsummary
---o-accuracy-results=oaccuracyresults
+
+--o-heatmap=oheatmap
+
+#if str($examples) != 'None':
+--examples=$examples
+#end if
+
+;
+cp oprobabilities.qza $oprobabilities
+
 ;
-cp oprobabilities.qza $oprobabilities;
-cp osampleestimator.qza $osampleestimator;
-cp ofeatureimportance.qza $ofeatureimportance;
-cp opredictions.qza $opredictions;
-qiime tools export --input-path omodelsummary.qzv --output-path out   && mkdir -p '$omodelsummary.files_path'
-&& cp -r out/* '$omodelsummary.files_path'
-&& mv '$omodelsummary.files_path/index.html' '$omodelsummary';
-qiime tools export --input-path oaccuracyresults.qzv --output-path out   && mkdir -p '$oaccuracyresults.files_path'
-&& cp -r out/* '$oaccuracyresults.files_path'
-&& mv '$oaccuracyresults.files_path/index.html' '$oaccuracyresults'
-	]]></command>
-	<inputs>
-		<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"/>
-		<param label="--m-metadata-column: COLUMN  MetadataColumn[Categorical] Categorical metadata column to use as prediction target.                                      [required]" name="mmetadatacolumn" optional="False" type="text"/>
-		<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"/>
-		<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"/>
-		<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"/>
-		<param label="--p-random-state: INTEGER Seed used by random number generator.        [optional]" name="prandomstate" optional="True" type="integer"/>
-		<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"/>
-		<param label="--p-estimator: " name="pestimator" optional="True" type="select">
-			<option selected="True" value="None">Selection is Optional</option>
-			<option value="RandomForestClassifier">RandomForestClassifier</option>
-			<option value="ExtraTreesClassifier">ExtraTreesClassifier</option>
-			<option value="GradientBoostingClassifier">GradientBoostingClassifier</option>
-			<option value="AdaBoostClassifier">AdaBoostClassifier</option>
-			<option value="KNeighborsClassifier">KNeighborsClassifier</option>
-			<option value="LinearSVC">LinearSVC</option>
-			<option value="SVC">SVC</option>
-		</param>
-		<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"/>
-		<param label="--p-parameter-tuning: --p-no-parameter-tuning Automatically tune hyperparameters using random grid search.                                [default: False]" name="pparametertuning" selected="False" type="boolean"/>
-		<param label="--p-palette: " name="ppalette" optional="True" type="select">
-			<option selected="True" value="None">Selection is Optional</option>
-			<option value="YellowOrangeBrown">YellowOrangeBrown</option>
-			<option value="YellowOrangeRed">YellowOrangeRed</option>
-			<option value="OrangeRed">OrangeRed</option>
-			<option value="PurpleRed">PurpleRed</option>
-			<option value="RedPurple">RedPurple</option>
-			<option value="BluePurple">BluePurple</option>
-			<option value="GreenBlue">GreenBlue</option>
-			<option value="PurpleBlue">PurpleBlue</option>
-			<option value="YellowGreen">YellowGreen</option>
-			<option value="summer">summer</option>
-			<option value="copper">copper</option>
-			<option value="viridis">viridis</option>
-			<option value="plasma">plasma</option>
-			<option value="inferno">inferno</option>
-			<option value="magma">magma</option>
-			<option value="sirocco">sirocco</option>
-			<option value="drifting">drifting</option>
-			<option value="melancholy">melancholy</option>
-			<option value="enigma">enigma</option>
-			<option value="eros">eros</option>
-			<option value="spectre">spectre</option>
-			<option value="ambition">ambition</option>
-			<option value="mysteriousstains">mysteriousstains</option>
-			<option value="daydream">daydream</option>
-			<option value="solano">solano</option>
-			<option value="navarro">navarro</option>
-			<option value="dandelions">dandelions</option>
-			<option value="deepblue">deepblue</option>
-			<option value="verve">verve</option>
-			<option value="greyscale">greyscale</option>
-		</param>
-		<param label="--p-missing-samples: " name="pmissingsamples" optional="True" type="select">
-			<option selected="True" value="None">Selection is Optional</option>
-			<option value="error">error</option>
-			<option value="ignore">ignore</option>
-		</param>
+qiime tools export  oheatmap.qzv --output-path out
+&& mkdir -p '$oheatmap.files_path'
+&& cp -r out/* '$oheatmap.files_path'
+&& mv '$oheatmap.files_path/index.html' '$oheatmap'
 
-		<param label="--m-metadata-file METADATA" name="metadatafile" type="data" format="tabular,qza,no_unzip.zip" />
+  ]]></command>
+  <inputs>
+    <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" />
+    <repeat name="input_files_mmetadatafile" optional="True" title="--m-metadata-file">
+      <param format="tabular,qza,no_unzip.zip" label="--m-metadata-file: METADATA" name="additional_input" optional="True" type="data" />
+    </repeat>
+    <param label="--m-metadata-column: COLUMN  MetadataColumn[Categorical] Categorical metadata column to use as prediction target.                                      [required]" name="mmetadatacolumn" optional="False" type="text" />
+    <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" />
+    <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" />
+    <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" />
+    <param label="--p-random-state: INTEGER Seed used by random number generator.        [optional]" name="prandomstate" optional="False" type="text" />
+    <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" />
+    <param label="--p-estimator: " name="pestimator" optional="True" type="select">
+      <option selected="True" value="None">Selection is Optional</option>
+      <option value="RandomForestClassifier">RandomForestClassifier</option>
+      <option value="ExtraTreesClassifier">ExtraTreesClassifier</option>
+      <option value="GradientBoostingClassifier">GradientBoostingClassifier</option>
+      <option value="AdaBoostClassifier">AdaBoostClassifier</option>
+      <option value="KNeighborsClassifier">KNeighborsClassifier</option>
+      <option value="LinearSVC">LinearSVC</option>
+      <option value="SVC">SVC</option>
+    </param>
+    <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" />
+    <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" />
+    <param label="--p-palette: " name="ppalette" optional="True" type="select">
+      <option selected="True" value="None">Selection is Optional</option>
+      <option value="YellowOrangeBrown">YellowOrangeBrown</option>
+      <option value="YellowOrangeRed">YellowOrangeRed</option>
+      <option value="OrangeRed">OrangeRed</option>
+      <option value="PurpleRed">PurpleRed</option>
+      <option value="RedPurple">RedPurple</option>
+      <option value="BluePurple">BluePurple</option>
+      <option value="GreenBlue">GreenBlue</option>
+      <option value="PurpleBlue">PurpleBlue</option>
+      <option value="YellowGreen">YellowGreen</option>
+      <option value="summer">summer</option>
+      <option value="copper">copper</option>
+      <option value="viridis">viridis</option>
+      <option value="cividis">cividis</option>
+      <option value="plasma">plasma</option>
+      <option value="inferno">inferno</option>
+      <option value="magma">magma</option>
+      <option value="sirocco">sirocco</option>
+      <option value="drifting">drifting</option>
+      <option value="melancholy">melancholy</option>
+      <option value="enigma">enigma</option>
+      <option value="eros">eros</option>
+      <option value="spectre">spectre</option>
+      <option value="ambition">ambition</option>
+      <option value="mysteriousstains">mysteriousstains</option>
+      <option value="daydream">daydream</option>
+      <option value="solano">solano</option>
+      <option value="navarro">navarro</option>
+      <option value="dandelions">dandelions</option>
+      <option value="deepblue">deepblue</option>
+      <option value="verve">verve</option>
+      <option value="greyscale">greyscale</option>
+    </param>
+    <param label="--p-missing-samples: " name="pmissingsamples" optional="True" type="select">
+      <option selected="True" value="None">Selection is Optional</option>
+      <option value="error">error</option>
+      <option value="ignore">ignore</option>
+    </param>
+    <param label="--examples: Show usage examples and exit." name="examples" optional="False" type="data" />
+    
+  </inputs>
 
-	</inputs>
-	<outputs>
-		<data format="qza" label="${tool.name} on ${on_string}: probabilities.qza" name="oprobabilities"/>
-		<data format="qza" label="${tool.name} on ${on_string}: sampleestimator.qza" name="osampleestimator"/>
-		<data format="qza" label="${tool.name} on ${on_string}: featureimportance.qza" name="ofeatureimportance"/>
-		<data format="qza" label="${tool.name} on ${on_string}: predictions.qza" name="opredictions"/>
-		<data format="html" label="${tool.name} on ${on_string}: modelsummary.qzv" name="omodelsummary"/>
-		<data format="html" label="${tool.name} on ${on_string}: accuracyresults.qzv" name="oaccuracyresults"/>
-	</outputs>
-	<help><![CDATA[
+  <outputs>
+    <data format="qza" label="${tool.name} on ${on_string}: sampleestimator.qza" name="osampleestimator" />
+    <data format="qza" label="${tool.name} on ${on_string}: featureimportance.qza" name="ofeatureimportance" />
+    <data format="qza" label="${tool.name} on ${on_string}: predictions.qza" name="opredictions" />
+    <data format="html" label="${tool.name} on ${on_string}: modelsummary.html" name="omodelsummary" />
+    <data format="html" label="${tool.name} on ${on_string}: accuracyresults.html" name="oaccuracyresults" />
+    <data format="qza" label="${tool.name} on ${on_string}: probabilities.qza" name="oprobabilities" />
+    <data format="html" label="${tool.name} on ${on_string}: heatmap.html" name="oheatmap" />
+    
+  </outputs>
+
+  <help><![CDATA[
 Train and test a cross-validated supervised learning classifier.
-################################################################
+###############################################################
 
 Predicts a categorical sample metadata column using a supervised learning
 classifier. Splits input data into training and test sets. The training set
@@ -182,6 +212,8 @@
     Number of k-fold cross-validations to perform.
 random_state : Int, optional
     Seed used by random number generator.
+n_jobs : Int, optional
+    Number of jobs to run in parallel.
 n_estimators : Int % Range(1, None), optional
     Number of trees to grow for estimation. More trees will improve
     predictive accuracy up to a threshold level, but will also increase
@@ -195,7 +227,7 @@
     elimination.
 parameter_tuning : Bool, optional
     Automatically tune hyperparameters using random grid search.
-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
+palette : Str % Choices('YellowOrangeBrown', 'YellowOrangeRed', 'OrangeRed', 'PurpleRed', 'RedPurple', 'BluePurple', 'GreenBlue', 'PurpleBlue', 'YellowGreen', 'summer', 'copper', 'viridis', 'cividis', 'plasma', 'inferno', 'magma', 'sirocco', 'drifting', 'melancholy', 'enigma', 'eros', 'spectre', 'ambition', 'mysteriousstains', 'daydream', 'solano', 'navarro', 'dandelions', 'deepblue', 'verve', 'greyscale'), optional
     The color palette to use for plotting.
 missing_samples : Str % Choices('error', 'ignore'), optional
     How to handle missing samples in metadata. "error" will fail if missing
@@ -218,9 +250,11 @@
     Accuracy results visualization.
 probabilities : SampleData[Probabilities]
     Predicted class probabilities for each input sample.
-	]]></help>
-<macros>
+heatmap : Visualization
+    A heatmap of the top 50 most important features from the table.
+  ]]></help>
+  <macros>
     <import>qiime_citation.xml</import>
-</macros>
-<expand macro="qiime_citation"/>
-</tool>
+  </macros>
+  <expand macro="qiime_citation"/>
+</tool>
\ No newline at end of file