Skip to content
This repository has been archived by the owner. It is now read-only.

Added tests for parse_MaxQuant #25

Merged
merged 13 commits into from
Jul 16, 2018
Merged

Added tests for parse_MaxQuant #25

merged 13 commits into from
Jul 16, 2018

Conversation

renewiegandt
Copy link
Contributor

No description provided.

@@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WTF 🤣
*dankbar

Copy link
Contributor Author

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

@@ -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
Copy link
Member

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)
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return TRUE instead

Copy link
Contributor

@HendrikSchultheis HendrikSchultheis left a 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.

@@ -0,0 +1,30 @@
context("MaxQuant parser")

testthat::test_that("all needed input parameteres are given", {
Copy link
Contributor

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)){
Copy link
Contributor

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]))
Copy link
Contributor

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)


Copy link
Contributor

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){
Copy link
Contributor

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)){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add whitespaces.

@HendrikSchultheis HendrikSchultheis merged commit 1b98804 into master Jul 16, 2018
1 check failed
@HendrikSchultheis HendrikSchultheis deleted the mqparser_tests branch July 16, 2018 11:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants