Skip to content

Commit

Permalink
change in rename response,
Browse files Browse the repository at this point in the history
  • Loading branch information
wolski committed Jun 22, 2022
1 parent c8f6d26 commit 6cca5d9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
15 changes: 8 additions & 7 deletions R/LFQData.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#' istar <- prolfqua_data('data_ionstar')$filtered()
#'
#' data <- istar$data |> dplyr::filter(protein_Id %in% sample(protein_Id, 100))
#' #LFQData$debug("rename_response")
#' lfqdata <- LFQData$new(data, istar$config)
#' tmp <- lfqdata$to_wide()
#' stopifnot("data.frame" %in% class(tmp$data))
Expand All @@ -18,7 +19,7 @@
#' lfqdata$omit_NA()
#'
#' lfqdata$response()
#' lfqdata$rename_response()
#' lfqdata$rename_response("peptide.intensity")
#' lfqdata$response()
#' lfqdata$get_Plotter()$heatmap()
#' stopifnot("LFQData" %in% class(lfqdata$get_copy()))
Expand Down Expand Up @@ -176,14 +177,14 @@ LFQData <- R6::R6Class(
#' @param newname default Intensity
rename_response = function(newname = "Intensity"){
if((newname %in% colnames(self$data))){
logger::log_messages(paste(newname, " already in data :", colnames(self$data), ".", collapse = " "))
msg <- paste(newname, " already in data :", paste( colnames(self$data), collapse = " "), ".")
logger::log_info(msg)
logger::log_error("provide different name.")
stop()
} else {
old <- self$config$table$popWorkIntensity()
self$config$table$setWorkIntensity(newname)
self$data <- self$data |> dplyr::rename(!!newname := !!sym(old))
}

old <- self$config$table$popWorkIntensity()
self$config$table$setWorkIntensity(newname)
self$data <- self$data |> dplyr::rename(!!newname := !!sym(old))
},
#' @description
#' number of elements at each level
Expand Down
3 changes: 2 additions & 1 deletion man/LFQData.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6cca5d9

Please sign in to comment.