Skip to contents

Estimate protein abundance from peptide abundances using MASS::rlm

Usage

rlm_estimate_dfconfig(
  pdata,
  response,
  hierarchy_keys,
  hierarchy_keys_depth,
  sample_name,
  name = FALSE
)

Arguments

pdata

data.frame

response

character — intensity column name

hierarchy_keys

character vector — all hierarchy column names

hierarchy_keys_depth

character vector — hierarchy columns at current depth

sample_name

character — sample name column

name

if TRUE return function name only

Examples


bb <- sim_lfq_data_peptide_config(Nprot = 20)
#> creating sampleName from file_name column
#> completing cases
#> completing cases done
#> setup done
conf <- bb$config
data <- bb$data
conf$hierarchy_depth <- 1
xnested <- data |>
  dplyr::group_by(across(all_of(conf$hierarchy_keys_depth()))) |>
  tidyr::nest()

feature <- base::setdiff(conf$hierarchy_keys(), conf$hierarchy_keys_depth())
x <- xnested$data[[1]]
bb <- rlm_estimate_dfconfig(x, conf$get_response(),
  conf$hierarchy_keys(), conf$hierarchy_keys_depth(), conf$sample_name)
prolfqua:::.reestablish_condition(x, bb, conf$sample_name,
  conf$factor_keys(), conf$file_name, conf$isotope_label)
#> # A tibble: 12 × 7
#>    sampleName group_ sample  isotopeLabel mean.abundance lmrob weights
#>    <chr>      <chr>  <chr>   <chr>                 <dbl> <dbl>   <dbl>
#>  1 A_V1       A      A_V1    light                  30.0  30.0       1
#>  2 A_V2       A      A_V2    light                  29.8  29.8       1
#>  3 A_V3       A      A_V3    light                  29.1  29.1       1
#>  4 A_V4       A      A_V4    light                  29.9  29.9       1
#>  5 B_V1       B      B_V1    light                  32.1  32.1       1
#>  6 B_V2       B      B_V2    light                  32.4  32.4       1
#>  7 B_V3       B      B_V3    light                  31.7  31.7       1
#>  8 B_V4       B      B_V4    light                  33.5  33.5       1
#>  9 Ctrl_V1    Ctrl   Ctrl_V1 light                  22.1  22.1       1
#> 10 Ctrl_V2    Ctrl   Ctrl_V2 light                  18.5  18.5       1
#> 11 Ctrl_V3    Ctrl   Ctrl_V3 light                  19.8  19.8       1
#> 12 Ctrl_V4    Ctrl   Ctrl_V4 light                  21.4  21.4       1