Skip to content

Commit

Permalink
add option to generate sample names from raw.file or factors or provi…
Browse files Browse the repository at this point in the history
…de in annotation
  • Loading branch information
wolski committed Dec 13, 2023
1 parent db51cad commit 9da83de
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions R/AnalysisConfiguration.R
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ R6_extract_values <- function(r6class){
#' sample_analysis <- setup_analysis(prolfqua_data('data_skylinePRMSample_A')$data, skylineconfig)
#'

setup_analysis <- function(data, configuration, cc = TRUE ){
setup_analysis <- function(data, configuration, cc = TRUE, from_factors = FALSE){
configuration <- configuration$clone(deep = TRUE)
table <- configuration$table

Expand Down Expand Up @@ -159,7 +159,7 @@ setup_analysis <- function(data, configuration, cc = TRUE ){

sampleName <- table$sampleName

if (FALSE & !sampleName %in% names(data)) {
if (from_factors & !sampleName %in% names(data)) {
message("creating sampleName from factor columns")
data <- data |> tidyr::unite(
UQ(sym(sampleName)) ,
Expand Down
2 changes: 1 addition & 1 deletion R/AnalysisTableAnnotation.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ AnalysisTableAnnotation <- R6::R6Class(

#' @field fileName column name of column containing raw file names
fileName = NULL,
#' @field sampleName (will be generated from factors)
#' @field sampleName (will be generated from factors or fileName)
sampleName = "sampleName",

#' @field isotopeLabel which column contains the isotope label (e.g. heavy or light), Gor light only if LFQ.
Expand Down
2 changes: 1 addition & 1 deletion man/AnalysisTableAnnotation.Rd

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

2 changes: 1 addition & 1 deletion man/setup_analysis.Rd

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

0 comments on commit 9da83de

Please sign in to comment.