diff lib.r @ 29:c013ed353a2f draft

planemo upload for repository https://github.com/workflow4metabolomics/xcms commit 73791d74546087b2a872d9279df960f5bc207298
author lecorguille
date Tue, 13 Feb 2018 04:44:03 -0500
parents 30410a052ab3
children 4d6f4cd7c3ef
line wrap: on
line diff
--- a/lib.r	Thu Oct 26 11:16:24 2017 -0400
+++ b/lib.r	Tue Feb 13 04:44:03 2018 -0500
@@ -51,42 +51,6 @@
     write.table(dataMatrix, file=dataMatrixOutput,sep="\t",quote=F,row.names=F)
 }
 
-#@author G. Le Corguille
-exportTicBpcTabular <- function(dataset, filenameBase, ticORbpc, rt='raw') {
-
-        rawORcorrected = ''
-        title = ''
-        if (rt=='corrected') {
-            rawORcorrected = '_corrected'
-            title = ' corrected by retcor'
-        }
-
-        if (ticORbpc == "TIC") {
-            section_name = paste0('TIC',rawORcorrected)
-            title = paste0('Total Ion Current (TIC) chromatogram',title)
-            description = 'Sum of intensity (Y) of all ions detected at each retention time(X)'
-        } else if (ticORbpc == "BPC") {
-            section_name = paste0('BPC',rawORcorrected)
-            title = paste0('Base Peak Chromatogram (BPC)',title)
-            description = 'Sum of intensity (Y) of the most intense peaks at each retention time(X)'
-        }
-
-        filename=paste0(basename(file_path_sans_ext(filenameBase)),"-",ticORbpc,rawORcorrected,"_mqc.out")
-
-        # Headers for MultiQC
-        cat("# file_format: 'tsv'\n", sep="", file = filename)
-        cat("# section_name: '",section_name,"'\n", sep="", file = filename, append = T)
-        cat("# title: '",title,"'\n", sep="", file = filename, append = T)
-        cat("# description: '",description,"'\n", sep="", file = filename, append = T)
-        cat("# plot_type: 'linegraph'\n", sep="", file = filename, append = T)
-        cat("# pconfig:\n", sep="", file = filename, append = T)
-        cat("#     id: '",ticORbpc,rawORcorrected,"_lineplot'\n", sep="", file = filename, append = T)
-        cat("#     ylab: 'Base Peak Intensity'\n", sep="", file = filename, append = T)
-        cat("#     xlab: 'Retention Time'\n", sep="", file = filename, append = T)
-        cat("Intensity\tRT\n", file = filename, append = T)
-        write.table(dataset, filename ,row.names = F, col.names = F, sep = "\t", append = T, quote = F)
-}
-
 #@author Y. Guitton
 getBPC <- function(file,rtcor=NULL, ...) {
     object <- xcmsRaw(file)
@@ -130,9 +94,6 @@
             rtcor <- NULL
 
         TIC[[j]] <- getBPC(files[j],rtcor=rtcor)
-
-        exportTicBpcTabular(TIC[[j]], files[j], "BPC", rt=rt)
-
         # TIC[[j]][,1]<-rtcor
     }
 
@@ -260,8 +221,6 @@
             rtcor <- xcmsSet@rt$corrected[[i]] else
         rtcor <- NULL
         TIC[[i]] <- getTIC(files[i],rtcor=rtcor)
-
-        exportTicBpcTabular(TIC[[i]], files[i], "TIC", rt=rt)
     }
 
     pdf(pdfname,w=16,h=10)
@@ -517,7 +476,7 @@
 
 
 # This function get the raw file path from the arguments
-getRawfilePathFromArguments <- function(singlefile, zipfile, listArguments) {
+getRawfilePathFromArguments <- function(singlefile, zipfile, listArguments) {    
     if (!is.null(listArguments[["zipfile"]]))           zipfile = listArguments[["zipfile"]]
     if (!is.null(listArguments[["zipfilePositive"]]))   zipfile = listArguments[["zipfilePositive"]]
     if (!is.null(listArguments[["zipfileNegative"]]))   zipfile = listArguments[["zipfileNegative"]]