Skip to content

Commit

Permalink
rename from nr_protein to nr_children to accomodate peptideforms etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
wolski committed Apr 8, 2024
1 parent b99b95d commit b43c6ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 6 additions & 5 deletions R/ProteinAnnotation.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ ProteinAnnotation <-
description = "description",
#' @field ids vector with columns containing addition IDs
ids = character(),
#' @field nr_peptides name of columns with the number of peptides
nr_peptides = character(),
#' @field nr_children name of columns with the number of peptides
nr_children = character(),
#' @description initialize
#' @param lfqdata data frame from \code{\link{setup_analysis}}
#' @param row_annot data frame with row annotation. Must have columns matching \code{config$table$hierarchy_keys_depth()}
Expand All @@ -37,19 +37,20 @@ ProteinAnnotation <-
row_annot,
description = NULL,
ids = NULL,
nr_peptides = "nr_peptides"){
nr_children = "nr_peptides"){
self$pID = lfqdata$config$table$hierarchy_keys_depth()[1]
self$nr_children = nr_children
if (!missing(row_annot)) {
stopifnot(self$pID %in% colnames(row_annot))
row_annot <- dplyr::filter(row_annot, !!sym(self$pID) %in% lfqdata$data[[self$pID]] )
self$row_annot <- row_annot
} else {
self$row_annot <- distinct(select(lfqdata$data, self$pID))
}
if (!self$nr_peptides %in% colnames(row_annot) ) {
if (!self$nr_children %in% colnames(row_annot) ) {
self$row_annot <- inner_join(
self$row_annot,
nr_obs_experiment(lfqdata$data, lfqdata$config, name_nr_child = self$nr_peptides),
nr_obs_experiment(lfqdata$data, lfqdata$config, name_nr_child = self$nr_children),
by = self$pID)
}
},
Expand Down
4 changes: 2 additions & 2 deletions man/ProteinAnnotation.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b43c6ef

Please sign in to comment.