Skip to content

Commit

Permalink
Merge pull request #42 from UMCUGenetics/dev
Browse files Browse the repository at this point in the history
DIMSv2.1.0
  • Loading branch information
FiniDG authored Jan 15, 2021
2 parents 3f59d25 + 296b292 commit 8a715f5
Show file tree
Hide file tree
Showing 12 changed files with 285 additions and 135 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ GUI/src/config.R
post/input
post/output
post/results

#Macfiles
.DS_Store
pipeline/.DS_Store
32 changes: 30 additions & 2 deletions GUI/src/config_default.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ db2 <- paste0(base, "/tools/db/HMDB_with_info_relevance_IS_C5OH.RData")

### Default parameters - for lists it defaults to the first one
run_pipeline <- TRUE # put on FALSE if you solely want to upload data

# Everything below here doesn't need to be edited for every run,
# as the parameters in the GUI override these
login <- ""
Expand Down Expand Up @@ -47,5 +48,32 @@ ssh_transfer <- "hpct01.op.umcutrecht.nl"
commit <- paste(system("git name-rev HEAD", intern = TRUE),
system("git rev-parse HEAD", intern = TRUE))


# TODO Default job times
### Max allowed time and memory per queued job
jobs <- list(
job_0 = list(time = "00:05:00", mem = "2G"),
job_1 = list(time = "00:05:00", mem = "2G"),
job_2 = list(time = "00:10:00", mem = "4G"),
job_3 = list(time = "01:30:00", mem = "5G"),
job_4 = list(time = "01:00:00", mem = "8G"),
job_5 = list(time = "02:00:00", mem = "8G"),
job_6 = list(time = "02:30:00", mem = "4G"),
job_7 = list(time = "01:00:00", mem = "8G"),
job_8 = list(time = "01:00:00", mem = "8G"),
job_9a = list(time = "00:30:00", mem = "4G"),
job_9b = list(time = "00:30:00", mem = "4G"),
job_10 = list(time = "01:00:00", mem = "8G"),
job_11 = list(time = "03:00:00", mem = "8G"),
job_12 = list(time = "00:30:00", mem = "8G"),
job_13 = list(time = "01:00:00", mem = "8G"),
job_14 = list(time = "00:05:00", mem = "500M"),
job_hmdb1 = list(time = "03:00:00", mem = "8G"),
job_hmdb2 = list(time = "03:00:00", mem = "8G"),

queue_0 = list(time = "00:05:00", mem = "1G"),
queue_1 = list(time = "00:05:00", mem = "1G"),
queue_2 = list(time = "00:05:00", mem = "500M"),
queue_3 = list(time = "00:05:00", mem = "500M"),
queue_4 = list(time = "00:05:00", mem = "500M"),
queue_5 = list(time = "00:05:00", mem = "500M"),
queue_6 = list(time = "00:05:00", mem = "500M")
)
26 changes: 24 additions & 2 deletions GUI/src/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,15 @@ function(input, output, session) {
t_reps <- trimws(selected_samples[,1]) # technical replicates / samples, usually 3 per biological replicate
b_reps <- trimws(selected_samples[,2]) # biological replicates / patients
wrong_t_rep_count = FALSE
wrong_samplenames = c()
for (b_rep in unique(b_reps)) {
if (sum(b_reps == b_rep) != input$nrepl) {
wrong_t_rep_count = TRUE
}
# check 10 : if name fits requirements ( + -> 1 or more, * -> 0 or more)
if (grepl("^(?:(?!(C|P))[a-zA-Z0-9]+_{1})?(C|P){1}[0-9]+\\.([1-9]\\d*)+", b_rep, perl = TRUE) != TRUE) {
wrong_samplenames <- c(b_rep, wrong_samplenames)
}
}
if (length(t_reps) == 0 || wrong_t_rep_count || length(t_reps) / input$nrepl != length(unique(b_reps))) {
output$check4 <- renderText({"No"})
Expand All @@ -116,6 +121,18 @@ function(input, output, session) {
output$check4 <- renderText({"Yes"})
}

# check 10 continued
if (input$z_score == "1") {
if (length(wrong_samplenames) > 0) {
output$check10 <- renderText({"No"})
output$check10_extra <- renderText({paste0("Wrong: ", paste(wrong_samplenames, collapse=', '))})
passed = FALSE
} else {
output$check10 <- renderText({"Yes"})
output$check10_extra <- renderText({""})
}
}

# check 5 : Parameters
if (input$login == '' ||
input$password == '' ||
Expand Down Expand Up @@ -240,6 +257,11 @@ function(input, output, session) {
paste0("db2=", config$db2)
)

for (i in 1:length(config$jobs)) {
parameters <- c(parameters, paste0(names(config$jobs)[[i]], "_time=", config$jobs[[i]]$time))
parameters <- c(parameters, paste0(names(config$jobs)[[i]], "_mem=", config$jobs[[i]]$mem))
}

writeLines(parameters, file_con, sep = "\n")
close(file_con)

Expand All @@ -258,10 +280,10 @@ function(input, output, session) {
### Transfer over RAW data
input_folder_name <- paste(as.vector(unlist(input$input_folder['path']))[-1], collapse = "/", sep="")
input_dir = paste(config$root, input_folder_name, sep = "/")
raw_files <- paste0(input_dir, "/", t_reps, ".raw")
cat("Copying files from", input_dir, "to:", hpc_input_dir, "... (ignore the %)\n")

scp_upload(ssh_transfer,
list.files(path = input_dir, pattern = ".raw$", full.names = TRUE),
raw_files,
to = hpc_input_dir)

### Transfer over the tmp files to raw data folder (init.RData, settings.config)
Expand Down
5 changes: 5 additions & 0 deletions GUI/src/ui.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ dashboardPage(
column(1, textOutput("check4")),
column(11, p(tags$b("Every biological sample has the correct amount of technical replicates."))),
br(),br(),
column(1, textOutput("check10")),
column(11, p(tags$b("If Z score enabled, all biological samples follow the naming requirements (must contain C or P, etc.)"))),
column(1),
column(11, textOutput("check10_extra")),
br(),br(),
column(1, textOutput("check5")),
column(11, p(tags$b("All parameters have been filled in and selected."))),
br(),br(),
Expand Down
Loading

0 comments on commit 8a715f5

Please sign in to comment.