diff w4mclassfilter.xml @ 6:38ccf6722d54 draft

planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit a06ae79d25b31d02217b934b9cd61a5aba3f640f
author eschen42
date Mon, 15 Jan 2018 14:06:39 -0500
parents 2cdf7d5982c8
children 582a8a42a93b
line wrap: on
line diff
--- a/w4mclassfilter.xml	Thu Sep 07 17:41:09 2017 -0400
+++ b/w4mclassfilter.xml	Mon Jan 15 14:06:39 2018 -0500
@@ -1,10 +1,11 @@
-<tool id="w4mclassfilter" name="Sample_Subset" version="0.98.3">
+<tool id="w4mclassfilter" name="Sample_Subset" version="0.98.6">
   <description>Filter W4M data by sample class</description>
 
   <requirements>
-    <requirement type="package" version="3.3.2">r-base</requirement>
+	  <!-- <requirement type="package" version="6.2">readline</requirement> -->
+    <requirement type="package" version="3.4.1">r-base</requirement>
     <requirement type="package" version="1.1_4">r-batch</requirement>
-    <requirement type="package" version="0.98.3">w4mclassfilter</requirement>
+    <requirement type="package" version="0.98.6">w4mclassfilter</requirement>
   </requirements>
 
   <stdio>
@@ -22,6 +23,7 @@
   wildcards '$wildcards'
   classnameColumn '$classnameColumn'
   samplenameColumn '$samplenameColumn'
+  variable_range_filter '$variableRangeFilter'
   dataMatrix_out '$dataMatrix_out'
   sampleMetadata_out '$sampleMetadata_out'
   variableMetadata_out '$variableMetadata_out'
@@ -56,8 +58,8 @@
           <add value="&#125;" /> <!-- r-cube, right-curly-bracket -->
         </valid>
       </sanitizer>
+    </param>
 
-    </param>
     <param name="wildcards" label="Use wild-cards or regular-expressions" type="select" help="wild-cards (the default) - use '*' and '?' to match class names; regular-expressions - use comma-less regular expressions to match class names">
       <option value="TRUE" selected="true">wild-cards</option>
       <option value="FALSE">regular-expressions</option>
@@ -66,6 +68,18 @@
       <option value="TRUE">filter-in</option>
       <option value="FALSE" selected="true">filter-out</option>
     </param>
+    
+    <param name="variableRangeFilter" label="Variable range-filters" type="text" value = "" help="comma-separated filters, each specified as 'variableMetadataColumnName:min:max'; default is no filters.  (See help below.)">
+      <sanitizer>
+        <valid initial="string.letters">
+          <add preset="string.digits"/>
+          <add value="&#44;"  /> <!-- comma -->
+          <add value="&#58;"  /> <!-- colon -->
+          <add value="&#46;"  /> <!-- dot, period -->
+        </valid>
+      </sanitizer>
+    </param>
+    
   </inputs>
   <outputs>
     <data name="dataMatrix_out" label="${tool.name}_${dataMatrix_in.name}" format="tabular" ></data>
@@ -78,6 +92,60 @@
       <param name="dataMatrix_in" value="input_dataMatrix.tsv"/>
       <param name="sampleMetadata_in" value="input_sampleMetadata.tsv"/>
       <param name="variableMetadata_in" value="input_variableMetadata.tsv"/>
+      <param name="classnameColumn" value="class"/>
+      <param name="sampleclassNames" value=""/>
+      <param name="wildcards" value="FALSE"/>
+      <param name="samplenameColumn" value="sampleMetadata"/>
+      <param name="inclusive" value="filter-out"/>
+      <param name="variableRangeFilter" value="FEATMAX:2e6:,mz:200:,rt::800"/>
+      <output name="sampleMetadata_out">
+        <assert_contents>
+          <has_text text="HU_028" />
+          <has_text text="HU_051" />
+          <has_text text="HU_060" />
+          <has_text text="HU_110" />
+          <has_text text="HU_149" />
+          <has_text text="HU_152" />
+          <has_text text="HU_175" />
+          <has_text text="HU_178" />
+          <has_text text="HU_185" />
+          <not_has_text text="HU_204" />
+          <has_text text="HU_208" />
+          <has_text text="HU_017" />
+          <has_text text="HU_034" />
+          <has_text text="HU_078" />
+          <has_text text="HU_091" />
+          <has_text text="HU_093" />
+          <has_text text="HU_099" />
+          <has_text text="HU_130" />
+          <has_text text="HU_134" />
+          <has_text text="HU_138" />
+        </assert_contents>
+      </output>
+      <output name="variableMetadata_out">
+        <assert_contents>
+          <has_text     text="HMDB00191" />
+          <has_text     text="HMDB00208" />
+          <not_has_text text="HMDB00251" />
+          <not_has_text text="HMDB00299" />
+          <not_has_text text="HMDB00512" />
+          <not_has_text text="HMDB00518" />
+          <not_has_text text="HMDB00715" />
+          <not_has_text text="HMDB00822" />
+          <has_text     text="HMDB01032" />
+          <has_text     text="HMDB01101.1" />
+          <not_has_text text="HMDB03193" />
+          <not_has_text text="HMDB04824" />
+          <not_has_text text="HMDB10348" />
+          <has_text     text="HMDB13189" />
+          <not_has_text text="HMDB59717" />
+        </assert_contents>
+      </output>
+    </test>
+    <test>
+      <param name="dataMatrix_in" value="input_dataMatrix.tsv"/>
+      <param name="sampleMetadata_in" value="input_sampleMetadata.tsv"/>
+      <param name="variableMetadata_in" value="input_variableMetadata.tsv"/>
       <param name="classnameColumn" value="gender"/>
       <param name="sampleclassNames" value="M"/>
       <param name="samplenameColumn" value="sampleMetadata"/>
@@ -436,6 +504,10 @@
 	| '``filter-out``' - exclude only the named sample classes
 	|
 
+Variable-range filters (default = no filters)
+	| comma-separated names of variable-range filters (see 'Variable-range filters' below)
+	|
+
 
 
 ------------
@@ -512,28 +584,58 @@
 - '``^[A-Z][A-Z]*[0-9][0-9]$``' - NO MATCH - the name does not end with the pattern '``[A-Z][0-9][0-9]$``', i.e., it ends with four digits, not two.
 - '``^[A-Z][0-9]*$``' - NO MATCH - the pattern specifies that second character and all those that follow, if present, must be digits.
 
+----------------------
+Variable-range filters
+----------------------
 
----------------
-Working example
----------------
+An array of range-specification strings may be supplied in the `variableRangeFilter`
+argument.  If supplied, only features having numerical values in the specified column
+of `variableMetadata` that fall within the specified ranges will be retained
+in the output.  Each range is a string of three colon-separated values (e.g., "mz:200:800") in the
+following order:
+
+- the **name of a column of `variableMetadata`** which must have numerical data (e.g., "mz");
+- the **minimum allowed value** in that column for the feature to be retained (e.g., 200);
+- the **maximum allowed value** (e.g., 800).
+
+Note for the range specification strings: 
+
+- **If the "maximum" is less than the "minimum", then the range is exclusive**  (e.g., "mz:800:200" means retain only features whose mz is NOT in the range 200-800)
+- **If the name supplied in the first field is 'FEATMAX',**  then the string is defining the minimum (and possibly, though less useful, maximum) intensity for each feature in the dataMatrix.  For example, "FEATMAX:1e6:" would specify  that any feature would be excluded if no sample had an intensity for that feature greater than 1000000.
+
+  - Note, however, that when the "maximum" is greater than the "minimum" for the FEATMAX range specification, then the specification is ignored.
+
+-----------------------------------------------------------------------------
+
+----------------
+WORKING EXAMPLES
+----------------
 
 .. class:: infomark
 
-**Input files**
+-----------
+Input Files
+-----------
 
-+-------------------+--------------------------------------------------------------------------------------------------------------+
-| Input File        | Download from URL                                                                                            |
-+===================+==============================================================================================================+
-| Data matrix       | https://raw.githubusercontent.com/HegemanLab/w4mclassfilter/master/tests/testthat/input_dataMatrix.tsv       |
-+-------------------+--------------------------------------------------------------------------------------------------------------+
-| Sample metadata   | https://raw.githubusercontent.com/HegemanLab/w4mclassfilter/master/tests/testthat/input_sampleMetadata.tsv   |
-+-------------------+--------------------------------------------------------------------------------------------------------------+
-| Variable metadata | https://raw.githubusercontent.com/HegemanLab/w4mclassfilter/master/tests/testthat/input_variableMetadata.tsv |
-+-------------------+--------------------------------------------------------------------------------------------------------------+
++------------------------------------------------------------------------------------------------------------------------+
+| Input File URL                                                                                                         |
++========================================================================================================================+
+| https://raw.githubusercontent.com/HegemanLab/w4mclassfilter_galaxy_wrapper/master/test-data/input_dataMatrix.tsv       |
++------------------------------------------------------------------------------------------------------------------------+
+| https://raw.githubusercontent.com/HegemanLab/w4mclassfilter_galaxy_wrapper/master/test-data/input_sampleMetadata.tsv   |
++------------------------------------------------------------------------------------------------------------------------+
+| https://raw.githubusercontent.com/HegemanLab/w4mclassfilter_galaxy_wrapper/master/test-data/input_variableMetadata.tsv |
++------------------------------------------------------------------------------------------------------------------------+
 
 .. class:: infomark
 
-**Other input parameters**
+-------------------------------
+Running Without Range-Filtering
+-------------------------------
+
+This example retains only samples whose 'gender' attribute is 'M'.
+
+**Input parameters**
 
 +------------------------------------+-----------------+
 | Input Parameter                    | Value           |
@@ -547,20 +649,54 @@
 | Column that names the sample       | sampleMetadata  |
 +------------------------------------+-----------------+
 
+**Expected outputs**
+
++-------------------+---------------------------------------------------------------------------------------------------------------------------+
+| Expected Output   | Download from URL                                                                                                         |
++===================+===========================================================================================================================+
+| Data matrix       | https://raw.githubusercontent.com/HegemanLab/w4mclassfilter_galaxy_wrapper/master/test-data/expected_dataMatrix.tsv       |
++-------------------+---------------------------------------------------------------------------------------------------------------------------+
+| Sample metadata   | https://raw.githubusercontent.com/HegemanLab/w4mclassfilter_galaxy_wrapper/master/test-data/expected_sampleMetadata.tsv   |
++-------------------+---------------------------------------------------------------------------------------------------------------------------+
+| Variable metadata | https://raw.githubusercontent.com/HegemanLab/w4mclassfilter_galaxy_wrapper/master/test-data/expected_variableMetadata.tsv |
++-------------------+---------------------------------------------------------------------------------------------------------------------------+
+
 .. class:: infomark
 
+----------------------------
+Running With Range-Filtering
+----------------------------
+
+This example retains only features whose mz is greater than 200, whose rt is less than 800, and whose maximum intensity across all samples is 2,000,000.
+This example retains all samples (except those having zero variance for all feature), although it would be possible to filter on samples as well.
+
+**Input parameters**
+
++------------------------------------+-------------------------------+
+| Input Parameter                    | Value                         |
++====================================+===============================+
+| Names of sample classes            | (Leave this field empty.)     |
++------------------------------------+-------------------------------+
+| Include named classes              | filter-out                    |
++------------------------------------+-------------------------------+
+| Column that names the sample-class | class                         |
++------------------------------------+-------------------------------+
+| Column that names the sample       | sampleMetadata                |
++------------------------------------+-------------------------------+
+| Variable range-filters             | FEATMAX:2e6:,mz:200:,rt::800  |
++------------------------------------+-------------------------------+
+
 **Expected outputs**
 
-+-------------------+-----------------------------------------------------------------------------------------------------------------+
-| Expected Output   | Download from URL                                                                                               |
-+===================+=================================================================================================================+
-| Data matrix       | https://raw.githubusercontent.com/HegemanLab/w4mclassfilter/master/tests/testthat/expected_dataMatrix.tsv       |
-+-------------------+-----------------------------------------------------------------------------------------------------------------+
-| Sample metadata   | https://raw.githubusercontent.com/HegemanLab/w4mclassfilter/master/tests/testthat/expected_sampleMetadata.tsv   |
-+-------------------+-----------------------------------------------------------------------------------------------------------------+
-| Variable metadata | https://raw.githubusercontent.com/HegemanLab/w4mclassfilter/master/tests/testthat/expected_variableMetadata.tsv |
-+-------------------+-----------------------------------------------------------------------------------------------------------------+
-
++-------------------+------------------------------------------------------------------------------------------------------------------------------+
+| Expected Output   | Download from URL                                                                                                            |
++===================+==============================================================================================================================+
+| Data matrix       | https://raw.githubusercontent.com/HegemanLab/w4mclassfilter_galaxy_wrapper/master/test-data/rangefilter_dataMatrix.tsv       |
++-------------------+------------------------------------------------------------------------------------------------------------------------------+
+| Sample metadata   | https://raw.githubusercontent.com/HegemanLab/w4mclassfilter_galaxy_wrapper/master/test-data/rangefilter_sampleMetadata.tsv   |
++-------------------+------------------------------------------------------------------------------------------------------------------------------+
+| Variable metadata | https://raw.githubusercontent.com/HegemanLab/w4mclassfilter_galaxy_wrapper/master/test-data/rangefilter_variableMetadata.tsv |
++-------------------+------------------------------------------------------------------------------------------------------------------------------+
 
 -----------------------------------------------------------------------------
 
@@ -568,42 +704,54 @@
 NEWS
 ----
 
-CHANGES IN VERSION 0.98.3
+Changes in version 0.98.6
 =========================
 
-INTERNAL MODIFICATIONS
+New features
+
+* Added support for filtering out features whose attributes fall outside specified ranges.
+  For more detail, see "Variable-range filters" above.
+  
+Internal modifications
+
+* Now uses w4mclassfilter R package v0.98.6.
+* Now sorts sample names and feature names in output files because some statistical tools expect the same order in `dataMatrix` row and column names as in the corresponding metadata files.
+
+Changes in version 0.98.3
+=========================
+
+Internal modifications
 
 * Improved input handling.
 * Now uses w4mclassfilter R package v0.98.3, although that version has no functional implications for this tool.
 * Improved reference-list.
 
-CHANGES IN VERSION 0.98.2
+Changes in version 0.98.2
 =========================
 
-NEW FEATURES
+New features
 
 * Added support for R-flavored regular expression pattern-matching when selecting names of sample-classes.
 * Empty classes argument or zero-length class_column result in no samples filtered out.
 
-INTERNAL MODIFICATIONS
+Internal modifications
 
 * Support and tests for new features.
 
-
-CHANGES IN VERSION 0.98.1
+Changes in version 0.98.1
 =========================
 
-NEW FEATURES
-
 First release - Wrap the w4mclassfilter R package that implements filtering of W4M data matrix, variable metadata, and sample metadata by class of sample.
 
-*dataMatrix* *is* modified by the tool, so it *does* appear as an output file
-*sampleMetadata* *is* modified by the tool, so it *does* appear as an output file
-*variableMetadata* *is* modified by the tool, so it *does* appear as an output file
+New features
 
-INTERNAL MODIFICATIONS
+* *dataMatrix* *is* modified by the tool, so it *does* appear as an output file
+* *sampleMetadata* *is* modified by the tool, so it *does* appear as an output file
+* *variableMetadata* *is* modified by the tool, so it *does* appear as an output file
 
-none
+Internal modifications
+
+* N/A
 
   ]]></help>
   <citations>