groupComparison {MSstats} | R Documentation

## Whole plot testing

### Description

Whole plot testing

### Usage

    groupComparison(
      contrast.matrix,
      data,
      save_fitted_models = TRUE,
      log_base = 2,
      use_log_file = TRUE,
      append = FALSE,
      verbose = TRUE,
      log_file_path = NULL
    )

### Arguments

`contrast.matrix` | comparison between conditions of interests.
`data` | name of the (output of dataProcess function) data set.
`save_fitted_models` | logical, if TRUE, fitted models will be added to the output.
`log_base` | base of the logarithm used in dataProcess.
`use_log_file` | logical. If TRUE, information about data processing will be saved to a file.
`append` | logical. If TRUE, information about data processing will be added to an existing log file.
`verbose` | logical. If TRUE, information about data processing wil be printed to the console.
`log_file_path` | character. Path to a file to which information about data processing will be saved. If not provided, such a file will be created automatically. If 'append = TRUE', has to be a valid path to a file.

### Details

contrast.matrix : comparison of interest. Based on the levels of conditions, specify 1 or -1 to the conditions of interests and 0 otherwise. The levels of conditions are sorted alphabetically. Command levels(QuantData$FeatureLevelData$GROUP_ORIGINAL) can illustrate the actual order of the levels of conditions. The underlying model fitting functions are lm and lmer for the fixed effects model and mixed effects model, respectively. The input of this function is the quantitative data from function (dataProcess).

### Value

list that consists of three elements: "ComparisonResult" - data.frame with results of statistical testing, "ModelQC" - data.frame with data used to fit models for group comparison and "FittedModel" - list of fitted models.

### Examples

    # Consider quantitative data (i.e. QuantData) from yeast study with ten time points of interests,
    # three biological replicates, and no technical replicates.
    # It is a time-course experiment and we attempt to compare differential abundance
    # between time 1 and 7 in a set of targeted proteins.
    # In this label-based SRM experiment, MSstats uses the fitted model with expanded scope of
    # Biological replication.
    QuantData <- dataProcess(SRMRawData, use_log_file = FALSE)
    head(QuantData$FeatureLevelData)
    levels(QuantData$ProteinLevelData$GROUP)
    comparison <- matrix(c(-1,0,0,0,0,0,1,0,0,0),nrow=1)
    row.names(comparison) <- "T7-T1"
    groups = levels(QuantData$ProteinLevelData$GROUP)
    colnames(comparison) <- groups[order(as.numeric(groups))]
    # Tests for differentially abundant proteins with models:
    # label-based SRM experiment with expanded scope of biological replication.
    testResultOneComparison <- groupComparison(contrast.matrix=comparison, data=QuantData,
                                               use_log_file = FALSE)
    # table for result
    testResultOneComparison$ComparisonResult

[Package MSstats version 4.1.1 Index]