Dear Gitlab users, due to maintenance reasons, Gitlab will not be available on Thursday 30.09.2021 from 5:00 pm to approximately 5:30 pm.

Commit 45c264d6 authored by joerg.buescher's avatar joerg.buescher
Browse files

more robust handling of missing values in manual_peakcheck

parent 4ccdc195
......@@ -48,7 +48,7 @@ evaluate_peaks <- function(msd, prm){
#update plotdata label2
quantile_label <- paste0(names(ml_quantile),": ",ml_quantile,collapse=" ")
new_label <- paste0(paste("rep: ",final_pred),"\n",quantile_label)
new_label <- paste0(paste("rep: ", round(final_pred,3),"\n",quantile_label) )
msd[[im]][[id]]$label2 <- paste(msd[[im]][[id]]$label2, new_label)
nowchecksum <- sum(msd[[im]][[id]]$foundchrom)
......
......@@ -32,10 +32,14 @@ generate_Xy_data_peaks_final <- function(xlsx_path,tsv_path){
sample <- substr(xlsx_td[row,1], 1, nchar(xlsx_td[row,1])-5)
}
rownames(my_data)[count] <- paste0(metnames[im]," ",sample)
my_data[count,1] <- xlsx_td[row,col]
count <- count + 1
nowscore <- as.numeric(xlsx_td[row, col])
if (nowscore %in% c(0, 1, 2)) {
my_data[count,1] <- nowscore
count <- count + 1
}
}
}
my_data <- my_data[1:(count-1), ]
# parse quality scores from tsv file
for (row in 1 : nrow(tsv_td)){
......
......@@ -25,6 +25,11 @@ process_batch <- function(nowfolder = "", parameters = list(), return_msd=FALSE)
if(!dir.exists(nowfolder)){
cat(paste0(nowfolder," directory doesn't exist!"))
return(NULL)
} else {
nowfolderlength <- nchar(nowfolder)
if (substr(nowfolder,nowfolderlength, nowfolderlength) == '/') {
nowfolder <- substr(nowfolder,1,nowfolderlength-1)
}
}
}
......@@ -46,6 +51,7 @@ process_batch <- function(nowfolder = "", parameters = list(), return_msd=FALSE)
updatedata <- updatedata[-1, ]
if (('Variable in prm' %in% colnames(updatedata)) && ('Value' %in% colnames(updatedata)) ) {
print(paste0('Updating parameters from ', update_prm_path))
for (iv in 1:nrow(updatedata)) {
nowvalue <- updatedata[iv,'Value']
if (nowvalue %in% c("TRUE", "FALSE")) {
......@@ -56,7 +62,7 @@ process_batch <- function(nowfolder = "", parameters = list(), return_msd=FALSE)
prm[[updatedata[iv,'Variable in prm']]] <- nowvalue
}
} else {
print('Error in update_prm.xlsx, cannot find required columns "Variabel in prm" and "Value".')
print(paste0('Error in ',update_prm_path ,' , cannot find required columns "Variabel in prm" and "Value".'))
}
}
......@@ -103,8 +109,11 @@ process_batch <- function(nowfolder = "", parameters = list(), return_msd=FALSE)
prm$median_values <- model_median_values
# only keep what we need
rm('model_pcand', 'model_median_values', 'train_preprocessing_pcand', 'train_dummy_vars_pcand')
if (prm$verbose >= 2) {
print(paste0('Successfully loaded 1. model from ', prm$model_path))
}
} else {
cat(paste0(prm$model_path,": model doesn't exist!"))
cat(paste0(prm$model_path,": 1. model doesn't exist!"))
return(NULL)
}
}
......@@ -115,8 +124,11 @@ process_batch <- function(nowfolder = "", parameters = list(), return_msd=FALSE)
prm$train_preprocessing_final <- train_preprocessing_finalp
# only keep what we need
rm('model_finalp', 'train_preprocessing_finalp', 'train_dummy_vars_finalp')
if (prm$verbose >= 2) {
print(paste0('Successfully loaded 2. model from ', prm$model_final_path))
}
} else {
cat(paste0(prm$model_path,": model doesn't exist!"))
cat(paste0(prm$model_final_path,": 2. model doesn't exist!"))
return(NULL)
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment