comparison createDatabase.R @ 8:a507a2ccb46d draft

planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit 74e7bfbb5e70ec6e665114fa9e9863dafd7bced5
author tomnl
date Tue, 25 Jun 2019 06:10:36 -0400
parents f12213ae74c4
children 1ce857d74106
comparison
equal deleted inserted replaced
7:b663ab95274b 8:a507a2ccb46d
2 library(optparse) 2 library(optparse)
3 library(xcms) 3 library(xcms)
4 library(CAMERA) 4 library(CAMERA)
5 print(sessionInfo()) 5 print(sessionInfo())
6 print('CREATING DATABASE') 6 print('CREATING DATABASE')
7
8
9 7
10 xset_pa_filename_fix <- function(opt, pa, xset){ 8 xset_pa_filename_fix <- function(opt, pa, xset){
11 9
12 if (!is.null(opt$mzML_files) && !is.null(opt$galaxy_names)){ 10 if (!is.null(opt$mzML_files) && !is.null(opt$galaxy_names)){
13 # NOTE: Relies on the pa@fileList having the names of files given as 'names' of the variables 11 # NOTE: Relies on the pa@fileList having the names of files given as 'names' of the variables
154 return(x) 152 return(x)
155 153
156 } 154 }
157 155
158 xset@peaks <- as.matrix(plyr::ddply(data.frame(xset@peaks), ~ sample, convert2Raw, xset=xset)) 156 xset@peaks <- as.matrix(plyr::ddply(data.frame(xset@peaks), ~ sample, convert2Raw, xset=xset))
159 closeAllConnections() 157
160 # Saves the EICS into the previously created database 158 # Saves the EICS into the previously created database
161 px <- msPurity::purityX(xset, saveEIC = TRUE, 159 xgroups <- as.numeric(as.character(unique(pa@grped_df$grpid)))
162 cores=1, sqlitePth=dbPth, 160 px <- msPurity::purityX(xset,
163 rtrawColumns = TRUE) 161 saveEIC = TRUE,
162 cores=1,
163 sqlitePth=dbPth,
164 rtrawColumns = TRUE,
165 xgroups = xgroups)
164 166
165 } 167 }
166 168
167 closeAllConnections() 169 closeAllConnections()