comparison XSeekerPreparator.R @ 6:207e36770d18 draft

" master branch Updating"
author lain
date Wed, 20 Jan 2021 17:47:51 +0000
parents a174cbbb12dd
children 5be8a770a11d
comparison
equal deleted inserted replaced
5:4d50e9324082 6:207e36770d18
1 1
2 2
3 TOOL_NAME <- "XSeekerPreparator" 3 TOOL_NAME <- "XSeekerPreparator"
4 VERSION <- "1.1.2" 4 VERSION <- "1.1.3"
5 5
6 OUTPUT_SPECIFIC_TOOL <- "XSeeker_Galaxy" 6 OUTPUT_SPECIFIC_TOOL <- "XSeeker_Galaxy"
7 7
8 ENRICHED_RDATA_VERSION <- paste("1.1.2", OUTPUT_SPECIFIC_TOOL, sep="-") 8 ENRICHED_RDATA_VERSION <- paste("1.1.2", OUTPUT_SPECIFIC_TOOL, sep="-")
9 ENRICHED_RDATA_DOC <- sprintf(" 9 ENRICHED_RDATA_DOC <- sprintf("
549 message("Features enrichment done.") 549 message("Features enrichment done.")
550 return (NULL) 550 return (NULL)
551 } 551 }
552 552
553 find_grouping_var <- function(var_meta) { 553 find_grouping_var <- function(var_meta) {
554 for (grouping_var in c(".", "Bio")) { 554 known_colnames = c(
555 if (!is.null(rdata$variableMetadata[[grouping_var]])) { 555 "name", "namecustom", "mz", "mzmin", "mzmax",
556 return (grouping_var) 556 "rt", "rtmin", "rtmax", "npeaks", "isotopes", "adduct", "pcgroup"
557 } 557 )
558 } 558 col_names <- colnames(var_meta)
559 return (NULL) 559 classes = list()
560 for (name in col_names) {
561 if (!(name %in% known_colnames)) {
562 classes[[length(classes)+1]] = name
563 }
564 }
565 if (length(classes) > 1) {
566 stop(sprintf("Only one class expected in the variable metadata. Found %d .", length(classes)))
567 }
568 if (length(classes) === 0) {
569 stop("Could not find any class column in your variableMetadata.")
570 }
571 return (classes[[1]])
560 } 572 }
561 573
562 add_sample_to_database <- function(orm, env, context, smol_xcms_set) { 574 add_sample_to_database <- function(orm, env, context, smol_xcms_set) {
563 message(sprintf("Processing sample %s", env$sample_name)) 575 message(sprintf("Processing sample %s", env$sample_name))
564 sample <- ( 576 sample <- (