-
Notifications
You must be signed in to change notification settings - Fork 2
Conversation
tests/testthat/summary_test.txt
Outdated
@@ -0,0 +1,3 @@ | |||
Raw file Experiment | |||
Bernd baut bemüht bienen bei blumenbergen Exp1 | |||
Dieter drückt daknbar den dünnen Daniel durch die dicke dauerbelstete Dachrinne Exp2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WTF 🤣
*dankbar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ups.. that was the wrong test file :D
tests/testthat/summary_test_2.txt
Outdated
@@ -0,0 +1,3 @@ | |||
Raw file False | |||
Bernd baut bemüht bienen bei blumenbergen Exp1 | |||
Dieter drückt daknbar den dünnen Daniel durch die dicke dauerbelastete Dachrinne Exp2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**dankbar
R/parser.R
Outdated
@@ -286,6 +299,8 @@ parse_MaxQuant <- function(proteinGroups_in, summary_in, outfile, outfile_reduce | |||
# writing reduced CLARION file | |||
write_clarion_file(meta = meta_reduced, out = outfile_reduced, format = format, | |||
version = version, exp_id = experiment_id, pGroups = proteinGroups, delimiter = delimiter) | |||
|
|||
return(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not return 1
, but TRUE
R/parser.R
Outdated
@@ -25,6 +25,8 @@ | |||
#' @param version pre-header information about version (optional) | |||
#' @param experiment_id pre-header information about experiment id (optional) | |||
#' | |||
#' @return 1 on success |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return TRUE
instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the tests to run properly you have to add testthat to Suggests in the description file. Subsequently some of the tests are failing or have warnings please look into that.
tests/testthat/test_mqparser.R
Outdated
@@ -0,0 +1,30 @@ | |||
context("MaxQuant parser") | |||
|
|||
testthat::test_that("all needed input parameteres are given", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The :: notation is not needed for wilson and testthat. The packages are both loaded before testing
R/parser.R
Outdated
|
||
# getting experiment names | ||
exp_names <- (unique(summary_file[Experiment != "", Experiment])) | ||
if("Experiment" %in% colnames(summary_file)){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add whitespace after 'if' and before '{'. Like this:
if ("Experiment" %in% colnames(summary_file)) {
R/parser.R
Outdated
|
||
# getting experiment names | ||
exp_names <- (unique(summary_file[Experiment != "", Experiment])) | ||
if("Experiment" %in% colnames(summary_file)){ | ||
exp_names <- (unique(summary_file[Experiment != "", Experiment])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The outer brackets are redundant.
R/parser.R
Outdated
|
||
meta <- get_meta_from_config(meta_config = meta_config) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't follow an empty line with another empty line.
R/parser.R
Outdated
@@ -188,13 +190,21 @@ parse_MaxQuant <- function(proteinGroups_in, summary_in, outfile, outfile_reduce | |||
# reading files in data tables | |||
proteinGroups <- data.table::fread(proteinGroups_in, header = TRUE, quote = "") | |||
summary_file <- data.table::fread(summary_in, header = TRUE) | |||
meta_config <- rjson::fromJSON(file = config) | |||
meta_config <- tryCatch({rjson::fromJSON(file = config)}, | |||
error=function(cond){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add whitespace around '=' and before '{'.
R/parser.R
Outdated
@@ -203,6 +213,9 @@ parse_MaxQuant <- function(proteinGroups_in, summary_in, outfile, outfile_reduce | |||
sample_ary <- meta_config$type_array | |||
reduced_list <- meta_config$reduced_list | |||
full_sample_list <- c(sample_scores, sample_ratios, sample_probability, sample_category, sample_ary) | |||
if(is.null(reduced_list)){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add whitespaces.
No description provided.