Repository 'xcms_export_samplemetadata'
hg clone https://toolshed.g2.bx.psu.edu/repos/lecorguille/xcms_export_samplemetadata

Changeset 9:94eb263cfab4 (2021-04-07)
Previous changeset 8:c684ccd89267 (2020-02-12) Next changeset 10:cdab04a1d1d7 (2023-09-11)
Commit message:
"planemo upload for repository https://github.com/workflow4metabolomics/xcms commit dcc90f9cf76e6980c0a7d9698c89fab826e7adae"
modified:
README.rst
lib.r
macros_xcms.xml
repository_dependencies.xml
test-data/ko15-xset.RData
test-data/ko16-xset.RData
test-data/wt15-xset.RData
test-data/wt16-xset.RData
xcms_export_samplemetadata.r
xcms_export_samplemetadata.xml
b
diff -r c684ccd89267 -r 94eb263cfab4 README.rst
--- a/README.rst Wed Feb 12 08:27:57 2020 -0500
+++ b/README.rst Wed Apr 07 09:53:54 2021 +0000
b
@@ -2,6 +2,12 @@
 Changelog/News
 --------------
 
+.. _News: https://bioconductor.org/packages/release/bioc/news/xcms/NEWS
+
+**Version 3.12.0+galaxy* - 03/03/2020**
+
+- UPGRADE: upgrade the xcms version from 3.6.1 to 3.12.0 (see XCMS News_)
+
 **Version 3.6.1.0 - 03/09/2019**
 
 - UPGRADE: upgrade the xcms version from 3.4.4 to 3.6.1 (see XCMS News_)
b
diff -r c684ccd89267 -r 94eb263cfab4 lib.r
--- a/lib.r Wed Feb 12 08:27:57 2020 -0500
+++ b/lib.r Wed Apr 07 09:53:54 2021 +0000
[
b'@@ -6,8 +6,8 @@\n parseCommandArgs <- function(...) {\n     args <- batch::parseCommandArgs(...)\n     for (key in names(args)) {\n-        if (args[key] %in% c("TRUE","FALSE"))\n-            args[key] = as.logical(args[key])\n+        if (args[key] %in% c("TRUE", "FALSE"))\n+            args[key] <- as.logical(args[key])\n     }\n     return(args)\n }\n@@ -17,14 +17,20 @@\n # - load the packages\n # - display the sessionInfo\n loadAndDisplayPackages <- function(pkgs) {\n-    for(pkg in pkgs) suppressPackageStartupMessages( stopifnot( library(pkg, quietly=TRUE, logical.return=TRUE, character.only=TRUE)))\n+    for (pkg in pkgs) suppressPackageStartupMessages(stopifnot(library(pkg, quietly = TRUE, logical.return = TRUE, character.only = TRUE)))\n \n-    sessioninfo = sessionInfo()\n-    cat(sessioninfo$R.version$version.string,"\\n")\n+    sessioninfo <- sessionInfo()\n+    cat(sessioninfo$R.version$version.string, "\\n")\n     cat("Main packages:\\n")\n-    for (pkg in names(sessioninfo$otherPkgs)) { cat(paste(pkg,packageVersion(pkg)),"\\t") }; cat("\\n")\n+    for (pkg in names(sessioninfo$otherPkgs)) {\n+      cat(paste(pkg, packageVersion(pkg)), "\\t")\n+    }\n+    cat("\\n")\n     cat("Other loaded packages:\\n")\n-    for (pkg in names(sessioninfo$loadedOnly)) { cat(paste(pkg,packageVersion(pkg)),"\\t") }; cat("\\n")\n+    for (pkg in names(sessioninfo$loadedOnly)) {\n+      cat(paste(pkg, packageVersion(pkg)), "\\t")\n+    }\n+    cat("\\n")\n }\n \n #@author G. Le Corguille\n@@ -43,20 +49,20 @@\n     chromTIC_adjusted <- NULL\n     chromBPI_adjusted <- NULL\n     md5sumList <- NULL\n-    for(image in args$images) {\n+    for (image in args$images) {\n \n         load(image)\n         # Handle infiles\n         if (!exists("singlefile")) singlefile <- NULL\n         if (!exists("zipfile")) zipfile <- NULL\n-        rawFilePath <- retrieveRawfileInTheWorkingDirectory(singlefile, zipfile, args)\n+        rawFilePath <- retrieveRawfileInTheWorkingDir(singlefile, zipfile, args)\n         zipfile <- rawFilePath$zipfile\n         singlefile <- rawFilePath$singlefile\n \n         if (exists("raw_data")) xdata <- raw_data\n         if (!exists("xdata")) stop("\\n\\nERROR: The RData doesn\'t contain any object called \'xdata\'. This RData should have been created by an old version of XMCS 2.*")\n \n-        cat(sampleNamesList$sampleNamesOrigin,"\\n")\n+        cat(sampleNamesList$sampleNamesOrigin, "\\n")\n \n         if (!exists("xdata_merged")) {\n             xdata_merged <- xdata\n@@ -68,14 +74,14 @@\n             chromTIC_adjusted_merged <- chromTIC_adjusted\n             chromBPI_adjusted_merged <- chromBPI_adjusted\n         } else {\n-            if (is(xdata, "XCMSnExp")) xdata_merged <- c(xdata_merged,xdata)\n-            else if (is(xdata, "OnDiskMSnExp")) xdata_merged <- xcms:::.concatenate_OnDiskMSnExp(xdata_merged,xdata)\n+            if (is(xdata, "XCMSnExp")) xdata_merged <- c(xdata_merged, xdata)\n+            else if (is(xdata, "OnDiskMSnExp")) xdata_merged <- xcms:::.concatenate_OnDiskMSnExp(xdata_merged, xdata)\n             else stop("\\n\\nERROR: The RData either a OnDiskMSnExp object called raw_data or a XCMSnExp object called xdata")\n \n-            singlefile_merged <- c(singlefile_merged,singlefile)\n-            md5sumList_merged$origin <- rbind(md5sumList_merged$origin,md5sumList$origin)\n-            sampleNamesList_merged$sampleNamesOrigin <- c(sampleNamesList_merged$sampleNamesOrigin,sampleNamesList$sampleNamesOrigin)\n-            sampleNamesList_merged$sampleNamesMakeNames <- c(sampleNamesList_merged$sampleNamesMakeNames,sampleNamesList$sampleNamesMakeNames)\n+            singlefile_merged <- c(singlefile_merged, singlefile)\n+            md5sumList_merged$origin <- rbind(md5sumList_merged$origin, md5sumList$origin)\n+            sampleNamesList_merged$sampleNamesOrigin <- c(sampleNamesList_merged$sampleNamesOrigin, sampleNamesList$sampleNamesOrigin)\n+            sampleNamesList_merged$sampleNamesMakeNames <- c(sampleNamesList_merged$sampleNamesMakeNames, sampleNamesList$sampleNamesMakeNam'..b'length("singlefile") > 0)) {\n         files <- vector()\n         for (singlefile_sampleName in names(singlefile)) {\n             singlefile_galaxyPath <- singlefile[[singlefile_sampleName]]\n-            if(!file.exists(singlefile_galaxyPath)){\n-                error_message <- paste("Cannot access the sample:",singlefile_sampleName,"located:",singlefile_galaxyPath,". Please, contact your administrator ... if you have one!")\n+            if (!file.exists(singlefile_galaxyPath)) {\n+                error_message <- paste("Cannot access the sample:", singlefile_sampleName, "located:", singlefile_galaxyPath, ". Please, contact your administrator ... if you have one!")\n                 print(error_message); stop(error_message)\n             }\n \n-            if (!suppressWarnings( try (file.link(singlefile_galaxyPath, singlefile_sampleName), silent=T)))\n+            if (!suppressWarnings(try(file.link(singlefile_galaxyPath, singlefile_sampleName), silent = T)))\n                 file.copy(singlefile_galaxyPath, singlefile_sampleName)\n             files <- c(files, singlefile_sampleName)\n         }\n     }\n     # zipfile\n-    if(!is.null(zipfile) && (zipfile != "")) {\n-        if(!file.exists(zipfile)){\n-            error_message <- paste("Cannot access the Zip file:",zipfile,". Please, contact your administrator ... if you have one!")\n+    if (!is.null(zipfile) && (zipfile != "")) {\n+        if (!file.exists(zipfile)) {\n+            error_message <- paste("Cannot access the Zip file:", zipfile, ". Please, contact your administrator ... if you have one!")\n             print(error_message)\n             stop(error_message)\n         }\n-        suppressWarnings(unzip(zipfile, unzip="unzip"))\n+        suppressWarnings(unzip(zipfile, unzip = "unzip"))\n \n         #get the directory name\n-        suppressWarnings(filesInZip <- unzip(zipfile, list=T))\n-        directories <- unique(unlist(lapply(strsplit(filesInZip$Name,"/"), function(x) x[1])))\n+        suppressWarnings(filesInZip <- unzip(zipfile, list = T))\n+        directories <- unique(unlist(lapply(strsplit(filesInZip$Name, "/"), function(x) x[1])))\n         directories <- directories[!(directories %in% c("__MACOSX")) & file.info(directories)$isdir]\n         directory <- "."\n         if (length(directories) == 1) directory <- directories\n \n-        cat("files_root_directory\\t",directory,"\\n")\n+        cat("files_root_directory\\t", directory, "\\n")\n \n-        filepattern <- c("[Cc][Dd][Ff]", "[Nn][Cc]", "([Mm][Zz])?[Xx][Mm][Ll]","[Mm][Zz][Dd][Aa][Tt][Aa]", "[Mm][Zz][Mm][Ll]")\n-        filepattern <- paste(paste("\\\\.", filepattern, "$", sep=""),collapse="|")\n+        filepattern <- c("[Cc][Dd][Ff]", "[Nn][Cc]", "([Mm][Zz])?[Xx][Mm][Ll]", "[Mm][Zz][Dd][Aa][Tt][Aa]", "[Mm][Zz][Mm][Ll]")\n+        filepattern <- paste(paste("\\\\.", filepattern, "$", sep = ""), collapse = "|")\n         info <- file.info(directory)\n-        listed <- list.files(directory[info$isdir], pattern=filepattern,recursive=TRUE, full.names=TRUE)\n+        listed <- list.files(directory[info$isdir], pattern = filepattern, recursive = TRUE, full.names = TRUE)\n         files <- c(directory[!info$isdir], listed)\n         exists <- file.exists(files)\n         files <- files[exists]\n \n     }\n-    return(list(zipfile=zipfile, singlefile=singlefile, files=files))\n+    return(list(zipfile = zipfile, singlefile = singlefile, files = files))\n \n }\n \n@@ -403,15 +437,15 @@\n getxcmsSetObject <- function(xobject) {\n     # XCMS 1.x\n     if (class(xobject) == "xcmsSet")\n-        return (xobject)\n+        return(xobject)\n     # XCMS 3.x\n     if (class(xobject) == "XCMSnExp") {\n         # Get the legacy xcmsSet object\n-        suppressWarnings(xset <- as(xobject, \'xcmsSet\'))\n+        suppressWarnings(xset <- as(xobject, "xcmsSet"))\n         if (!is.null(xset@phenoData$sample_group))\n             sampclass(xset) <- xset@phenoData$sample_group\n         else\n             sampclass(xset) <- "."\n-        return (xset)\n+        return(xset)\n     }\n }\n'
b
diff -r c684ccd89267 -r 94eb263cfab4 macros_xcms.xml
--- a/macros_xcms.xml Wed Feb 12 08:27:57 2020 -0500
+++ b/macros_xcms.xml Wed Apr 07 09:53:54 2021 +0000
b
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <macros>
 
-    <token name="@TOOL_VERSION@">3.6.1</token>
+    <token name="@TOOL_VERSION@">3.12.0</token>
     <xml name="requirements">
         <requirements>
             <requirement type="package" version="@TOOL_VERSION@">bioconductor-xcms</requirement>
@@ -98,7 +98,7 @@
                   <option value="maxo">maxo</option>
                   <option value="intb">intb</option>
               </param>
-              <param name="naTOzero" type="boolean" checked="true" truevalue="TRUE" falsevalue="FALSE" label="Replace the remain NA by 0 in the dataMatrix" help="Rather mandatory for some downstream statistical steps"/>
+              <param name="naTOzero" type="boolean" checked="true" truevalue="TRUE" falsevalue="FALSE" label="If NA values remain, replace them by 0 in the dataMatrix" help="Mandatory for some of the downstream tools (data processing, statistics) that do not accept NA values"/>
     </xml>
 
     <xml name="input_peaklist_section">
@@ -193,7 +193,7 @@
             <option value="wMean">intensity weighted mean of the peak's m/z values</option>
             <option value="mean">mean of the peak's m/z values</option>
             <option value="apex">use the m/z value at the peak apex</option>
-            <option value="wMeanApex3">ntensity weighted mean of the m/z value at the peak apex and the m/z values left and right of it</option>
+            <option value="wMeanApex3">intensity weighted mean of the m/z value at the peak apex and the m/z values left and right of it</option>
             <option value="meanApex3">mean of the m/z value of the peak apex and the m/z values left and right of it</option>
         </param>
         <param argument="integrate" type="select" label="Integration method" >
@@ -243,6 +243,7 @@
 .. _xcms: https://bioconductor.org/packages/release/bioc/html/xcms.html
 .. _manual: http://www.bioconductor.org/packages/release/bioc/manuals/xcms/man/xcms.pdf
 .. _example: https://bioconductor.org/packages/release/bioc/vignettes/xcms/inst/doc/xcms.html
+.. _News: https://bioconductor.org/packages/release/bioc/news/xcms/NEWS
 
     </token>
 
@@ -256,6 +257,11 @@
 
 - UPGRADE: upgrade the xcms version from 3.4.4 to 3.6.1 (see XCMS News_)
     </token>
+    <token name="@HELP_XCMS_NEWVERSION_31200@">
+**Version 3.12.0+galaxy* - 03/03/2020**
+
+- UPGRADE: upgrade the xcms version from 3.6.1 to 3.12.0 (see XCMS News_)
+    </token>
 
     <xml name="citation">
         <citations>
b
diff -r c684ccd89267 -r 94eb263cfab4 repository_dependencies.xml
--- a/repository_dependencies.xml Wed Feb 12 08:27:57 2020 -0500
+++ b/repository_dependencies.xml Wed Apr 07 09:53:54 2021 +0000
b
@@ -1,5 +1,5 @@
 <?xml version="1.0" ?>
 <repositories>
-    <repository changeset_revision="7800ba9a4c1e" name="no_unzip_datatype" owner="lecorguille" toolshed="https://toolshed.g2.bx.psu.edu"/>
-    <repository changeset_revision="544f6d2329ac" name="rdata_xcms_datatypes" owner="lecorguille" toolshed="https://toolshed.g2.bx.psu.edu"/>
+    <repository name="no_unzip_datatype" owner="lecorguille" toolshed="https://toolshed.g2.bx.psu.edu" changeset_revision="7800ba9a4c1e"/>
+    <repository name="rdata_xcms_datatypes" owner="lecorguille" toolshed="https://toolshed.g2.bx.psu.edu" changeset_revision="544f6d2329ac"/>
 </repositories>
\ No newline at end of file
b
diff -r c684ccd89267 -r 94eb263cfab4 test-data/ko15-xset.RData
b
Binary file test-data/ko15-xset.RData has changed
b
diff -r c684ccd89267 -r 94eb263cfab4 test-data/ko16-xset.RData
b
Binary file test-data/ko16-xset.RData has changed
b
diff -r c684ccd89267 -r 94eb263cfab4 test-data/wt15-xset.RData
b
Binary file test-data/wt15-xset.RData has changed
b
diff -r c684ccd89267 -r 94eb263cfab4 test-data/wt16-xset.RData
b
Binary file test-data/wt16-xset.RData has changed
b
diff -r c684ccd89267 -r 94eb263cfab4 xcms_export_samplemetadata.r
--- a/xcms_export_samplemetadata.r Wed Feb 12 08:27:57 2020 -0500
+++ b/xcms_export_samplemetadata.r Wed Apr 07 09:53:54 2021 +0000
[
@@ -1,28 +1,30 @@
 #!/usr/bin/env Rscript
 
 #Import the different functions
-source_local <- function(fname){ argv <- commandArgs(trailingOnly=FALSE); base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)); source(paste(base_dir, fname, sep="/")) }
+source_local <- function(fname) {
+  argv <- commandArgs(trailingOnly = FALSE); base_dir <- dirname(substring(argv[grep("--file=", argv)], 8)); source(paste(base_dir, fname, sep = "/"))
+}
 source_local("lib.r")
 
-pkgs <- c("xcms","batch")
+pkgs <- c("xcms", "batch")
 loadAndDisplayPackages(pkgs)
 cat("\n\n");
 
-args <- parseCommandArgs(evaluate=FALSE) #interpretation of arguments given in command line as an R list of objects
+args <- parseCommandArgs(evaluate = FALSE) #interpretation of arguments given in command line as an R list of objects
 
 
 sampleMetadata <- NULL
-for(image in args$images) {
+for (image in args$images) {
     load(image)
     if (exists("raw_data")) xdata <- raw_data
     if (!exists("xdata")) stop("\n\nERROR: The RData doesn't contain any object called 'xdata'. This RData should have been created by an old version of XMCS 2.*")
     if (is.null(sampleMetadata))
         sampleMetadata <- xdata@phenoData@data
     else
-        sampleMetadata <- rbind(sampleMetadata,xdata@phenoData@data)
+        sampleMetadata <- rbind(sampleMetadata, xdata@phenoData@data)
 }
-colnames(sampleMetadata) <- c("sample_name","class")
+colnames(sampleMetadata) <- c("sample_name", "class")
 sampleMetadata$sample_name <- make.names(sampleMetadata$sample_name)
 
 # Create a sampleMetada file
-write.table(sampleMetadata,file="sampleMetadata.tsv", sep="\t", row.names=FALSE, quote=FALSE)
+write.table(sampleMetadata, file = "sampleMetadata.tsv", sep = "\t", row.names = FALSE, quote = FALSE)
b
diff -r c684ccd89267 -r 94eb263cfab4 xcms_export_samplemetadata.xml
--- a/xcms_export_samplemetadata.xml Wed Feb 12 08:27:57 2020 -0500
+++ b/xcms_export_samplemetadata.xml Wed Apr 07 09:53:54 2021 +0000
b
@@ -117,7 +117,9 @@
 Changelog/News
 --------------
 
-.. _News: https://bioconductor.org/packages/release/bioc/news/xcms/NEWS
+@HELP_XCMS_NEWVERSION_31200@
+
+@HELP_XCMS_NEWVERSION_3610@
 
 @HELP_XCMS_NEWVERSION_3610@