Skip to content

Commit 728a89b

Browse files
committed
change argument to to_wide accept all value vars
1 parent 9bd41f3 commit 728a89b

8 files changed

Lines changed: 27 additions & 13 deletions

File tree

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: prolfqua
22
Type: Package
33
Title: Proteomics Label Free Quantification
4-
Version: 1.3.8
4+
Version: 1.3.9
55
Authors@R: c(person("Witold", "Wolski",
66
email = "wew@fgcz.ethz.ch",
77
role = c("aut", "cre"),
@@ -70,7 +70,7 @@ Suggests:
7070
SummarizedExperiment,
7171
proDA,
7272
vsn
73-
RoxygenNote: 7.3.2
73+
RoxygenNote: 7.3.3
7474
Roxygen: list(r6 = TRUE)
7575
Depends:
7676
R (>= 4.1)

NAMESPACE

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export(filter_byQValue)
5656
export(filter_difference)
5757
export(filter_proteins_by_peptide_count)
5858
export(find_package_file)
59+
export(function_lod_quantile)
5960
export(generate_contrasts)
6061
export(generate_contrasts_for_factor)
6162
export(get_UniprotID_from_fasta_header)
@@ -67,6 +68,7 @@ export(get_robscales)
6768
export(group_label)
6869
export(hierarchy_counts)
6970
export(hierarchy_counts_sample)
71+
export(impute_with_zcomp)
7072
export(intensity_summary_by_hkeys)
7173
export(interaction_contrasts)
7274
export(interaction_missing_stats)

R/LFQData.R

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,17 +164,18 @@ LFQData <- R6::R6Class(
164164
#' @description
165165
#' converts the data to wide
166166
#' @param as.matrix return as data.frame or matrix
167-
#' @param value either response or nr chidren
167+
#' @param value see possible lfqdata$config$table$value_vars()
168168
#' @return list with data, annotation, and configuration
169-
to_wide = function(as.matrix = FALSE, value = c("response", "nr_children")){
170-
value <- match.arg(value)
171-
if (value == "response") {
169+
#'
170+
to_wide = function(as.matrix = FALSE, value = NULL){
171+
if (is.null(value)) {
172172
wide <- prolfqua::tidy_to_wide_config(self$data, self$config, as.matrix = as.matrix)
173173
} else {
174+
stopifnot(value %in% self$config$table$value_vars())
174175
wide <- prolfqua::tidy_to_wide_config(
175176
self$data, self$config,
176177
as.matrix = as.matrix,
177-
value = self$config$table$nr_children)
178+
value = value)
178179
}
179180
wide$config <- self$config$clone(deep = TRUE)
180181
return(wide)

R/LFQDataImp.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@ estimate_lod_global <- function(data_matrix, prop_na = 90) {
1818

1919

2020
#' get smallest values per sample
21+
#' @export
2122
#' @examples
2223
#' # example code
2324
#'
2425
#' istar <- sim_lfq_data_peptide_config()
2526
#' lfqdata <- LFQData$new(istar$data, istar$config)
2627
#' xx <- lfqdata$to_wide(as.matrix=TRUE)
27-
#' s <- function_log_quantile(xx$data)
28+
#' s <- function_lod_quantile(xx$data)
2829
#' sapply(s, median)
2930
#' sapply(s, mean)
3031
function_lod_quantile <- function(data_matrix, percent = 10) {

man/LFQData.Rd

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/estimate_lod_global.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/function_lod_quantile.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/impute_with_zcomp.Rd

Lines changed: 11 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)