Mercurial > repos > florianbegusch > qiime2_suite
diff qiime2/qiime_sample-classifier_split-table.xml @ 29:3ba9833030c1 draft
Uploaded
author | florianbegusch |
---|---|
date | Fri, 04 Sep 2020 13:12:49 +0000 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qiime2/qiime_sample-classifier_split-table.xml Fri Sep 04 13:12:49 2020 +0000 @@ -0,0 +1,136 @@ +<?xml version="1.0" ?> +<tool id="qiime_sample-classifier_split-table" name="qiime sample-classifier split-table" + version="2020.8"> + <description>Split a feature table into training and testing sets.</description> + <requirements> + <requirement type="package" version="2020.8">qiime2</requirement> + </requirements> + <command><![CDATA[ +qiime sample-classifier split-table + +--i-table=$itable +# 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-test-size=$ptestsize + +#if str($prandomstate): + --p-random-state=$prandomstate +#end if +#if $pnostratify: + --p-no-stratify +#end if + +#if str($pmissingsamples) != 'None': +--p-missing-samples=$pmissingsamples +#end if + +--o-training-table=otrainingtable + +--o-test-table=otesttable + +#if str($examples) != 'None': +--examples=$examples +#end if + +; +cp otesttable.qza $otesttable + + ]]></command> + <inputs> + <param format="qza,no_unzip.zip" label="--i-table: ARTIFACT FeatureTable[Frequency¹ | RelativeFrequency² | PresenceAbsence³ | Balance⁴ | PercentileNormalized⁵ | Design⁶] 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[Numeric | Categorical] Numeric 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 label="--p-random-state: INTEGER Seed used by random number generator. [optional]" name="prandomstate" optional="False" type="text" /> + <param label="--p-no-stratify: Do not evenly stratify training and test data among metadata categories. If True, all values in column must match at least two samples. [default: True]" name="pnostratify" selected="False" type="boolean" /> + <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> + + <outputs> + <data format="qza" label="${tool.name} on ${on_string}: trainingtable.qza" name="otrainingtable" /> + <data format="qza" label="${tool.name} on ${on_string}: testtable.qza" name="otesttable" /> + + </outputs> + + <help><![CDATA[ +Split a feature table into training and testing sets. +############################################################### + +Split a feature table into training and testing sets. By default stratifies +training and test sets on a metadata column, such that values in that +column are evenly represented across training and test sets. + +Parameters +---------- +table : FeatureTable[Frequency¹ | RelativeFrequency² | PresenceAbsence³ | Balance⁴ | PercentileNormalized⁵ | Design⁶] + Feature table containing all features that should be used for target + prediction. +metadata : MetadataColumn[Numeric | Categorical] + Numeric metadata column to use as prediction target. +test_size : Float % Range(0.0, 1.0, inclusive_start=False), optional + Fraction of input samples to exclude from training set and use for + classifier testing. +random_state : Int, optional + Seed used by random number generator. +stratify : Bool, optional + Evenly stratify training and test data among metadata categories. If + True, all values in column must match at least two samples. +missing_samples : Str % Choices('error', 'ignore'), optional + How to handle missing samples in metadata. "error" will fail if missing + samples are detected. "ignore" will cause the feature table and + metadata to be filtered, so that only samples found in both files are + retained. + +Returns +------- +training_table : FeatureTable[Frequency¹ | RelativeFrequency² | PresenceAbsence³ | Balance⁴ | PercentileNormalized⁵ | Design⁶] + Feature table containing training samples +test_table : FeatureTable[Frequency¹ | RelativeFrequency² | PresenceAbsence³ | Balance⁴ | PercentileNormalized⁵ | Design⁶] + Feature table containing test samples + ]]></help> + <macros> + <import>qiime_citation.xml</import> + </macros> + <expand macro="qiime_citation"/> +</tool> \ No newline at end of file