Whole plot testing

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.

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.

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).

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)
#> INFO [2021-07-05 20:05:58] ** Features with one or two measurements across runs are removed. #> INFO [2021-07-05 20:05:58] ** Fractionation handled. #> INFO [2021-07-05 20:05:58] ** Updated quantification data to make balanced design. Missing values are marked by NA #> INFO [2021-07-05 20:05:58] ** Log2 intensities under cutoff = 3.776 were considered as censored missing values. #> INFO [2021-07-05 20:05:58] ** Log2 intensities = NA were considered as censored missing values. #> INFO [2021-07-05 20:05:58] ** Use all features that the dataset originally has. #> INFO [2021-07-05 20:05:58] #> # proteins: 2 #> # peptides per protein: 2-2 #> # features per peptide: 3-3 #> INFO [2021-07-05 20:05:58] #> 1 2 3 4 5 6 7 8 9 10 #> # runs 3 3 3 3 3 3 3 3 3 3 #> # bioreplicates 3 3 3 3 3 3 3 3 3 3 #> # tech. replicates 1 1 1 1 1 1 1 1 1 1 #> INFO [2021-07-05 20:05:58] == Start the summarization per subplot... #> | | | 0% | |=================================== | 50% | |======================================================================| 100% #> INFO [2021-07-05 20:05:58] == Summarization is done.
head(QuantData$FeatureLevelData)
#> PROTEIN PEPTIDE TRANSITION FEATURE LABEL GROUP RUN #> 1 IDHC ATDVIVPEEGELR_2 y7_NA ATDVIVPEEGELR_2_y7_NA H 0 1 #> 2 IDHC ATDVIVPEEGELR_2 y7_NA ATDVIVPEEGELR_2_y7_NA L 1 1 #> 3 IDHC ATDVIVPEEGELR_2 y7_NA ATDVIVPEEGELR_2_y7_NA H 0 2 #> 4 IDHC ATDVIVPEEGELR_2 y7_NA ATDVIVPEEGELR_2_y7_NA L 1 2 #> 5 IDHC ATDVIVPEEGELR_2 y7_NA ATDVIVPEEGELR_2_y7_NA H 0 3 #> 6 IDHC ATDVIVPEEGELR_2 y7_NA ATDVIVPEEGELR_2_y7_NA L 1 3 #> SUBJECT FRACTION originalRUN censored INTENSITY ABUNDANCE newABUNDANCE #> 1 0 1 1 FALSE 84361.0835 15.855859 15.855859 #> 2 1 1 1 FALSE 215.1353 7.240669 7.240669 #> 3 0 1 2 FALSE 62109.5876 15.801179 15.801179 #> 4 2 1 2 FALSE 1205.2252 10.113738 10.113738 #> 5 0 1 3 FALSE 65114.3646 15.755022 15.755022 #> 6 3 1 3 FALSE 1476.3046 10.292109 10.292109 #> predicted #> 1 NA #> 2 NA #> 3 NA #> 4 NA #> 5 NA #> 6 NA
levels(QuantData$ProteinLevelData$GROUP)
#> [1] "1" "10" "2" "3" "4" "5" "6" "7" "8" "9"
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)
#> INFO [2021-07-05 20:05:58] == Start to test and get inference in whole plot ... #> | | | 0% | |=================================== | 50% | |======================================================================| 100% #> INFO [2021-07-05 20:05:59] == Comparisons for all proteins are done.
# table for result testResultOneComparison$ComparisonResult
#> Protein Label log2FC SE Tvalue DF pvalue adj.pvalue #> 1 IDHC T7-T1 6.15438359 0.2917031 21.0981085 18 3.819167e-14 7.638334e-14 #> 2 PMG2 T7-T1 -0.09032809 0.1518673 -0.5947831 18 5.593918e-01 5.593918e-01 #> issue MissingPercentage ImputationPercentage #> 1 NA 0 0 #> 2 NA 0 0