# HG changeset patch # User eschen42 # Date 1519997393 18000 # Node ID 518cc205f289f9d05a6d537b4c8d257a91158c15 # Parent ba427b16556a05914c26c372b687d8a4f6073cd4 planemo upload for repository https://github.com/HegemanLab/w4mclassfilter_galaxy_wrapper/tree/master commit aaa20ca94614124d11723bb906dee91636144d05 diff -r ba427b16556a -r 518cc205f289 README --- a/README Mon Jan 15 13:36:02 2018 -0500 +++ b/README Fri Mar 02 08:29:53 2018 -0500 @@ -1,7 +1,8 @@ Galaxy Wrapper for the w4mclassfilter R Package + -This is a planemo -oriented galaxy-tool-wrapper +This is a Galaxy tool-wrapper to wrap the w4mclassfilter R package for use with the Workflow4Metabolomics -flavor of Galaxy +flavor of Galaxy . +The tool is built with Planemo . diff -r ba427b16556a -r 518cc205f289 w4mclassfilter.xml --- a/w4mclassfilter.xml Mon Jan 15 13:36:02 2018 -0500 +++ b/w4mclassfilter.xml Fri Mar 02 08:29:53 2018 -0500 @@ -1,11 +1,13 @@ - - Filter W4M data by sample class + + Filter W4m data by values or metadata + + - + r-base r-batch - w4mclassfilter + w4mclassfilter @@ -22,8 +24,9 @@ inclusive '$inclusive' wildcards '$wildcards' classnameColumn '$classnameColumn' - samplenameColumn '$samplenameColumn' + samplenameColumn 'sampleMetadata' variable_range_filter '$variableRangeFilter' + transformation '$transformation' dataMatrix_out '$dataMatrix_out' sampleMetadata_out '$sampleMetadata_out' variableMetadata_out '$variableMetadata_out' @@ -33,12 +36,23 @@ - - - + + + + + + + + + + + + + + @@ -53,38 +67,42 @@ - - - + - + - + - + + + - + + + + + - - - + + + @@ -92,10 +110,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -148,7 +219,6 @@ - @@ -198,7 +268,6 @@ - @@ -232,7 +301,6 @@ - @@ -266,7 +334,6 @@ - @@ -296,7 +363,6 @@ - @@ -326,7 +392,6 @@ - @@ -360,7 +425,6 @@ - @@ -401,7 +465,7 @@ **R package** -The *w4mclassfilter* package is available from the Hegeman lab github repository (https://github.com/HegemanLab/w4mclassfilter/releases). +The *w4mclassfilter* package (which is used by the W4m Data Subset tool) is available from the Hegeman lab github repository (https://github.com/HegemanLab/w4mclassfilter/releases). ----------------------------------------------------------------------------------------------------------------------------------------- @@ -412,44 +476,67 @@ --------------------------------------------------- -============================================== -Filter Workflow4Metabolomics data matrix files -============================================== +=========================================================== +"W4m Data Subset" - Filter Workflow4Metabolomics data files +=========================================================== + +---------- +Motivation +---------- + +GC-MS and LC-MS experiments seek to resolve as features chemicals that have distinct chromatographic retention-time ("rt") and (after ionization) mass-to-charge ratio ("m/z" or "mz"). +(If the MS protocol includes fragmentation, several features may result for each chemical.) +Data for a sample are collected as MS intensities, each of which is associated with a position on a 2D plane with dimensions of rt and m/z. +Ideally, features would be sufficiently reproducible among sample-runs to distinguish features that are commmon among samples from those that differ. + +The chromatographic retention-time for a chemical can vary from one chromatography run to the next. +Workflow4Metabolomics (W4m, [Giacomoni *et al.*, 2014, Guitton *et al.* 2017]) is a "flavor" of Galaxy that uses the XCMS preprocessing tools for "retention-time correction" to align features among samples. +Features may be better aligned if pooled samples and blanks are included. + +Multivariate statistical techniques may be used to discover clusters of similar samples (Th]]>é - + 10.1093/bioinformatics/btu813 - + 10.1016/j.biocel.2017.07.002 + + 10.1021/ac202450g 10.1021/ac051437y - + 10.1021/acs.jproteome.5b00354 diff -r ba427b16556a -r 518cc205f289 w4mclassfilter_wrapper.R --- a/w4mclassfilter_wrapper.R Mon Jan 15 13:36:02 2018 -0500 +++ b/w4mclassfilter_wrapper.R Fri Mar 02 08:29:53 2018 -0500 @@ -82,6 +82,7 @@ # other parameters +transformation <- as.character(argVc["transformation"]) wildcards <- as.logical(argVc["wildcards"]) sampleclassNames <- as.character(argVc["sampleclassNames"]) sampleclassNames <- strsplit(x = sampleclassNames, split = ",", fixed = TRUE)[[1]] @@ -96,6 +97,29 @@ variable_range_filter <- as.character(argVc["variable_range_filter"]) variable_range_filter <- strsplit(x = variable_range_filter, split = ",", fixed = TRUE)[[1]] +## ----------------------------- +## Transformation and imputation +## ----------------------------- +my_w4m_filter_imputation <- if (transformation == "log10") { + function(m) { + suppressWarnings( + # suppress warnings here since non-positive values will produce NaN's that will be fixed in the next step + m <- log10(m) + ) + # replace NaN values with zero + m[is.nan(m)] <- 0 + # replace NA values with zero + m[is.na(m)] <- 0 + # replace negative values with zero, if applicable (It should never be applicable!) + m[m<0] <- 0 + # return matrix as the result + return (m) + } +} else { + # use the method from the w4mclassfilter class + w4m_filter_imputation +} + ##------------------------------ ## Computation ##------------------------------ @@ -113,6 +137,7 @@ , samplename_column = samplenameColumn , variable_range_filter = variable_range_filter , failure_action = my_print +, data_imputation = my_w4m_filter_imputation ) my_print("\nResult of '", modNamC, "' Galaxy module call to 'w4mclassfilter::w4m_filter_by_sample_class' R function: ",