comparison xcms_xcmsSet.r @ 30:14b1c52fae62 draft

"planemo upload for repository https://github.com/workflow4metabolomics/xcms commit f1caf2a3bf23cf319a75dd12c86402555dd02617"
author workflow4metabolomics
date Wed, 12 Feb 2020 08:30:58 -0500
parents 9eebe9690ced
children eb15a3841da4
comparison
equal deleted inserted replaced
29:793f87231d49 30:14b1c52fae62
57 #image is an .RData file necessary to use xset variable given by previous tools 57 #image is an .RData file necessary to use xset variable given by previous tools
58 load(args$image) 58 load(args$image)
59 if (!exists("raw_data")) stop("\n\nERROR: The RData doesn't contain any object called 'raw_data' which is provided by the tool: MSnbase readMSData") 59 if (!exists("raw_data")) stop("\n\nERROR: The RData doesn't contain any object called 'raw_data' which is provided by the tool: MSnbase readMSData")
60 60
61 # Handle infiles 61 # Handle infiles
62 if (!exists("singlefile")) singlefile <- NULL 62 rawFilePath <- retrieveRawfileInTheWorkingDirectory(singlefile, zipfile, args)
63 if (!exists("zipfile")) zipfile <- NULL
64 rawFilePath <- getRawfilePathFromArguments(singlefile, zipfile, args)
65 zipfile <- rawFilePath$zipfile 63 zipfile <- rawFilePath$zipfile
66 singlefile <- rawFilePath$singlefile 64 singlefile <- rawFilePath$singlefile
67 directory <- retrieveRawfileInTheWorkingDirectory(singlefile, zipfile)
68 65
69 66
70 cat("\n\n") 67 cat("\n\n")
71 68
72 69
73 # ----- MAIN PROCESSING INFO ----- 70 # ----- MAIN PROCESSING INFO -----
74 cat("\tMAIN PROCESSING INFO\n") 71 cat("\tMAIN PROCESSING INFO\n")
75 72
76 73
77 cat("\t\tCOMPUTE\n") 74 cat("\t\tCOMPUTE\n")
78
79 ## Get the full path to the files
80 files <- getMSFiles(directory)
81 75
82 cat("\t\t\tApply filter[s] (if asked)\n") 76 cat("\t\t\tApply filter[s] (if asked)\n")
83 if (exists("filterAcquisitionNumParam")) raw_data <- filterAcquisitionNum(raw_data, filterAcquisitionNumParam[1]:filterAcquisitionNumParam[2]) 77 if (exists("filterAcquisitionNumParam")) raw_data <- filterAcquisitionNum(raw_data, filterAcquisitionNumParam[1]:filterAcquisitionNumParam[2])
84 if (exists("filterRtParam")) raw_data <- filterRt(raw_data, filterRtParam) 78 if (exists("filterRtParam")) raw_data <- filterRt(raw_data, filterRtParam)
85 if (exists("filterMzParam")) raw_data <- filterMz(raw_data, filterMzParam) 79 if (exists("filterMzParam")) raw_data <- filterMz(raw_data, filterMzParam)
96 print(findChromPeaksParam) 90 print(findChromPeaksParam)
97 xdata <- findChromPeaks(raw_data, param=findChromPeaksParam) 91 xdata <- findChromPeaks(raw_data, param=findChromPeaksParam)
98 92
99 # Check if there are no peaks 93 # Check if there are no peaks
100 if (nrow(chromPeaks(xdata)) == 0) stop("No peaks were detected. You should review your settings") 94 if (nrow(chromPeaks(xdata)) == 0) stop("No peaks were detected. You should review your settings")
101
102 # Transform the files absolute pathways into relative pathways
103 xdata@processingData@files <- sub(paste(getwd(), "/", sep="") , "", xdata@processingData@files)
104 95
105 # Create a sampleMetada file 96 # Create a sampleMetada file
106 sampleNamesList <- getSampleMetadata(xdata=xdata, sampleMetadataOutput="sampleMetadata.tsv") 97 sampleNamesList <- getSampleMetadata(xdata=xdata, sampleMetadataOutput="sampleMetadata.tsv")
107 98
108 #cat("\t\t\tCompute and Store TIC and BPI\n") 99 #cat("\t\t\tCompute and Store TIC and BPI\n")