Mercurial > repos > tomnl > track_rt_raw
comparison create_sqlite_db.R @ 16:f0447f4133e6 draft
planemo upload for repository https://github.com/computational-metabolomics/mspurity-galaxy commit f396d6689e17cb5537f54ada02a6bd691c7894d7
| author | tomnl |
|---|---|
| date | Tue, 15 May 2018 06:46:35 -0400 |
| parents | 2b77eb79fac1 |
| children | 40561a4180d5 |
comparison
equal
deleted
inserted
replaced
| 15:2b77eb79fac1 | 16:f0447f4133e6 |
|---|---|
| 122 if (is.null(opt$raw_rt_columns)){ | 122 if (is.null(opt$raw_rt_columns)){ |
| 123 rtrawColumns <- FALSE | 123 rtrawColumns <- FALSE |
| 124 }else{ | 124 }else{ |
| 125 rtrawColumns <- TRUE | 125 rtrawColumns <- TRUE |
| 126 } | 126 } |
| 127 if (is.null(xset)){ | |
| 128 xset <- xsa@xa | |
| 129 } | |
| 127 # previous check should have matched filelists together | 130 # previous check should have matched filelists together |
| 128 xset@filepaths <- unname(pa@fileList) | 131 xset@filepaths <- unname(pa@fileList) |
| 129 | 132 |
| 130 # Saves the EICS into the previously created database | 133 # Saves the EICS into the previously created database |
| 131 px <- msPurity::purityX(xset, saveEIC = TRUE, | 134 px <- msPurity::purityX(xset, saveEIC = TRUE, |
| 144 # bug for repeating headers | 147 # bug for repeating headers |
| 145 df <- df[!df$UID=='UID',] | 148 df <- df[!df$UID=='UID',] |
| 146 | 149 |
| 147 # get peakid, an scan id | 150 # get peakid, an scan id |
| 148 df_ids <- stringr::str_split_fixed(df$UID, '-', 3) | 151 df_ids <- stringr::str_split_fixed(df$UID, '-', 3) |
| 149 colnames(df_ids) <- c('grp_id', 'file_id', 'peak_id') | 152 colnames(df_ids) <- c('grp_id', 'file_id', 'pid') |
| 150 df <- cbind(df_ids, df) | 153 df <- cbind(df_ids, df) |
| 151 # export to database | 154 # export to database |
| 152 | 155 |
| 153 | 156 |
| 154 DBI::dbWriteTable(con, name=name, value=df, row.names=FALSE) | 157 DBI::dbWriteTable(con, name=name, value=df, row.names=FALSE) |
