changeset 6:f1eabb5973b1 draft

planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit 08a878ac05ac0c05eafac27b9ebaadb88ae21eb7
author eschen42
date Thu, 11 Jan 2018 20:22:14 -0500
parents ae791fe4fbe9
children 8329f51e5e53
files w4mclassfilter.xml w4mclassfilter_wrapper.R
diffstat 2 files changed, 85 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/w4mclassfilter.xml	Thu Sep 07 17:32:09 2017 -0400
+++ b/w4mclassfilter.xml	Thu Jan 11 20:22:14 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 '$variable_range_filter'
   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,32 @@
       <option value="TRUE">filter-in</option>
       <option value="FALSE" selected="true">filter-out</option>
     </param>
+    
+    <param name="variable_range_filter" label="Variable range-filters" type="text" value = "" help="comma-separated filters specified as 'variableMetadataColumnName:min:max'; default is no filters.  (See help below.)">
+      <sanitizer>
+        <valid initial="string.letters">
+          <add preset="string.digits"/>
+          <add value="&#36;"  /> <!-- dollar, dollar-sign -->
+          <add value="&#40;"  /> <!-- left-paren -->
+          <add value="&#41;"  /> <!-- right-paren -->
+          <add value="&#42;"  /> <!-- splat, asterisk -->
+          <add value="&#43;"  /> <!-- plus -->
+          <add value="&#44;"  /> <!-- comma -->
+          <add value="&#46;"  /> <!-- dot, period -->
+          <add value="&#58;"  /> <!-- colon -->
+          <add value="&#59;"  /> <!-- semi, semicolon -->
+          <add value="&#63;"  /> <!-- what, question mark -->
+          <add value="&#91;"  /> <!-- l-squib, left-squre-bracket -->
+          <add value="&#92;"  /> <!-- whack, backslash -->
+          <add value="&#93;"  /> <!-- r-squib, right-squre-bracket -->
+          <add value="&#94;"  /> <!-- hat, caret -->
+          <add value="&#123;" /> <!-- l-cube, left-curly-bracket -->
+          <add value="&#124;" /> <!-- pipe -->
+          <add value="&#125;" /> <!-- r-cube, right-curly-bracket -->
+        </valid>
+      </sanitizer>
+    </param>
+    
   </inputs>
   <outputs>
     <data name="dataMatrix_out" label="${tool.name}_${dataMatrix_in.name}" format="tabular" ></data>
@@ -436,6 +464,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,6 +544,26 @@
 - '``^[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
+----------------------
+
+An array of range-specification strings may be supplied in the `variable_range_filter`
+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 example
@@ -568,6 +620,19 @@
 NEWS
 ----
 
+CHANGES IN VERSION 0.98.6
+=========================
+
+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
 =========================
 
--- a/w4mclassfilter_wrapper.R	Thu Sep 07 17:32:09 2017 -0400
+++ b/w4mclassfilter_wrapper.R	Thu Jan 11 20:22:14 2018 -0500
@@ -82,8 +82,8 @@
 
 # other parameters
 
+wildcards <- as.logical(argVc["wildcards"])
 sampleclassNames <- as.character(argVc["sampleclassNames"])
-wildcards <- as.logical(argVc["wildcards"])
 sampleclassNames <- strsplit(x = sampleclassNames, split = ",", fixed = TRUE)[[1]]
 if (wildcards) {
   sampleclassNames <- gsub("[.]", "[.]", sampleclassNames)
@@ -93,22 +93,26 @@
 classnameColumn <- as.character(argVc["classnameColumn"])
 samplenameColumn <- as.character(argVc["samplenameColumn"])
 
+variable_range_filter <- as.character(argVc["variable_range_filter"])
+variable_range_filter <- strsplit(x = variable_range_filter, split = ",", fixed = TRUE)[[1]]
+
 ##------------------------------
 ## Computation
 ##------------------------------
 
 result <- w4m_filter_by_sample_class(
-  dataMatrix_in        = dataMatrix_in
-, sampleMetadata_in    = sampleMetadata_in
-, variableMetadata_in  = variableMetadata_in
-, dataMatrix_out       = dataMatrix_out
-, sampleMetadata_out   = sampleMetadata_out
-, variableMetadata_out = variableMetadata_out
-, classes              = sampleclassNames
-, include              = inclusive
-, class_column         = classnameColumn
-, samplename_column    = samplenameColumn
-, failure_action       = my_print
+  dataMatrix_in         = dataMatrix_in
+, sampleMetadata_in     = sampleMetadata_in
+, variableMetadata_in   = variableMetadata_in
+, dataMatrix_out        = dataMatrix_out
+, sampleMetadata_out    = sampleMetadata_out
+, variableMetadata_out  = variableMetadata_out
+, classes               = sampleclassNames
+, include               = inclusive
+, class_column          = classnameColumn
+, samplename_column     = samplenameColumn
+, variable_range_filter = variable_range_filter
+, failure_action        = my_print
 )
 
 my_print("\nResult of '", modNamC, "' Galaxy module call to 'w4mclassfilter::w4m_filter_by_sample_class' R function: ",