diff --git a/R/mix.R b/R/mix.R index bb914eea6b2eb87986ada56653941e41458c5f1c..1c1f397d152f39dcf5201bc863e652e5782d161a 100644 --- a/R/mix.R +++ b/R/mix.R @@ -98,6 +98,11 @@ getSMILESFromCmpL<-function(id,cmpL) { smiles } +getColFromCmpL<-function(id,cname,cmpL) { + ind<-match(id,cmpL$ID) + cmpL[[cname]][[ind]] +} + ##' Create directories without drama. ##' ##' Create directories without drama. diff --git a/R/shinyUI.R b/R/shinyUI.R index 8e4114ff530477253afc7e0db0ba042acc5233e0..f628ae024a767855ae1b59887aaa4f9dd5a5c91f 100644 --- a/R/shinyUI.R +++ b/R/shinyUI.R @@ -439,6 +439,11 @@ shinyScreenApp <- function(projDir=getwd()) { q } + getSetMode <- function(set,mzMLtab) { + sdf<-mzMLtab[which(mzMLtab$set %in% set),] + levels(factor(sdf$mode)) + } + server <- function(input,output,session) { ## ***** reactive values ***** @@ -683,10 +688,10 @@ shinyScreenApp <- function(projDir=getwd()) { setMode<-mzML$mode[match(sets,mzML$set)] names(setMode)<-sets nR<-nrow(rvSetId$df) - mode<-rvConf$mzMLtab dfSet<-rvSetId$df dfSet$mz<-rep(NA,nR) dfSet$SMILES<-rep(NA,nR) + dfSet$Name<-rep(NA,nR) cmpL<-getCmpL() for (s in sets) { md<-setMode[[s]] @@ -695,6 +700,7 @@ shinyScreenApp <- function(projDir=getwd()) { id<-dfSet[i,"ID"] dfSet[i,"mz"]<-getMzFromCmpL(id,md,cmpL) dfSet[i,"SMILES"]<-getSMILESFromCmpL(id,cmpL) + dfSet[i,"Name"]<-getColFromCmpL(id,"Name",cmpL) } } ## rvSetId$df<-dfSet