ROPECA reproducibility-optimization method

ROPECA reproducibility-optimization method

Details

ROPECA optimizes the reproducibility of statistical testing on peptide-level and aggregates the peptide-level changes to determine differential protein-level expression.

Super class

prolfqua::ContrastsInterface -> ContrastsROPECA

Public fields

Contrast

Contrast

contrast_result

contrast result

modelName

model name

subject_Id

columns with protein ID's

p.adjust

method to use for p.value adjustment

Methods

Inherited methods


Method new()

initialize

Usage

ContrastsROPECA$new(
  Contrast,
  modelName = "ROPECA",
  p.adjust = prolfqua::adjust_p_values
)

Arguments

Contrast

e.g. instance of Contrasts class, or ContrastsModerated

modelName

default ROPECA

p.adjust

function to use for p.value adjustement


Method get_contrast_sides()

show names of contrasts

Usage

ContrastsROPECA$get_contrast_sides()

Returns

data.frame


Method get_linfct()

get linear function used to determine contrasts

Usage

ContrastsROPECA$get_linfct()

Returns

data.frame


Method get_contrasts()

get contrasts

Usage

ContrastsROPECA$get_contrasts(all = FALSE)

Arguments

all

should all columns be returned (default FALSE)

global

use a global linear function (determined by get_linfct)

Returns

data.frame


Method get_Plotter()

get ContrastsPlotter

Usage

ContrastsROPECA$get_Plotter(FDRthreshold = 0.1, FCthreshold = 2)

Arguments

FDRthreshold

FDR threshold

FCthreshold

FC threshold


Method to_wide()

convert to wide format

Usage

ContrastsROPECA$to_wide(
  columns = c("beta.based.significance", "FDR.beta.based.significance")
)

Arguments

columns

value column default beta.based.significance

Returns

data.frame


Method clone()

The objects of this class are cloneable with this method.

Usage

ContrastsROPECA$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples


istar <- istar <- prolfqua::sim_lfq_data_peptide_config(Nprot=50)
#> creating sampleName from fileName column
#> Warning: no nr_children column specified in the data, adding column nr_children and setting to 1.
#> completing cases
istar$config <- old2new(istar$config )
istar_data <- istar$data
modelFunction <-
  strategy_lm("abundance  ~ group_")
pepIntensity <- istar_data
config <- istar$config$clone(deep = TRUE)
config$table$hierarchyDepth <- 2
config$table$hierarchy_keys_depth()
#> [1] "protein_Id" "peptide_Id"

mod <- build_model(
 pepIntensity,
 modelFunction,
 subject_Id = config$table$hierarchy_keys_depth())
#> Joining with `by = join_by(protein_Id, peptide_Id)`

 Contr <- c("AvsCtrl" = "group_A - group_Ctrl")


 contr <- prolfqua::Contrasts$new(mod, Contr)
 dim(contr$get_contrasts())
#> determine linear functions:
#> Warning: Warn 'linfct_matrix_contrasts':In argument: `AvsCtrl = group_A - group_Ctrl`.
#> Warning: Warn 'linfct_matrix_contrasts':In argument: `avg_AvsCtrl = (group_A + group_Ctrl)/2`.
#> Warning: Warn 'linfct_matrix_contrasts':In argument: `AvsCtrl = group_A - group_Ctrl`.
#> Warning: Warn 'linfct_matrix_contrasts':In argument: `avg_AvsCtrl = (group_A + group_Ctrl)/2`.
#> Warning: Warn 'linfct_matrix_contrasts':In argument: `AvsCtrl = group_A - group_Ctrl`.
#> Warning: Warn 'linfct_matrix_contrasts':In argument: `avg_AvsCtrl = (group_A + group_Ctrl)/2`.
#> compute contrasts:
#> computing contrasts.
#> Joining with `by = join_by(protein_Id, peptide_Id, contrast)`
#> [1] 149  14
 contrM <- prolfqua::ContrastsModerated$new(contr)
 dim(contrM$get_contrasts())
#> [1] 149  14
 contrast <- prolfqua::ContrastsROPECA$new(contrM)
 contrast$get_contrasts()
#> # A tibble: 48 × 9
#> # Groups:   contrast [1]
#>    modelName protein_Id  contrast     n   diff statistic avgAbd
#>    <chr>     <chr>       <chr>    <int>  <dbl>     <dbl>  <dbl>
#>  1 ROPECA    0EfVhX~7161 AvsCtrl      4 -0.124    -0.260   19.9
#>  2 ROPECA    0m5WN4~3543 AvsCtrl      1 -8.74    -12.7     23.1
#>  3 ROPECA    76k03k~9735 AvsCtrl      3 -8.52     -9.63    22.1
#>  4 ROPECA    7QuTub~5556 AvsCtrl     11  0.925     1.35    23.2
#>  5 ROPECA    7cbcrd~0495 AvsCtrl      2 -1.35     -1.92    17.9
#>  6 ROPECA    7soopj~3451 AvsCtrl      2  2.50      3.64    26.9
#>  7 ROPECA    9VUkAq~8655 AvsCtrl      7  2.71      3.22    25.4
#>  8 ROPECA    At886V~0359 AvsCtrl      1 -7.70     -7.10    15.0
#>  9 ROPECA    CGzoYe~1248 AvsCtrl      4 -7.45     -7.96    18.0
#> 10 ROPECA    CtOJ9t~1391 AvsCtrl      2 -5.48     -8.06    18.4
#> # ℹ 38 more rows
#> # ℹ 2 more variables: beta.based.significance <dbl>,
#> #   FDR.beta.based.significance <dbl>
 contrast <- prolfqua::ContrastsROPECA$new(contr)
 tmp <- contrast$get_contrasts()
 dim(tmp)
#> [1] 48  9
 pl <- contrast$get_Plotter()
 contrast$to_wide()
#> # A tibble: 48 × 4
#>    protein_Id  diff.AvsCtrl beta.based.significance.Avs…¹ FDR.beta.based.signi…²
#>    <chr>              <dbl>                         <dbl>                  <dbl>
#>  1 0EfVhX~7161       -0.124                      1.00e+ 0               1.00e+ 0
#>  2 0m5WN4~3543       -8.74                       1.19e- 7               6.34e- 7
#>  3 76k03k~9735       -8.52                       1.02e-11               2.46e-10
#>  4 7QuTub~5556        0.925                      1.46e- 2               2.19e- 2
#>  5 7cbcrd~0495       -1.35                       1.48e- 1               1.97e- 1
#>  6 7soopj~3451        2.50                       2.88e- 4               6.01e- 4
#>  7 9VUkAq~8655        2.71                       4.34e- 6               1.30e- 5
#>  8 At886V~0359       -7.70                       1.55e- 3               2.66e- 3
#>  9 CGzoYe~1248       -7.45                       8.97e-10               1.08e- 8
#> 10 CtOJ9t~1391       -5.48                       9.75e- 1               1.00e+ 0
#> # ℹ 38 more rows
#> # ℹ abbreviated names: ¹​beta.based.significance.AvsCtrl,
#> #   ²​FDR.beta.based.significance.AvsCtrl
 contrast$get_linfct()
#>             (Intercept) group_B group_Ctrl
#> AvsCtrl               0       0       -1.0
#> avg_AvsCtrl           1       0        0.5
 contrast$get_contrast_sides()
#> # A tibble: 1 × 3
#>   contrast group_1 group_2   
#>   <chr>    <chr>   <chr>     
#> 1 AvsCtrl  group_A group_Ctrl
 pl$histogram()
#> $beta.based.significance

#> 
#> $FDR.beta.based.significance

#> 
 pl$ma_plot()