holds results when contrasts are added.

holds results when contrasts are added.

Super class

prolfqua::ContrastsInterface -> ContrastsTable

Public fields

contrast_result

contrast results

modelName

model name

subject_Id

default protein_Id

Methods

Inherited methods


Method new()

intitialize

Usage

ContrastsTable$new(
  contrastsdf,
  subject_Id = "protein_Id",
  modelName = "ContrastTable"
)

Arguments

contrastsdf

data.frame

subject_Id

default protein_Id

modelName

default ContrastTable


Method get_contrast_sides()

return sides of contrast

Usage

ContrastsTable$get_contrast_sides()

Returns

data.frame


Method get_linfct()

not implemented

Usage

ContrastsTable$get_linfct()


Method get_contrasts()

get contrasts

Usage

ContrastsTable$get_contrasts(all = FALSE)

Arguments

all

should all columns be returned (default FALSE)

global

use a global linear function (determined by get_linfct)


Method get_Plotter()

get ContrastsPlotter

Usage

ContrastsTable$get_Plotter(FCthreshold = 1, FDRthreshold = 0.1)

Arguments

FCthreshold

fold change threshold

FDRthreshold

fdr threshold


Method to_wide()

convert to wide format

Usage

ContrastsTable$to_wide(columns = c("p.value", "FDR", "statistic"))

Arguments

columns

value column default beta.based.significance

Returns

data.frame


Method clone()

The objects of this class are cloneable with this method.

Usage

ContrastsTable$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples


bb <-prolfqua::sim_lfq_data_peptide_config()
#> creating sampleName from fileName column
#> Warning: no nr_children column specified in the data, adding column nr_children and setting to 1.
#> completing cases
configur <- bb$config$clone(deep=TRUE)
configur$table$hierarchyDepth <- 2
data <- bb$data
lfqdata <- LFQData$new(data, configur)
lfqdata$factors()
#> # A tibble: 12 × 3
#>    sample  sampleName group_
#>    <chr>   <chr>      <chr> 
#>  1 A_V1    A_V1       A     
#>  2 A_V2    A_V2       A     
#>  3 A_V3    A_V3       A     
#>  4 A_V4    A_V4       A     
#>  5 B_V1    B_V1       B     
#>  6 B_V2    B_V2       B     
#>  7 B_V3    B_V3       B     
#>  8 B_V4    B_V4       B     
#>  9 Ctrl_V1 Ctrl_V1    Ctrl  
#> 10 Ctrl_V2 Ctrl_V2    Ctrl  
#> 11 Ctrl_V3 Ctrl_V3    Ctrl  
#> 12 Ctrl_V4 Ctrl_V4    Ctrl  
Contrasts <- c("aC" = "group_A - group_Ctrl",
"bC" = "group_A - group_Ctrl")
csi <- ContrastsMissing$new(lfqdata, contrasts = Contrasts)
ctr <- csi$get_contrasts()
#> [1] "group_"
#> completing cases
#> aC=group_A - group_Ctrl
#> bC=group_A - group_Ctrl
#> aC=group_A - group_Ctrl
#> bC=group_A - group_Ctrl
#> aC=group_A - group_Ctrl
#> bC=group_A - group_Ctrl
csi$subject_Id
#> [1] "protein_Id" "peptide_Id"
xcx <- ContrastsTable$new(ctr, subject_Id = csi$subject_Id, modelName = "TableTest")
xcx$get_contrasts()
#> # A tibble: 56 × 21
#>    modelName protein_Id peptide_Id meanAbundanceImp_gro…¹ meanAbundanceImp_gro…²
#>    <chr>     <chr>      <chr>                       <dbl>                  <dbl>
#>  1 groupAve… 0EfVhX~00… ITLb4x1q                     18.0                   18.8
#>  2 groupAve… 0EfVhX~00… ahQLlQY7                     25.8                   21.0
#>  3 groupAve… 0EfVhX~00… dJkdz7so                     15.5                   17.6
#>  4 groupAve… 7cbcrd~57… D5dQ4nKk                     29.5                   17.2
#>  5 groupAve… 9VUkAq~47… eIC06D7g                     18.0                   27.3
#>  6 groupAve… BEJI92~52… HBkZvdhT                     16.8                   15.8
#>  7 groupAve… BEJI92~52… qQ1GK8Un                     23.8                   17.7
#>  8 groupAve… CGzoYe~21… mjHSHhoe                     24.3                   30.1
#>  9 groupAve… DoWup2~58… KVUnZ6oZ                     23.8                   19.4
#> 10 groupAve… Fl4JiV~86… GsUIOl6Q                     19.1                   17.4
#> # ℹ 46 more rows
#> # ℹ abbreviated names: ¹​meanAbundanceImp_group_1, ²​meanAbundanceImp_group_2
#> # ℹ 16 more variables: diff <dbl>, group_1_name <chr>, group_2_name <chr>,
#> #   contrast <chr>, avgAbd <dbl>, indic <dbl>, nrMeasured_group_1 <int>,
#> #   nrMeasured_group_2 <int>, df <int>, sigma <dbl>, std.error <dbl>,
#> #   statistic <dbl>, p.value <dbl>, conf.low <dbl>, conf.high <dbl>, FDR <dbl>
xcx$get_Plotter()$volcano()
#> $p.value

#> 
#> $FDR

#> 
stopifnot(is.null(xcx$get_contrast_sides()))
stopifnot(is.null(xcx$get_linfct()))
stopifnot(ncol(xcx$to_wide()) == 10)