ContrastsProDA Wrapper to results produced by proDA

ContrastsProDA Wrapper to results produced by proDA

Super class

prolfqua::ContrastsInterface -> ContrastsProDA

Public fields

contrast_result

contrast result

modelName

model name

subject_Id

columns with protein ID's

contrasts

named vector of length 1.

Methods

Inherited methods


Method new()

initialize

Usage

ContrastsProDA$new(
  contrastsdf,
  contrasts,
  subject_Id = "name",
  modelName = "ContrastProDA"
)

Arguments

contrastsdf

data.frame returned by proDA

contrasts

contrasts

subject_Id

column name with protein ID's

modelName

name of model default value ContrastProDA


Method get_contrast_sides()

show names of contrasts

Usage

ContrastsProDA$get_contrast_sides()

Returns

data.frame


Method get_linfct()

get linear function used to determine contrasts

Usage

ContrastsProDA$get_linfct()

Returns

data.frame


Method get_contrasts()

get contrasts

Usage

ContrastsProDA$get_contrasts(all = FALSE)

Arguments

all

(default FALSE)


Method get_Plotter()

get Contrast_Plotter

Usage

ContrastsProDA$get_Plotter(
  fcthreshold = 1,
  fdrthreshold = 0.1,
  tstatthreshold = 5
)

Arguments

fcthreshold

fold change threshold to show

fdrthreshold

FDR threshold

tstatthreshold

t statistics threshold


Method to_wide()

convert to wide format

Usage

ContrastsProDA$to_wide(columns = c("t_statistic", "adj_pval"))

Arguments

columns

value column default t_statistic, adj_pval


Method write()

write results

Usage

ContrastsProDA$write(path, filename, format = "xlsx")

Arguments

path

directory

filename

file to write to

format

default xlsx lfq_write_table


Method clone()

The objects of this class are cloneable with this method.

Usage

ContrastsProDA$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples


istar <- 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
istar$config <- istar$config
istar_data <- istar$data
lfd <- LFQData$new(istar_data, istar$config)
se <- prolfqua::LFQDataToSummarizedExperiment(lfd)
if(require(proDA)){
fit <- proDA::proDA(se, design = ~ group_ - 1, data_is_log_transformed = TRUE)
contr <- list()
contrasts <- c("group_AvsCtrl" = "group_A - group_Ctrl",
               "group_BvsCtrl" = "group_B - group_Ctrl")
contr[["group_AvsCtrl"]] <- data.frame(
  contrast = "group_AvsCtrl",
  proDA::test_diff(fit, contrast = "group_A - group_Ctrl"))
contr[["group_BvsCtrl"]] <- data.frame(
  contrast = "group_BvsCtrl",
  proDA::test_diff(fit, contrast = "group_B - group_Ctrl"))

bb <- dplyr::bind_rows(contr)
cproDA <- ContrastsProDA$new(bb, contrasts = contrasts, subject_Id = "name")
x <- cproDA$get_contrasts()
cproDA$get_linfct()
contsides <- cproDA$get_contrast_sides()
stopifnot(ncol(cproDA$to_wide()) == c(7))
tmp <- cproDA$get_Plotter()
tmp$volcano()$pval
tmp$volcano()$adj_pval
}