hypothesisTest,SummarizedExperiment-method {msqrob2} | R Documentation |
Summary table of the estimates for differential expression of features
## S4 method for signature 'SummarizedExperiment' hypothesisTest( object, contrast, adjust.method = "BH", modelColumn = "msqrobModels", resultsColumnNamePrefix = "", overwrite = FALSE ) ## S4 method for signature 'SummarizedExperiment' hypothesisTestHurdle( object, contrast, adjust.method = "BH", modelColumn = "msqrobHurdle", resultsColumnNamePrefix = "hurdle_", overwrite = FALSE ) ## S4 method for signature 'QFeatures' hypothesisTest( object, i, contrast, adjust.method = "BH", modelColumn = "msqrobModels", resultsColumnNamePrefix = "", overwrite = FALSE ) ## S4 method for signature 'QFeatures' hypothesisTestHurdle( object, i, contrast, adjust.method = "BH", modelColumn = "msqrobHurdle", resultsColumnNamePrefix = "hurdle_", overwrite = FALSE )
object |
|
contrast |
|
adjust.method |
|
modelColumn |
|
resultsColumnNamePrefix |
|
overwrite |
|
i |
|
A SummarizedExperiment or a QFeatures
instance augmented with the test
results.
Lieven Clement
# Load example data # The data are a Feature object containing # a SummarizedExperiment named "peptide" with MaxQuant peptide intensities # The data are a subset of spike-in the human-ecoli study # The variable condition in the colData of the Feature object # contains information on the spike in condition a-e (from low to high) data(pe) # Aggregate peptide intensities in protein expression values pe <- aggregateFeatures(pe, i = "peptide", fcol = "Proteins", name = "protein") # Fit msqrob model pe <- msqrob(pe, i = "protein", formula = ~condition) # Define contrast getCoef(rowData(pe[["protein"]])$msqrobModels[[1]]) # Assess log2 fold change between condition c and condition b L <- makeContrast( "conditionc - conditionb=0", c("conditionb", "conditionc") ) # example SummarizedExperiment instance se <- pe[["protein"]] se <- hypothesisTest(se, L) head(rowData(se)$"conditionc - conditionb", 10) # Volcano plot plot(-log10(pval) ~ logFC, rowData(se)$"conditionc - conditionb", col = (adjPval < 0.05) + 1 ) # Example for QFeatures instance # Assess log2 fold change between condition b and condition a (reference class), # condition c and condition a, and, condition c and condition b. L <- makeContrast( c( "conditionb=0", "conditionc=0", "conditionc - conditionb=0" ), c("conditionb", "conditionc") ) pe <- hypothesisTest(pe, i = "protein", L) head(rowData(pe[["protein"]])$"conditionb", 10) # Volcano plots par(mfrow = c(1, 3)) plot(-log10(pval) ~ logFC, rowData(pe[["protein"]])$"conditionb", col = (adjPval < 0.05) + 1, main = "log2 FC b-a" ) plot(-log10(pval) ~ logFC, rowData(pe[["protein"]])$"conditionc", col = (adjPval < 0.05) + 1, main = "log2 FC c-a" ) plot(-log10(pval) ~ logFC, rowData(pe[["protein"]])$"conditionc - conditionb", col = (adjPval < 0.05) + 1, main = "log2 FC c-b" ) # Hurdle method pe <- msqrobHurdle(pe, i = "protein", formula = ~condition) pe <- hypothesisTestHurdle(pe, i = "protein", L) head(rowData(pe[["protein"]])$"hurdle_conditionb", 10)