comparison xcms_merge.r @ 8:6b5504f877ff draft

planemo upload for repository https://github.com/workflow4metabolomics/xcms commit 7b226c3ba91a3cf654ec1c14b3ef85090968bb0f
author lecorguille
date Mon, 05 Mar 2018 04:16:12 -0500
parents dca722aecb67
children 35b9bb3205d8
comparison
equal deleted inserted replaced
7:dca722aecb67 8:6b5504f877ff
21 21
22 cat("\tXSET MERGING...\n") 22 cat("\tXSET MERGING...\n")
23 23
24 for(image in args$images) { 24 for(image in args$images) {
25 load(image) 25 load(image)
26 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.*")
26 cat(sampleNamesList$sampleNamesOrigin,"\n") 27 cat(sampleNamesList$sampleNamesOrigin,"\n")
27 if (!exists("xdata_merged")) { 28 if (!exists("xdata_merged")) {
28 xdata_merged <- xdata 29 xdata_merged <- xdata
29 singlefile_merged <- singlefile 30 singlefile_merged <- singlefile
30 md5sumList_merged <- md5sumList 31 md5sumList_merged <- md5sumList
61 error_message <- paste("Those samples are missing in your sampleMetadata:", paste(sample_missing, collapse=" ")) 62 error_message <- paste("Those samples are missing in your sampleMetadata:", paste(sample_missing, collapse=" "))
62 print(error_message) 63 print(error_message)
63 stop(error_message) 64 stop(error_message)
64 } 65 }
65 } 66 }
66 save.image() 67
68 # Create a sampleMetada file
69 sampleNamesList <- getSampleMetadata(xdata=xdata, sampleMetadataOutput="sampleMetadata.tsv")
70
71 # Get the legacy xcmsSet object
72 xset <- getxcmsSetObject(xdata)
73
74 cat("\n\n")
75
76
77 # -- TIC --
78 cat("\t\tGET TIC GRAPH\n")
79 #@TODO: one day, use xdata instead of xset to draw the TICs and BPC or a complete other method
80 getTICs(xcmsSet=xset, rt="raw", pdfname="TICs.pdf")
81 getBPCs(xcmsSet=xset, rt="raw", pdfname="BICs.pdf")
82
83 cat("\n\n")
67 84
68 cat("\tXCMSnExp OBJECT INFO\n") 85 cat("\tXCMSnExp OBJECT INFO\n")
69 print(pData(xdata)) 86 print(pData(xdata))
70 print(xdata) 87 print(xdata)
71 cat("\n\n") 88 cat("\n\n")