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

Changeset 14:11ab2081bd4a (2021-04-12)
Previous changeset 13:226fb89cacc4 (2020-02-12) Next changeset 15:7faf9b2d83f6 (2023-09-11)
Commit message:
"planemo upload for repository https://github.com/workflow4metabolomics/xcms commit dff3ac53c7c305ff263e6358308db48cf9ed4e27"
modified:
README.rst
lib.r
macros_msnbase.xml
msnbase_readmsdata.r
msnbase_readmsdata.xml
repository_dependencies.xml
b
diff -r 226fb89cacc4 -r 11ab2081bd4a README.rst
--- a/README.rst Wed Feb 12 08:27:38 2020 -0500
+++ b/README.rst Mon Apr 12 09:35:02 2021 +0000
b
@@ -2,6 +2,12 @@
 Changelog/News
 --------------
 
+.. _News: https://lgatto.github.io/MSnbase/news/index.html
+
+**Version 2.16.1+galaxy0 - 08/04/2019**
+
+- UPGRADE: upgrade the MSnbase version from 2.8.2 to 2.16.1 (see MSnbase News_). Almost all the new features may not concern our usage of MSnbase.
+
 **Version 2.8.2.1 - 30/04/2019**
 
 - BUGFIX: remove the pre-compute of the chromatograms which was memory consuming. Now, only xcms plot chromatogram will generate the Chromatograms.
b
diff -r 226fb89cacc4 -r 11ab2081bd4a lib.r
--- a/lib.r Wed Feb 12 08:27:38 2020 -0500
+++ b/lib.r Mon Apr 12 09:35:02 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 226fb89cacc4 -r 11ab2081bd4a macros_msnbase.xml
--- a/macros_msnbase.xml Wed Feb 12 08:27:38 2020 -0500
+++ b/macros_msnbase.xml Mon Apr 12 09:35:02 2021 +0000
b
@@ -1,10 +1,10 @@
 <?xml version="1.0"?>
 <macros>
-    <token name="@WRAPPER_VERSION@">2.8.2</token>
+    <token name="@WRAPPER_VERSION@">2.16.1</token>
     <xml name="requirements">
         <requirements>
             <requirement type="package" version="@WRAPPER_VERSION@">bioconductor-msnbase</requirement>
-            <requirement type="package" version="1.1_4">r-batch</requirement>
+            <requirement type="package" version="1.1_5">r-batch</requirement>
             <requirement type="package" version="6.0">unzip</requirement>
             <yield />
         </requirements>
b
diff -r 226fb89cacc4 -r 11ab2081bd4a msnbase_readmsdata.r
--- a/msnbase_readmsdata.r Wed Feb 12 08:27:38 2020 -0500
+++ b/msnbase_readmsdata.r Mon Apr 12 09:35:02 2021 +0000
[
@@ -1,7 +1,7 @@
 #!/usr/bin/env Rscript
 
 # ----- LOG FILE -----
-log_file <- file("log.txt", open="wt")
+log_file <- file("log.txt", open = "wt")
 sink(log_file)
 sink(log_file, type = "output")
 
@@ -10,10 +10,12 @@
 cat("\tSESSION INFO\n")
 
 #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("MSnbase","batch")
+pkgs <- c("MSnbase", "batch")
 loadAndDisplayPackages(pkgs)
 cat("\n\n");
 
@@ -21,7 +23,7 @@
 # ----- ARGUMENTS -----
 cat("\tARGUMENTS INFO\n")
 args <- parseCommandArgs(evaluate = FALSE) #interpretation of arguments given in command line as an R list of objects
-write.table(as.matrix(args), col.names=F, quote=F, sep='\t')
+write.table(as.matrix(args), col.names = F, quote = F, sep = "\t")
 
 cat("\n\n")
 
@@ -38,7 +40,7 @@
 # Handle infiles
 if (!exists("singlefile")) singlefile <- NULL
 if (!exists("zipfile")) zipfile <- NULL
-rawFilePath <- retrieveRawfileInTheWorkingDirectory(singlefile, zipfile, args)
+rawFilePath <- retrieveRawfileInTheWorkingDir(singlefile, zipfile, args)
 zipfile <- rawFilePath$zipfile
 singlefile <- rawFilePath$singlefile
 files <- rawFilePath$files
@@ -55,23 +57,19 @@
 cat("\t\tCOMPUTE\n")
 
 cat("\t\t\tCreate a phenodata data.frame\n")
-s_groups <- sapply(files, function(x) tail(unlist(strsplit(dirname(x),"/")), n=1))
+s_groups <- sapply(files, function(x) tail(unlist(strsplit(dirname(x), "/")), n = 1))
 s_name <- tools::file_path_sans_ext(basename(files))
-pd <- data.frame(sample_name=s_name, sample_group=s_groups, stringsAsFactors=FALSE)
+pd <- data.frame(sample_name = s_name, sample_group = s_groups, stringsAsFactors = FALSE)
 print(pd)
 
 cat("\t\t\tLoad Raw Data\n")
-raw_data <- readMSData(files=files, pdata = new("NAnnotatedDataFrame", pd), mode="onDisk")
+raw_data <- readMSData(files = files, pdata = new("NAnnotatedDataFrame", pd), mode = "onDisk")
 
 # Transform the files absolute pathways into relative pathways
-raw_data@processingData@files <- sub(paste(getwd(), "/", sep="") , "", raw_data@processingData@files)
+raw_data@processingData@files <- sub(paste(getwd(), "/", sep = ""), "", raw_data@processingData@files)
 
 # Create a sampleMetada file
-sampleNamesList <- getSampleMetadata(xdata=raw_data, sampleMetadataOutput="sampleMetadata.tsv")
-
-#cat("\t\t\tCompute and Store TIC and BPI\n")
-#chromTIC <- chromatogram(raw_data, aggregationFun = "sum")
-#chromBPI <- chromatogram(raw_data, aggregationFun = "max")
+sampleNamesList <- getSampleMetadata(xdata = raw_data, sampleMetadataOutput = "sampleMetadata.tsv")
 
 cat("\n\n")
 
@@ -85,7 +83,7 @@
 
 #saving R data in .Rdata file to save the variables used in the present tool
 objects2save <- c("raw_data", "zipfile", "singlefile", "md5sumList", "sampleNamesList") #, "chromTIC", "chromBPI")
-save(list=objects2save[objects2save %in% ls()], file="readmsdata.RData")
+save(list = objects2save[objects2save %in% ls()], file = "readmsdata.RData")
 
 
 cat("\tDONE\n")
b
diff -r 226fb89cacc4 -r 11ab2081bd4a msnbase_readmsdata.xml
--- a/msnbase_readmsdata.xml Wed Feb 12 08:27:38 2020 -0500
+++ b/msnbase_readmsdata.xml Mon Apr 12 09:35:02 2021 +0000
b
@@ -1,4 +1,4 @@
-<tool id="msnbase_readmsdata" name="MSnbase readMSData" version="@WRAPPER_VERSION@.2">
+<tool id="msnbase_readmsdata" name="MSnbase readMSData" version="@WRAPPER_VERSION@+galaxy0">
     <description>Imports mass-spectrometry data files</description>
 
     <macros>
@@ -47,7 +47,7 @@
                 <has_text text="rowNames: faahKO_reduce/KO/ko15.CDF faahKO_reduce/KO/ko16.CDF" />
                 <has_text text="faahKO_reduce/WT/wt15.CDF faahKO_reduce/WT/wt16.CDF" />
                 <has_text text="featureNames: F1.S0001 F1.S0002 ... F4.S1278 (5112 total)" />
-                <has_text text="fvarLabels: fileIdx spIdx ... spectrum (28 total)" />
+                <has_text text="fvarLabels: fileIdx spIdx ... spectrum (33 total)" />
                 <has_text text="faahKO_reduce/KO/ko15.CDF        ko15           KO" />
                 <has_text text="faahKO_reduce/KO/ko16.CDF        ko16           KO" />
                 <has_text text="faahKO_reduce/WT/wt15.CDF        wt15           WT" />
@@ -61,7 +61,7 @@
                 <has_text text="rowNames: ko15.CDF" />
                 <has_text text="ko15.CDF" />
                 <has_text text="featureNames: F1.S0001 F1.S0002 ... F1.S1278 (1278 total)" />
-                <has_text text="fvarLabels: fileIdx spIdx ... spectrum (28 total)" />
+                <has_text text="fvarLabels: fileIdx spIdx ... spectrum (33 total)" />
                 <has_text text="ko15.CDF        ko15            ." />
             </assert_stdout>
         </test>
@@ -234,7 +234,11 @@
 Changelog/News
 --------------
 
-.. _News: https://bioconductor.org/packages/release/bioc/news/MSnbase/NEWS
+.. _News: https://lgatto.github.io/MSnbase/news/index.html
+
+**Version 2.16.1+galaxy0 - 08/04/2019**
+
+- UPGRADE: upgrade the MSnbase version from 2.8.2 to 2.16.1 (see MSnbase News_). Almost all the new features may not concern our usage of MSnbase.
 
 **Version 2.8.2.1 - 30/04/2019**
 
b
diff -r 226fb89cacc4 -r 11ab2081bd4a repository_dependencies.xml
--- a/repository_dependencies.xml Wed Feb 12 08:27:38 2020 -0500
+++ b/repository_dependencies.xml Mon Apr 12 09:35:02 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