view qiime2-2020.8/qiime_sample-classifier_classify-samples-from-dist.xml @ 0:5c352d975ef7 draft

Uploaded
author florianbegusch
date Thu, 03 Sep 2020 09:33:04 +0000
parents
children
line wrap: on
line source

<?xml version="1.0" ?>
<tool id="qiime_sample-classifier_classify-samples-from-dist" name="qiime sample-classifier classify-samples-from-dist"
      version="2020.8">
  <description>Run k-nearest-neighbors on a labeled distance matrix.</description>
  <requirements>
    <requirement type="package" version="2020.8">qiime2</requirement>
  </requirements>
  <command><![CDATA[
qiime sample-classifier classify-samples-from-dist

--i-distance-matrix=$idistancematrix
# 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 '__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

--m-metadata-column=$mmetadatacolumn


--p-k=$pk

#if str($ppalette) != 'None':
--p-palette=$ppalette
#end if

--o-predictions=opredictions

--o-accuracy-results=oaccuracyresults

#if str($examples) != 'None':
--examples=$examples
#end if

;
cp opredictions.qza $opredictions

;
qiime tools export  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-distance-matrix: ARTIFACT DistanceMatrix     a distance matrix                            [required]" name="idistancematrix" 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 label="--p-k: INTEGER        Number of nearest neighbors                [default: 1]" name="pk" optional="True" type="integer" value="1" />
    <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="--examples: Show usage examples and exit." name="examples" optional="False" type="data" />
    
  </inputs>

  <outputs>
    <data format="qza" label="${tool.name} on ${on_string}: predictions.qza" name="opredictions" />
    <data format="html" label="${tool.name} on ${on_string}: accuracyresults.html" name="oaccuracyresults" />
    
  </outputs>

  <help><![CDATA[
Run k-nearest-neighbors on a labeled distance matrix.
###############################################################

Run k-nearest-neighbors on a labeled distance matrix. Return cross-
validated (leave one out) predictions and  accuracy. k = 1 by default

Parameters
----------
distance_matrix : DistanceMatrix
    a distance matrix
metadata : MetadataColumn[Categorical]
    Categorical metadata column to use as prediction target.
k : Int, optional
    Number of nearest neighbors
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.

Returns
-------
predictions : SampleData[ClassifierPredictions]
    leave one out predictions for each sample
accuracy_results : Visualization
    Accuracy results visualization.
  ]]></help>
  <macros>
    <import>qiime_citation.xml</import>
  </macros>
  <expand macro="qiime_citation"/>
</tool>