Skip to content

Commit

Permalink
add validate #1
Browse files Browse the repository at this point in the history
  • Loading branch information
cpanse committed Jan 28, 2025
1 parent 5bb0f38 commit 2288a39
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 12 deletions.
30 changes: 20 additions & 10 deletions R/configProteomics.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ qconfigProteomicsEVOSEP6x12x8PlateHystar <- function(x, howOften = 48, ...){

stopifnot(is.integer(howOftenClean))
message(paste0("howOftenClean:\t", howOftenClean))
message(paste0("howOften:\t", howOften))
message(paste0("howOften qconfigProteomicsEVOSEP6x12x8PlateHystar:\t", howOften))

df <- x
#browser()
Y <- c('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H')

currentdate <- format(Sys.time(), "%Y%m%d")
Expand All @@ -42,16 +43,19 @@ qconfigProteomicsEVOSEP6x12x8PlateHystar <- function(x, howOften = 48, ...){
for (i in 1:nrow(df)){
output <- rbind(output, df[i, ])


if (i %% howOftenClean == 0) {
clean <- c(sprintf("%s_@@@_clean_%02d", currentdate, cleancount), df$Path[1], sprintf("5:%s,%d", Y[cleancounty], cleancountx), 1, "FGCZ", "clean", "clean", "clean")
clean <- c(sprintf("%s_@@@_clean_%02d", currentdate, cleancount),
df$Path[1], sprintf("5:%s,%d", Y[cleancounty], cleancountx),
1, "FGCZ", "clean", "clean", "clean")
cleancountx <- cleancountx + 1
cleancount <- cleancount + 1
output <- rbind(output, clean)
}

if(i %% howOften == 0) {
autoQC03 <- c(sprintf("%s_@@@_autoQC03dia_%02d", currentdate, autoQC03countx), df$Path[1], sprintf("6:%s,%d", Y[autoQC03county], autoQC03countx), 1, "FGCZ", "autoQC03", "autoQC03", "autoQC03")
autoQC03 <- c(sprintf("%s_@@@_autoQC03dia_%02d", currentdate, autoQC03countx),
df$Path[1],
sprintf("6:%s,%d", Y[autoQC03county], autoQC03countx), 1, "FGCZ", "autoQC03", "autoQC03", "autoQC03")
autoQC03countx <- autoQC03countx + 1
autoQC03count <- autoQC03count + 1
output <- rbind(output, autoQC03)
Expand All @@ -69,10 +73,15 @@ qconfigProteomicsEVOSEP6x12x8PlateHystar <- function(x, howOften = 48, ...){
}

} # for loop

## START
autoQC03 <- c(sprintf("%s_@@@_autoQC03dia_00", currentdate, autoQC03countx), df$Path[1], sprintf("6:%s,%d", Y[autoQC03county], autoQC03countx), 1, "FGCZ", "autoQC03", "autoQC03", "autoQC03")
output <- rbind(autoQC03, output)
message("DEBUG -> howOften qconfigProteomicsEVOSEP6x12x8PlateHystar:\t")

## START ##########################
autoQC03 <- c(sprintf("%s_@@@_autoQC03dia_00", currentdate, autoQC03countx),
df$Path[1],
sprintf("6:%s,%d", Y[autoQC03county], autoQC03countx),
1, "FGCZ", "autoQC03", "autoQC03", "autoQC03")

output <- rbind(autoQC03, output)
clean <- c(sprintf("%s_@@@_clean_00", currentdate, cleancount), df$Path[1], sprintf("5:%s,%d", Y[cleancounty], cleancountx), 1, "FGCZ", "clean", "clean", "clean")
output <- rbind(clean, output)
cleancountx <- cleancountx + 1
Expand All @@ -88,14 +97,15 @@ qconfigProteomicsEVOSEP6x12x8PlateHystar <- function(x, howOften = 48, ...){
}

## TODO add autoQC03
## END
## END ###############################
clean <- c(sprintf("%s_@@@_clean_%02d", currentdate, cleancount), df$Path[1], sprintf("5:%s,%d", Y[cleancounty], cleancountx), 1, "FGCZ", "clean", "clean", "clean")
output <- rbind(output, clean)

autoQC03 <- c(sprintf("%s_@@@_autoQC03dia_ZZ", currentdate, autoQC03countx),
df$Path[1], sprintf("6:%s,%d", Y[autoQC03county], autoQC03countx), 1, "FGCZ", "autoQC03", "autoQC03", "autoQC03")
output <- rbind(output, autoQC03)

message("qconfigProteomicsEVOSEP6x12x8PlateHystar DONE")
output
}

Expand Down
18 changes: 17 additions & 1 deletion R/configs.R
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,20 @@
}


validate.composePlateSampleTable <- function(x){
stopifnot(ncol(x) == 10)
stopifnot(all(c("Sample ID",
"Sample Name",
"Tube ID",
"Position",
"GridPosition",
"File Name",
"Path",
"Inj Vol",
"L3 Laboratory",
"Instrument Method") %in% colnames(x)))
x
}
#' Compose plate sample table
#'
#' @param p
Expand Down Expand Up @@ -225,7 +239,9 @@
plateCounter <<- plateCounter + 1
## TODO(cp): check if this is necessary
#p[, columnOrder]
p


validate.composePlateSampleTable(p)
}


Expand Down
2 changes: 1 addition & 1 deletion R/shiny.R
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@
plateCounter = plateCounter,
randomization = input$randomization) -> p


# global counter
plateCounter <<- plateCounter + 1
## TODO(cp): check if this is necessary
Expand Down

0 comments on commit 2288a39

Please sign in to comment.