| Title: | Tools for the Differential Analysis of Proteins Abundance with R |
|---|---|
| Description: | The package DaparToolshed is a Bioconductor distributed R package which provides all the necessary functions to analyze quantitative data from label-free proteomics experiments. It is an update of our previous package DAPAR and contains more functions to analyze the data and uses MultAssayExperiment and SummarizedExperiment data structures. Contrarily to most other similar R packages, it is endowed with rich and user-friendly graphical interfaces, so that no programming skill is required (see `Prostar` package). |
| Authors: | Samuel Wieczorek [cre, aut] (ORCID: <https://orcid.org/0000-0002-5016-1203>), Thomas Burger [aut], Enora Fremy [ctb], Manon Gaudin [ctb] |
| Maintainer: | Samuel Wieczorek <[email protected]> |
| License: | Artistic-2.0 |
| Version: | 0.99.36 |
| Built: | 2026-05-19 19:16:34 UTC |
| Source: | https://github.com/bioc/DaparToolshed |
SummarizedExperiment to a QFeatures objectAdds one or more items to the dataset. This function is specific of the type of dataset.
Add_Item_to_Dataset(dataset, name)Add_Item_to_Dataset(dataset, name)
dataset |
An instance of |
name |
A |
The dataset minus some items
This function adds a row to the history.
Add2History(history, process, step.name, param.name, value)Add2History(history, process, step.name, param.name, value)
history |
A |
process |
A |
step.name |
A |
param.name |
A |
value |
The value of the corresponding parameter. |
A data.frame with one added row
history <- InitializeHistory() Add2History(history, "Process1", "Step1", "Parameter1", "Value1")history <- InitializeHistory() Add2History(history, "Process1", "Step1", "Parameter1", "Value1")
These functions filters (delete) peptides of an assay, applying a function on peptides and proteins. They can be used alone but the usual usage is to create an instance of a class FunctionFilter and to pass it to the function filterFeaturesOneSE in order to create a new assay, embedded into the QFeatures object.
AdjMatFilters() allPeptides(object, ...) specPeptides(object, ...) subAdjMat_specificPeptides(X) sharedPeptides(object, ...) subAdjMat_sharedPeptides(X) topnFunctions() topnPeptides(object, fun, top) subAdjMat_topnPeptides(X, qData, fun, top)AdjMatFilters() allPeptides(object, ...) specPeptides(object, ...) subAdjMat_specificPeptides(X) sharedPeptides(object, ...) subAdjMat_sharedPeptides(X) topnFunctions() topnPeptides(object, fun, top) subAdjMat_topnPeptides(X, qData, fun, top)
object |
An object of class |
... |
Additional arguments |
X |
A |
fun |
A |
top |
A |
qData |
A |
This function builds an intermediate matrix with scores for each peptide based on 'fun' parameter. Once this matrix is built, one select the 'n' peptides which have the higher score
The list of filter functions is given by adjMatFilters():
specPeptides(): returns a new assay of class SummazizedExperiment
with only specific peptides;
sharedpeptides(): returns a new assay of class SummazizedExperiment
with only shared peptides;
opnPeptides(): returns a new assay of class SummazizedExperiment with
only the 'n' peptides which best satisfies the condition. The condition is
represented by functions which calculates a score for each peptide among
all samples. The list of these functions is given by topnFunctions():
rowMedians(): returns the median of the entities in each selected row;
rowMeans(): returns the median of the entities in each selected row;
rowSums(): returns the sum of the entities in each selected row;
NA
Samuel Wieczorek
The QFeatures-filtering-oneSE man page for the
class FunctionFilter.
library(Matrix) library(QFeatures) #------------------------------------------------ # This function will keep only specific peptides #------------------------------------------------ f1 <- FunctionFilter("specPeptides", list()) #------------------------------------------------ # This function will keep only shared peptides #------------------------------------------------ f2 <- FunctionFilter("sharedPeptides", list()) #------------------------------------------------ # This function will keep only the 'n' best peptides # w.r.t the quantitative sum of each peptides among # all samples #------------------------------------------------ f3 <- FunctionFilter("topnPeptides", fun = "rowSums", top = 2) #------------------------------------------------------ # IF several filters must be used, store them in a list #------------------------------------------------------ data(subR25pept) lst.filters <- list() lst.filters <- append(lst.filters, f1) lst.filters <- append(lst.filters, f3) subR25prot <- filterFeaturesOneSE( object = subR25pept, i = 1, name = "filtered", filters = lst.filters )library(Matrix) library(QFeatures) #------------------------------------------------ # This function will keep only specific peptides #------------------------------------------------ f1 <- FunctionFilter("specPeptides", list()) #------------------------------------------------ # This function will keep only shared peptides #------------------------------------------------ f2 <- FunctionFilter("sharedPeptides", list()) #------------------------------------------------ # This function will keep only the 'n' best peptides # w.r.t the quantitative sum of each peptides among # all samples #------------------------------------------------ f3 <- FunctionFilter("topnPeptides", fun = "rowSums", top = 2) #------------------------------------------------------ # IF several filters must be used, store them in a list #------------------------------------------------------ data(subR25pept) lst.filters <- list() lst.filters <- append(lst.filters, f1) lst.filters <- append(lst.filters, f3) subR25prot <- filterFeaturesOneSE( object = subR25pept, i = 1, name = "filtered", filters = lst.filters )
iteratively applies OWAnova() on the features of an MSnSet object
applyAnovasOnProteins(obj, i)applyAnovasOnProteins(obj, i)
obj |
a QFreatures object |
i |
An integer which is the index of the assay in the QFeatures object ' |
a list of linear models
Thomas Burger
data(subR25prot) applyAnovasOnProteins(subR25prot[seq_len(5),], 1)data(subR25prot) applyAnovasOnProteins(subR25prot[seq_len(5),], 1)
Method to create a binary matrix with proteins in columns and peptides
in lines on a SummarizedExperiment object (peptides)
BuildAdjacencyMatrix(obj.pep)BuildAdjacencyMatrix(obj.pep)
obj.pep |
An object (peptides) of class |
A binary matrix
Florence Combes, Samuel Wieczorek, Alexia Dorffer
data(subR25pept) BuildAdjacencyMatrix(subR25pept[[1]])data(subR25pept) BuildAdjacencyMatrix(subR25pept[[1]])
Display a CC
buildGraph(The.CC, X)buildGraph(The.CC, X)
The.CC |
A cc (a list) |
X |
An instance of the class |
A plot
Thomas Burger, Samuel Wieczorek
data(subR25pept) X <- QFeatures::adjacencyMatrix(subR25pept[[1]]) ll <- getPepProtCC(X) g <- buildGraph(ll[[1]], X)data(subR25pept) X <- QFeatures::adjacencyMatrix(subR25pept[[1]]) ll <- getPepProtCC(X) g <- buildGraph(ll[[1]], X)
Create metacell
BuildMetacell(from = NULL, level, qdata = NULL, conds = NULL, df = NULL)BuildMetacell(from = NULL, level, qdata = NULL, conds = NULL, df = NULL)
from |
A string designing the software used, either "maxquant", "proline" or "DIA-NN" |
level |
A string designing the type of entity/pipeline.
Available values are: |
qdata |
A matrix of quantitative data |
conds |
A 1-col dataframe with the condition associated to each sample. |
df |
A data.frame which contains the type of identification of the
entities. It must have the same dimensions as |
NA
Samuel Wieczorek
data(subR25pept) conds <- design_qf(subR25pept)$Condition qdata <- SummarizedExperiment::assay(subR25pept[[1]]) metacell1 <- BuildMetacell('maxquant', 'peptide', qdata, conds) metacell2 <- BuildMetacell('proline', 'peptide', qdata, conds)data(subR25pept) conds <- design_qf(subR25pept)$Condition qdata <- SummarizedExperiment::assay(subR25pept[[1]]) metacell1 <- BuildMetacell('maxquant', 'peptide', qdata, conds) metacell2 <- BuildMetacell('proline', 'peptide', qdata, conds)
Check if the design is valid
checkConditions(conds)checkConditions(conds)
conds |
A |
A list including :
"valid" : Wether the conditions are valid or not.
"warn" : A message describing the issue if the conditions ar not valid.
Samuel Wieczorek
data(subR25pept) checkConditions(design_qf(subR25pept)$Condition)data(subR25pept) checkConditions(design_qf(subR25pept)$Condition)
Check if the design is valid
checkDesign(sTab)checkDesign(sTab)
sTab |
The data.frame which correspond to the |
A boolean
Thomas Burger, Samuel Wieczorek
data(subR25pept) checkDesign(SummarizedExperiment::colData(subR25pept)[, -1])data(subR25pept) checkDesign(SummarizedExperiment::colData(subR25pept)[, -1])
Names of all children of a node
Children(level, parent = NULL)Children(level, parent = NULL)
level |
A string designing the type of entity/pipeline.
Available values are: |
parent |
A vector of |
A vector
Children('protein', 'Missing') Children('protein', 'Missing POV') Children('protein', c('Missing POV', 'Missing MEC')) Children('protein', c('Missing', 'Missing POV', 'Missing MEC'))Children('protein', 'Missing') Children('protein', 'Missing POV') Children('protein', c('Missing POV', 'Missing MEC')) Children('protein', c('Missing', 'Missing POV', 'Missing MEC'))
Function to perform a One-way Anova statistical test on a MsnBase dataset
classic1wayAnova(current_line, conditions)classic1wayAnova(current_line, conditions)
current_line |
The line currently treated from the quantitative data to perform the ANOVA |
conditions |
The conditions represent the different classes of the studied factor |
A named vector containing all the different values of the aov model
Hélène Borges
library(SummarizedExperiment) data(subR25prot) obj <- subR25prot filter <- FunctionFilter('qMetacellOnConditions', cmd = 'delete', mode = 'AtLeastOneCond', pattern = c("Missing POV", "Missing MEC"), conds = design_qf(obj)$Condition, percent = TRUE, th = 0.8, operator = '>') obj <- filterFeaturesOneSE(obj, name = "Filtered", filters = list(filter)) qdata <- SummarizedExperiment::assay(obj[[2]]) conds <- design_qf(obj)$Condition anova_tests <- apply(qdata, 1, classic1wayAnova, conditions = as.factor(conds)) anova_tests <- t(anova_tests)library(SummarizedExperiment) data(subR25prot) obj <- subR25prot filter <- FunctionFilter('qMetacellOnConditions', cmd = 'delete', mode = 'AtLeastOneCond', pattern = c("Missing POV", "Missing MEC"), conds = design_qf(obj)$Condition, percent = TRUE, th = 0.8, operator = '>') obj <- filterFeaturesOneSE(obj, name = "Filtered", filters = list(filter)) qdata <- SummarizedExperiment::assay(obj[[2]]) conds <- design_qf(obj)$Condition anova_tests <- apply(qdata, 1, classic1wayAnova, conditions = as.factor(conds)) anova_tests <- t(anova_tests)
Clean row data
CleanRowData(obj, i)CleanRowData(obj, i)
obj |
An instance of the class |
i |
An integer which is the index of the assay in the QFeatures object |
An instance of the SummarizedExperiment structure
Samuel Wieczorek
NULLNULL
plotly
Plot to compare the quantitative proteomics data before and after
normalization using the package plotly
compareNormalizationD_HC( qDataBefore, qDataAfter, keyId = NULL, conds = NULL, pal = NULL, subset.view = NULL, n = 100, type = "scatter" )compareNormalizationD_HC( qDataBefore, qDataAfter, keyId = NULL, conds = NULL, pal = NULL, subset.view = NULL, n = 100, type = "scatter" )
qDataBefore |
A dataframe that contains quantitative data before normalization. |
qDataAfter |
A dataframe that contains quantitative data after normalization. |
keyId |
A |
conds |
A vector of the conditions (one condition per sample). |
pal |
A |
subset.view |
A |
n |
An integer that is equal to the maximum number of displayed points. This number must be less or equal to the size of the dataset. If it is less than it, it is a random selection |
type |
scatter or line |
A plot
Samuel Wieczorek
library(SummarizedExperiment) data(subR25prot) qDataBefore <- SummarizedExperiment::assay(subR25prot[[1]]) conds <- design_qf(subR25prot)$Condition id <- rowData(subR25prot[[1]])[, idcol(subR25prot[[1]])] # pal <- ExtendPalette(2) qDataAfter <- LOESS(qDataBefore, conds, type = "overall") n <- 1 compareNormalizationD_HC( qDataBefore = qDataBefore, qDataAfter = qDataAfter, keyId = id, pal = NULL, n = n, subset.view = seq_len(n), conds = conds)library(SummarizedExperiment) data(subR25prot) qDataBefore <- SummarizedExperiment::assay(subR25prot[[1]]) conds <- design_qf(subR25prot)$Condition id <- rowData(subR25prot[[1]])[, idcol(subR25prot[[1]])] # pal <- ExtendPalette(2) qDataAfter <- LOESS(qDataBefore, conds, type = "overall") n <- 1 compareNormalizationD_HC( qDataBefore = qDataBefore, qDataAfter = qDataAfter, keyId = id, pal = NULL, n = n, subset.view = seq_len(n), conds = conds)
Compute a t-test
compute_t_tests( obj, i = 1, contrast = c("OnevsOne", "OnevsAll"), type = c("Student", "Welch") )compute_t_tests( obj, i = 1, contrast = c("OnevsOne", "OnevsAll"), type = c("Student", "Welch") )
obj |
A matrix of quantitative data, without any missing values. |
i |
An integer which is the index of the assay in the QFeatures object |
contrast |
Indicates if the test consists of the comparison of each biological condition versus each of the other ones (contrast=1; for example H0:"C1=C2" vs H1:"C1!=C2", etc.) or each condition versus all others (contrast=2; e.g. H0:"C1=(C2+C3)/2" vs H1:"C1!=(C2+C3)/2", etc. if there are three conditions). |
type |
Either "Student" or "Welch" |
A list of two items : logFC and P_Value; both are dataframe. The first one contains the logFC values of all the comparisons (one column for one comparison), the second one contains the pvalue of all the comparisons (one column for one comparison). The names of the columns for those two dataframes are identical and correspond to the description of the comparison.
Florence Combes, Samuel Wieczorek
library(SummarizedExperiment) data(subR25prot) obj <- subR25prot filter <- FunctionFilter('qMetacellOnConditions', cmd = 'delete', mode = 'AtLeastOneCond', pattern = c("Missing POV", "Missing MEC"), conds = design_qf(obj)$Condition, percent = TRUE, th = 0.8, operator = '>') obj <- filterFeaturesOneSE(obj, name = "Filtered", filters = list(filter)) ttest <- compute_t_tests(obj, 2)library(SummarizedExperiment) data(subR25prot) obj <- subR25prot filter <- FunctionFilter('qMetacellOnConditions', cmd = 'delete', mode = 'AtLeastOneCond', pattern = c("Missing POV", "Missing MEC"), conds = design_qf(obj)$Condition, percent = TRUE, th = 0.8, operator = '>') obj <- filterFeaturesOneSE(obj, name = "Filtered", filters = list(filter)) ttest <- compute_t_tests(obj, 2)
Convert a list to unnumbered HTML list
ConvertListToHtml(ll)ConvertListToHtml(ll)
ll |
A |
HTML
ConvertListToHtml(list('foo1', 'foo2', 'foo3'))ConvertListToHtml(list('foo1', 'foo2', 'foo3'))
QFeatures from text file.Creates an object of class QFeatures from a
single tabulated-like file for quantitative and meta-data and a dataframe
for the samples description.
createQFeatures( data = NULL, file = "myDataset", sample, indQData, keyId = "AutoID", indexForMetacell = NULL, logData = FALSE, force.na = TRUE, typeDataset, parentProtId = NULL, analysis = "foo", description = NULL, processes = NULL, typePipeline = NULL, name.pipeline = NULL, software = NULL, name = "original" )createQFeatures( data = NULL, file = "myDataset", sample, indQData, keyId = "AutoID", indexForMetacell = NULL, logData = FALSE, force.na = TRUE, typeDataset, parentProtId = NULL, analysis = "foo", description = NULL, processes = NULL, typePipeline = NULL, name.pipeline = NULL, software = NULL, name = "original" )
data |
The name of a tab-separated file that contains the data. |
file |
A |
sample |
A dataframe describing the samples (in lines). |
indQData |
A vector of string where each element is the name
of a column in designTable that have to be integrated in
the |
keyId |
A |
indexForMetacell |
They must be in the same order as the samples in the experimental design |
logData |
A |
force.na |
A |
typeDataset |
A string that indicates whether the dataset is about |
parentProtId |
A |
analysis |
A |
description |
A text which describes the study. |
processes |
A vector of A |
typePipeline |
A |
name.pipeline |
A string |
software |
A |
name |
A |
An instance of class QFeatures.
Samuel Wieczorek, Manon Gaudin
NULLNULL
This function aggregates the quantitative features of an assay,
applying a summarization function (fun) to sets of features.
The fcol variable name points to a rowData column that defines
how to group the features during aggregate. This variable has to
be an adjacency matrix. This function uses QFeatures::aggregateFeatures()
to aggregate quantitative data.
The list of agregation methods can be obtained with the function
aggregateMethods(). This function compiles both methods from the
packages DaparToolshed and QFeatures.
Aggregate the quantitative metadata tag.
This function aggregate both quantitative and rowdata from the last assay contained in a QFeatures.
Note that the function assumes that the intensities in the QFeatures are already log-transformed.
This function creates a column for the protein dataset after aggregation by using the previous peptide dataset.
Aggregation of rowData of a QFeatures assay.
Aggregate the metadata
This function computes the number of proteins that are only defined by specific peptides, shared peptides or a mixture of two.
This function computes the number of peptides used to aggregate proteins.
Method to compute the number of quantified peptides used for aggregating each protein
Method to compute the detailed number of quantified peptides used for aggregating each protein
Method to compute the detailed number of quantified peptides for each protein
Method to create a plot with proteins and peptides on a MSnSet object (peptides)
This function aggregate quantitative data using a method of redistribution of shared peptides. Intensity of shared peptides are redistributed proportionally to each protein. Note that the function assumes that the intensities are not log-transformed.
Aggregation using sum method.
Aggregation using mean method.
Aggregation using median method.
Aggregation using medianPolish method. Note that this method is parallelized to be more efficient.
Aggregation using robustSummary method.
aggregateFeatures4Prostar(object, ...) ## S4 method for signature 'QFeatures' aggregateFeatures4Prostar( object, i, fcol, name = "newAssay", fun = MsCoreUtils::robustSummary, shared = TRUE, n = NULL, ... ) ## S4 method for signature 'SummarizedExperiment' aggregateFeatures4Prostar( object, fcol, fun = MsCoreUtils::robustSummary, conds, shared = TRUE, n = NULL, ... ) aggQmetacell(qMeta, X, level, conds) aggregateMethods() RunAggregation( qf, includeSharedPeptides = "Yes_As_Specific", operator = "Mean", considerPeptides = "allPeptides", adjMatrix = "adjacencyMatrix", ponderation = "Global", n = NULL, aggregated_col = NULL, max_iter = 500 ) BuildColumnToProteinDataset(peptideData, matAdj, columnName, proteinNames) Add_Aggregated_rowData(obj, col, i.agg) metacell_agg(aggregatedSE, originalSE, adj_mat, conds, protname_order) select_topn(pepData, X, n = 10, funpept = "Mean") getProteinsStats(X) CountPep(X) GetNbPeptidesUsed(pepData, X) GetDetailedNbPeptidesUsed(pepData, X) GetDetailedNbPeptides(X) GraphPepProt(mat) ExtractUniquePeptides(X) innerAggregateIter( pepData, X, init.method = "Mean", method = "Mean", n = NULL, uniqueiter = FALSE, topn_fun = "Mean", max_iter = 500 ) innerSum(pepData, X) innerMean(pepData, X) innerMedian(pepData, X) innerMedianpolish(pepData, X) innerRobustsummary(pepData, X)aggregateFeatures4Prostar(object, ...) ## S4 method for signature 'QFeatures' aggregateFeatures4Prostar( object, i, fcol, name = "newAssay", fun = MsCoreUtils::robustSummary, shared = TRUE, n = NULL, ... ) ## S4 method for signature 'SummarizedExperiment' aggregateFeatures4Prostar( object, fcol, fun = MsCoreUtils::robustSummary, conds, shared = TRUE, n = NULL, ... ) aggQmetacell(qMeta, X, level, conds) aggregateMethods() RunAggregation( qf, includeSharedPeptides = "Yes_As_Specific", operator = "Mean", considerPeptides = "allPeptides", adjMatrix = "adjacencyMatrix", ponderation = "Global", n = NULL, aggregated_col = NULL, max_iter = 500 ) BuildColumnToProteinDataset(peptideData, matAdj, columnName, proteinNames) Add_Aggregated_rowData(obj, col, i.agg) metacell_agg(aggregatedSE, originalSE, adj_mat, conds, protname_order) select_topn(pepData, X, n = 10, funpept = "Mean") getProteinsStats(X) CountPep(X) GetNbPeptidesUsed(pepData, X) GetDetailedNbPeptidesUsed(pepData, X) GetDetailedNbPeptides(X) GraphPepProt(mat) ExtractUniquePeptides(X) innerAggregateIter( pepData, X, init.method = "Mean", method = "Mean", n = NULL, uniqueiter = FALSE, topn_fun = "Mean", max_iter = 500 ) innerSum(pepData, X) innerMean(pepData, X) innerMedian(pepData, X) innerMedianpolish(pepData, X) innerRobustsummary(pepData, X)
object |
An instance of class |
... |
Additional parameters passed the |
i |
The index or name of the assay which features will be aggregated the create the new assay. |
fcol |
A |
name |
A |
fun |
A function used for quantitative feature aggregation. See details for examples. |
shared |
A |
n |
A |
conds |
A |
qMeta |
A |
X |
A |
level |
A |
qf |
An instance of class QFeatures::QFeatures. The last assay contained in |
includeSharedPeptides |
How shared peptides are handled. Either |
operator |
A function used for quantitative feature aggregation.
Available functions are |
considerPeptides |
A |
adjMatrix |
A |
ponderation |
A |
aggregated_col |
A |
max_iter |
A |
peptideData |
A data.frame of meta data of peptides. It is the rowData of the SummarizedExperiment object. |
matAdj |
The adjacency matrix used to aggregate the peptides data. |
columnName |
The name(s) of the column in SummarizedExperiment::rowData(peptides_MSnset) that the user wants to keep in the new protein data.frame. |
proteinNames |
The names of the protein in the new dataset (i.e. rownames) |
obj |
An instance of class QFeatures::QFeatures. |
col |
A |
i.agg |
A |
aggregatedSE |
An instance of class SummarizedExperiment::SummarizedExperiment containing the aggregated data. |
originalSE |
An instance of class SummarizedExperiment::SummarizedExperiment containing the non-aggregated data. |
adj_mat |
An adjacency matrix. |
protname_order |
A |
pepData |
A |
funpept |
A function used for determining a peptide's value.
Available functions are |
mat |
An adjacency matrix. |
init.method |
A function used for initializing the aggregation.
Available functions are |
method |
A function used for the aggregation.
Available functions are |
uniqueiter |
A bole |
topn_fun |
A function used to determine how to choose the top n peptides.
Available functions are |
This function uses QFeatures::aggregateFeatures() to aggregate quantitative data.
Aggregation of quantitative data is performed using aggregateFeatures, or
innerAggregateIter if Yes_Iterative_Redistribution or Yes_Simple_Redistribution
is selected.
The handling of shared peptide is as follow :
Yes_As_Specific : Shared peptides are used multiple times.
Each peptide is duplicated as many times as the number of proteins in
which they are present, and thus are considered as if they are specific
to each protein.
Yes_Simple_Redistribution : Intensity of shared peptides are
redistributed proportionally to each protein. See innerAggregateIter
for more information.
Yes_Iterative_Redistribution : Intensity of shared peptides are
redistributed proportionally to each protein. See innerAggregateIter
for more information.
No : No shared peptides are used. If a peptide contained only shared
peptides, its intensity is set as 0 for every sample.
Available functions are :
Sum : base::colSums()] or base::rowSums() if Yes_Iterative_Redistribution or Yes_Simple_Redistribution.
Mean : base::colMeans()] or base::rowMeans() if Yes_Iterative_Redistribution or Yes_Simple_Redistribution.
Median : matrixStats::mcolMedians()] or matrixStats::rowMedians() if Yes_Iterative_Redistribution or Yes_Simple_Redistribution.
medianPolish : MsCoreUtils::medianPolish().
robustSummary : MsCoreUtils::robustSummary().
Available functions are :
Sum : base::rowSums()
Mean : base::rowMeans()
Median : matrixStats::rowMedians()
medianPolish : MsCoreUtils::medianPolish(), not available for topn_fun.
Note that this method takes significantly more time than the others, and is parallelized to be more efficient.
robustSummary : MsCoreUtils::robustSummary(), not available for topn_fun.
Note that this method takes significantly more time than the others, and is parallelized to be more efficient.
A QFeatures object with an additional assay or a SummarizedExperiment object (or subclass thereof).
An instance of the QFeatures class
NA
A QFeatures with an aggregated assay added.
A vector
An instance of QFeatures class with aggregated rowData in specified assay.
A SummarizedExperiment containing the aggregated data.
An adjacency matrix with only the top n peptides selected.
A list
A vector of boolean which is the adjacency matrix but with NA values if they exist in the intensity matrix.
A data.frame
A list of two items
A data.frame
A histogram
A matrix containing the aggregated values.
A matrix containing the aggregated values.
A matrix containing the aggregated values.
A matrix containing the aggregated values.
A matrix containing the aggregated values.
A matrix containing the aggregated values.
The function to aggregate the quantitative metadata is aggQmetadat().
Samuel Wieczorek, Manon Gaudin
Samuel Wieczorek
Manon Gaudin
Alexia Dorffer
Alexia Dorffer, Samuel Wieczorek
The QFeatures vignette provides an extended example and the Aggregation vignette, for a complete quantitative proteomics data processing pipeline.
NULL data(subR25pept) qMeta <- qMetacell(subR25pept, 1) X <- QFeatures::adjacencyMatrix(subR25pept[[1]]) level <- typeDataset(subR25pept[[1]]) conds <- SummarizedExperiment::colData(subR25pept)$Condition aggQmeta <- aggQmetacell(qMeta, X, level, conds) data(subR25pept) # Remove empty lines filter_emptyline <- FunctionFilter("qMetacellWholeLine", cmd = 'delete', pattern = 'Missing MEC') subR25pept <- filterFeaturesOneSE(object = subR25pept, i = length(subR25pept), name = "Filtered", filters = list(filter_emptyline)) # Remove proteins with no peptide associated in adjacency matrix indx <- which(Matrix::colSums( SummarizedExperiment::rowData( subR25pept[[length(subR25pept)]])$adjacencyMatrix) != 0) SummarizedExperiment::rowData( subR25pept[[length(subR25pept)]])$adjacencyMatrix <- SummarizedExperiment::rowData( subR25pept[[length(subR25pept)]])$adjacencyMatrix[, indx] obj.agg <- RunAggregation(subR25pept, "Yes_As_Specific", "Sum", "allPeptides", aggregated_col = c("Sequence", "Mass")) obj.agg <- RunAggregation(subR25pept, "Yes_As_Specific", "Mean", "allPeptides", aggregated_col = c("Sequence", "Mass")) obj.agg <- RunAggregation(subR25pept, "Yes_As_Specific", "Sum", "topN", n = 4, aggregated_col = c("Sequence", "Mass")) obj.agg <- RunAggregation(subR25pept, "Yes_As_Specific", "Mean", "topN", n = 4, aggregated_col = c("Sequence", "Mass")) obj.agg <- RunAggregation(subR25pept, "No", "Sum", "allPeptides") obj.agg <- RunAggregation(subR25pept, "No", "Sum", "topN", n = 4) obj.agg <- RunAggregation(subR25pept, "Yes_Simple_Redistribution", "Sum", "allPeptides", aggregated_col = c("Sequence", "Mass")) obj.agg <- RunAggregation(subR25pept, "Yes_Iterative_Redistribution", "Sum", "topN", n = 4, aggregated_col = c("Sequence", "Mass")) library(QFeatures) data(subR25pept) protID <- parentProtId(subR25pept[[1]]) X <- QFeatures::adjacencyMatrix(subR25pept[[1]]) X.split <- DaparToolshed::splitAdjacencyMat(X) X.shared <- X.split$Xshared X.unique <- X.split$Xspec data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) X.topn <- select_topn(SummarizedExperiment::assay(subR25pept[[1]]), X, n = 3) data(subR25pept) obj.last <- subR25pept[[1]] X <- BuildAdjacencyMatrix(subR25pept[[1]]) getProteinsStats(X) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) CountPep(X) library(QFeatures) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) GetNbPeptidesUsed(SummarizedExperiment::assay(subR25pept), X) library(SummarizedExperiment) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) ll.n <- GetDetailedNbPeptidesUsed(SummarizedExperiment::assay(subR25pept), X) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) n <- GetDetailedNbPeptides(X) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) GraphPepProt(X) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) ExtractUniquePeptides(X) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) qdata.agg <- innerAggregateIter(SummarizedExperiment::assay(subR25pept[[1]]), X) library(QFeatures) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) i.sum <- innerSum(SummarizedExperiment::assay(subR25pept[[1]]), X) library(QFeatures) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) i.mean <- innerMean(SummarizedExperiment::assay(subR25pept), X) library(QFeatures) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) i.mean <- innerMedian(SummarizedExperiment::assay(subR25pept[[1]]), X) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) i.mean <- innerMedianpolish(SummarizedExperiment::assay(subR25pept[[1]]), X) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) i.mean <- innerRobustsummary(SummarizedExperiment::assay(subR25pept[[1]]), X)NULL data(subR25pept) qMeta <- qMetacell(subR25pept, 1) X <- QFeatures::adjacencyMatrix(subR25pept[[1]]) level <- typeDataset(subR25pept[[1]]) conds <- SummarizedExperiment::colData(subR25pept)$Condition aggQmeta <- aggQmetacell(qMeta, X, level, conds) data(subR25pept) # Remove empty lines filter_emptyline <- FunctionFilter("qMetacellWholeLine", cmd = 'delete', pattern = 'Missing MEC') subR25pept <- filterFeaturesOneSE(object = subR25pept, i = length(subR25pept), name = "Filtered", filters = list(filter_emptyline)) # Remove proteins with no peptide associated in adjacency matrix indx <- which(Matrix::colSums( SummarizedExperiment::rowData( subR25pept[[length(subR25pept)]])$adjacencyMatrix) != 0) SummarizedExperiment::rowData( subR25pept[[length(subR25pept)]])$adjacencyMatrix <- SummarizedExperiment::rowData( subR25pept[[length(subR25pept)]])$adjacencyMatrix[, indx] obj.agg <- RunAggregation(subR25pept, "Yes_As_Specific", "Sum", "allPeptides", aggregated_col = c("Sequence", "Mass")) obj.agg <- RunAggregation(subR25pept, "Yes_As_Specific", "Mean", "allPeptides", aggregated_col = c("Sequence", "Mass")) obj.agg <- RunAggregation(subR25pept, "Yes_As_Specific", "Sum", "topN", n = 4, aggregated_col = c("Sequence", "Mass")) obj.agg <- RunAggregation(subR25pept, "Yes_As_Specific", "Mean", "topN", n = 4, aggregated_col = c("Sequence", "Mass")) obj.agg <- RunAggregation(subR25pept, "No", "Sum", "allPeptides") obj.agg <- RunAggregation(subR25pept, "No", "Sum", "topN", n = 4) obj.agg <- RunAggregation(subR25pept, "Yes_Simple_Redistribution", "Sum", "allPeptides", aggregated_col = c("Sequence", "Mass")) obj.agg <- RunAggregation(subR25pept, "Yes_Iterative_Redistribution", "Sum", "topN", n = 4, aggregated_col = c("Sequence", "Mass")) library(QFeatures) data(subR25pept) protID <- parentProtId(subR25pept[[1]]) X <- QFeatures::adjacencyMatrix(subR25pept[[1]]) X.split <- DaparToolshed::splitAdjacencyMat(X) X.shared <- X.split$Xshared X.unique <- X.split$Xspec data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) X.topn <- select_topn(SummarizedExperiment::assay(subR25pept[[1]]), X, n = 3) data(subR25pept) obj.last <- subR25pept[[1]] X <- BuildAdjacencyMatrix(subR25pept[[1]]) getProteinsStats(X) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) CountPep(X) library(QFeatures) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) GetNbPeptidesUsed(SummarizedExperiment::assay(subR25pept), X) library(SummarizedExperiment) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) ll.n <- GetDetailedNbPeptidesUsed(SummarizedExperiment::assay(subR25pept), X) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) n <- GetDetailedNbPeptides(X) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) GraphPepProt(X) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) ExtractUniquePeptides(X) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) qdata.agg <- innerAggregateIter(SummarizedExperiment::assay(subR25pept[[1]]), X) library(QFeatures) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) i.sum <- innerSum(SummarizedExperiment::assay(subR25pept[[1]]), X) library(QFeatures) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) i.mean <- innerMean(SummarizedExperiment::assay(subR25pept), X) library(QFeatures) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) i.mean <- innerMedian(SummarizedExperiment::assay(subR25pept[[1]]), X) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) i.mean <- innerMedianpolish(SummarizedExperiment::assay(subR25pept[[1]]), X) data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) i.mean <- innerRobustsummary(SummarizedExperiment::assay(subR25pept[[1]]), X)
This function aggregates the quantitative features of an assay,
applying a summarization function (fun) to sets of features.
The fcol variable name points to a rowData column that defines
how to group the features during aggregate. This variable has to
be an adjacency matrix. This function uses DaparToolshed::innerAggregateIter()
to aggregate quantitative data.
The list of agregation methods can be obtained with the function
aggregateMethods(). This function compiles both methods from the
packages DaparToolshed and QFeatures.
aggregateRedistribution(object, ...) ## S4 method for signature 'QFeatures' aggregateRedistribution( object, i, name = "newAssay", fcol, init.method = "Mean", method = "Mean", ponderation = "Global", n = NULL, uniqueiter = FALSE, max_iter = 500 ) ## S4 method for signature 'SummarizedExperiment' aggregateRedistribution( object, fcol, init.method = "Mean", method = "Mean", ponderation = "Global", n = NULL, uniqueiter = FALSE, conds, max_iter = 500 )aggregateRedistribution(object, ...) ## S4 method for signature 'QFeatures' aggregateRedistribution( object, i, name = "newAssay", fcol, init.method = "Mean", method = "Mean", ponderation = "Global", n = NULL, uniqueiter = FALSE, max_iter = 500 ) ## S4 method for signature 'SummarizedExperiment' aggregateRedistribution( object, fcol, init.method = "Mean", method = "Mean", ponderation = "Global", n = NULL, uniqueiter = FALSE, conds, max_iter = 500 )
object |
An instance of class |
... |
Additional parameters. |
i |
The index or name of the assay which features will be aggregated the create the new assay. |
name |
A |
fcol |
A |
init.method |
A function used for initializing the aggregation.
Available functions are |
method |
A function used for the aggregation.
Available functions are |
ponderation |
A |
n |
A |
uniqueiter |
A |
max_iter |
A |
conds |
A |
This function uses DaparToolshed::innerAggregateIter() to aggregate quantitative data.
A QFeatures object with an additional assay or a SummarizedExperiment object (or subclass thereof).
NA
The function to aggregate the quantitative metadata is aggQmetadat()
The QFeatures vignette provides an extended example and the Aggregation vignette, for a complete quantitative proteomics data processing pipeline.
NULLNULL
This function is a wrapper to the function adjust.p from the cp4p package.
It returns the adjusted p-values corresponding to the p-values of the differential
analysis. The adjusted p-values is computed with the function p.adjust{stats}.
diffAnaComputeAdjustedPValues(pval, pi0Method = 1)diffAnaComputeAdjustedPValues(pval, pi0Method = 1)
pval |
The result (p-values) of the differential analysis |
pi0Method |
The parameter pi0.method of the method adjust.p in the
package |
The computed adjusted p-values
Samuel Wieczorek
data(subR25prot) obj <- subR25prot # Simulate imputation obj <- NAIsZero(obj, 1) allComp <- limmaCompleteTest( SummarizedExperiment::assay(obj[[length(obj)]]), design_qf(obj), comp.type="OnevsOne") diffAnaComputeAdjustedPValues(pval = allComp$P_Value[, 1])data(subR25prot) obj <- subR25prot # Simulate imputation obj <- NAIsZero(obj, 1) allComp <- limmaCompleteTest( SummarizedExperiment::assay(obj[[length(obj)]]), design_qf(obj), comp.type="OnevsOne") diffAnaComputeAdjustedPValues(pval = allComp$P_Value[, 1])
This function returns the FDR corresponding to the p-values of the differential analysis.
diffAnaComputeFDR(adj.pvals)diffAnaComputeFDR(adj.pvals)
adj.pvals |
The adjusted p-values of the differential analysis |
The computed FDR value (floating number)
Samuel Wieczorek
NULLNULL
#' Plots an interactive volcanoplot after the differential analysis.
Typically, the log of Fold Change is represented on the X-axis and the
log10 of the p-value is drawn on the Y-axis. When the th_pval
and the th_logfc are set, two lines are drawn respectively on
the y-axis and the X-axis to visually distinguish between differential and
non differential data. With the use of the package plotly, a
customizable tooltip appears when the user put the mouse's pointer over
a point of the scatter plot.
diffAnaVolcanoplot_rCharts( df, th_pval = 1e-60, th_logfc = 0, conditions = NULL, pal = NULL )diffAnaVolcanoplot_rCharts( df, th_pval = 1e-60, th_logfc = 0, conditions = NULL, pal = NULL )
df |
A dataframe which contains the following slots : x : a vector of the log(fold change) values of the differential analysis, y : a vector of the p-value values returned by the differential analysis. index : a vector of the rowanmes of the data. This dataframe must has been built with the option stringsAsFactors set to FALSE. There may be additional slots which will be used to show informations in the tooltip. The name of these slots must begin with the prefix "tooltip_". It will be automatically removed in the plot. |
th_pval |
A floating number which represents the p-value that separates differential and non-differential data. |
th_logfc |
A floating number which represents the log of the Fold Change that separates differential and non-differential data. |
conditions |
A list of the names of condition 1 and 2 used for the differential analysis. |
pal |
A |
An interactive volcanoplot
Samuel Wieczorek
data(subR25prot) obj <- subR25prot # Simulate imputation obj <- NAIsZero(obj, 1) allComp <- limmaCompleteTest( SummarizedExperiment::assay(obj[[length(obj)]]), design_qf(obj), comp.type="OnevsOne") df <- data.frame( x = allComp$logFC[[1]], y = -log10(allComp$P_Value[[1]]), index = as.character(rownames(obj[[1]])) ) tooltipSlot <- c("Fasta_headers", "Sequence_length") df <- cbind(df, SummarizedExperiment::rowData(obj[[1]])[, tooltipSlot]) colnames(df) <- gsub(".", "_", colnames(df), fixed = TRUE) if (ncol(df) > 3) { colnames(df)[4:ncol(df)] <- paste0("tooltip_", colnames(df)[4:ncol(df)]) } cond <- c("25fmol", "10fmol") diffAnaVolcanoplot_rCharts( df, th_pval = 2.5, th_logfc = 1, conditions = cond )data(subR25prot) obj <- subR25prot # Simulate imputation obj <- NAIsZero(obj, 1) allComp <- limmaCompleteTest( SummarizedExperiment::assay(obj[[length(obj)]]), design_qf(obj), comp.type="OnevsOne") df <- data.frame( x = allComp$logFC[[1]], y = -log10(allComp$P_Value[[1]]), index = as.character(rownames(obj[[1]])) ) tooltipSlot <- c("Fasta_headers", "Sequence_length") df <- cbind(df, SummarizedExperiment::rowData(obj[[1]])[, tooltipSlot]) colnames(df) <- gsub(".", "_", colnames(df), fixed = TRUE) if (ncol(df) > 3) { colnames(df)[4:ncol(df)] <- paste0("tooltip_", colnames(df)[4:ncol(df)]) } cond <- c("25fmol", "10fmol") diffAnaVolcanoplot_rCharts( df, th_pval = 2.5, th_logfc = 1, conditions = cond )
Display a CC
displayCCvisNet(g)displayCCvisNet(g)
g |
A cc (a list) |
A plot
Thomas Burger, Samuel Wieczorek
data(subR25pept) X <- QFeatures::adjacencyMatrix(subR25pept[[1]]) ll <- getPepProtCC(X) g <- buildGraph(ll[[1]], X) displayCCvisNet(g)data(subR25pept) X <- QFeatures::adjacencyMatrix(subR25pept[[1]]) ll <- getPepProtCC(X) g <- buildGraph(ll[[1]], X) displayCCvisNet(g)
The colors in the returned palette are always in the same order
ExtendPalette(n = 0, base = "Set1")ExtendPalette(n = 0, base = "Set1")
n |
The number of desired colors in the palette |
base |
The name of the palette of the package RColorBrewer from which the extended palette is built. Default value is 'Set1'. |
A vector composed of n color code.
Samuel Wieczorek
ExtendPalette(12) nPalette <- 10 par(mfrow = c(nPalette, 1)) par(mar = c(0.5, 4.5, 0.5, 0.5)) for (i in seq_len(nPalette)) { pal <- ExtendPalette(n = i, base = "Dark2") barplot(seq_len(length(pal)), col = pal) print(pal) }ExtendPalette(12) nPalette <- 10 par(mfrow = c(nPalette, 1)) par(mar = c(0.5, 4.5, 0.5, 0.5)) for (i in seq_len(nPalette)) { pal <- ExtendPalette(n = i, base = "Dark2") barplot(seq_len(length(pal)), col = pal) print(pal) }
Extracts the FC and the FWER ajusted p-values and format them in a data.frame
formatHSDResults(post_hoc_models_summaries)formatHSDResults(post_hoc_models_summaries)
post_hoc_models_summaries |
resulting from applying lapply(summary((.)) to a multicomp function. |
A data.frame()
Thomas Burger
NULLNULL
Format Limma results
formatLimmaResult(fit, conds, contrast, design.level)formatLimmaResult(fit, conds, contrast, design.level)
fit |
An object of class |
conds |
A |
contrast |
An |
design.level |
An |
A list of two dataframes : logFC and P_Value. The first one contains the logFC values of all the comparisons (one column for one comparison), the second one contains the pvalue of all the comparisons (one column for one comparison). The names of the columns for those two dataframes are identical and correspond to the description of the comparison.
Samuel Wieczorek
library(SummarizedExperiment) data(subR25prot) level <- 'protein' metacell.mask <- matchMetacell(qMetacell(subR25prot[[1]]), c("Missing POV", "Missing MEC"), level) # Simulate imputation assay(subR25prot[[1]])[which(is.na(assay(subR25prot[[1]])))] <- 0 qData <- as.matrix(SummarizedExperiment::assay(subR25prot[[1]])) sTab <- SummarizedExperiment::colData(subR25prot) limma <- limmaCompleteTest(qData, sTab)library(SummarizedExperiment) data(subR25prot) level <- 'protein' metacell.mask <- matchMetacell(qMetacell(subR25prot[[1]]), c("Missing POV", "Missing MEC"), level) # Simulate imputation assay(subR25prot[[1]])[which(is.na(assay(subR25prot[[1]])))] <- 0 qData <- as.matrix(SummarizedExperiment::assay(subR25prot[[1]])) sTab <- SummarizedExperiment::colData(subR25prot) limma <- limmaCompleteTest(qData, sTab)
Extract logFC and raw pvalues from multiple post-hoc models summaries
formatPHResults(post_hoc_models_summaries)formatPHResults(post_hoc_models_summaries)
post_hoc_models_summaries |
a list of summaries of post-hoc models. |
a list of 2 dataframes containing the logFC values and pvalues for each comparison.
Helene Borges
library(SummarizedExperiment) data(subR25prot) obj <- subR25prot filter <- FunctionFilter('qMetacellOnConditions', cmd = 'delete', mode = 'AtLeastOneCond', pattern = c("Missing POV", "Missing MEC"), conds = design_qf(obj)$Condition, percent = TRUE, th = 0.8, operator = '>') obj <- filterFeaturesOneSE(obj, name = "Filtered", filters = list(filter)) qdata <- SummarizedExperiment::assay(obj[[2]]) conds <- design_qf(obj)$Condition anova_tests <- apply(qdata, 1, classic1wayAnova, conditions = as.factor(conds)) anova_tests <- t(anova_tests) names(anova_tests) <- rownames(qdata) tms <- lapply( anova_tests, function(x) { summary(multcomp::glht(x, linfct = multcomp::mcp(conditions = "Tukey") ), test = multcomp::adjusted("none") ) } ) res <- formatPHResults(tms)library(SummarizedExperiment) data(subR25prot) obj <- subR25prot filter <- FunctionFilter('qMetacellOnConditions', cmd = 'delete', mode = 'AtLeastOneCond', pattern = c("Missing POV", "Missing MEC"), conds = design_qf(obj)$Condition, percent = TRUE, th = 0.8, operator = '>') obj <- filterFeaturesOneSE(obj, name = "Filtered", filters = list(filter)) qdata <- SummarizedExperiment::assay(obj[[2]]) conds <- design_qf(obj)$Condition anova_tests <- apply(qdata, 1, classic1wayAnova, conditions = as.factor(conds)) anova_tests <- t(anova_tests) names(anova_tests) <- rownames(qdata) tms <- lapply( anova_tests, function(x) { summary(multcomp::glht(x, linfct = multcomp::mcp(conditions = "Tukey") ), test = multcomp::adjusted("none") ) } ) res <- formatPHResults(tms)
Extracts the FC and the raw p-values and format them in a data.frame
formatPHTResults(post_hoc_models_summaries)formatPHTResults(post_hoc_models_summaries)
post_hoc_models_summaries |
resulting from applying lapply(summary((.)) to a multicomp function. |
A data.frame()
Thomas Burger
NULLNULL
#' fudge2LRT: heuristic to choose the value of the hyperparameter (fudge factor) used to regularize the variance estimator in the likelihood ratio statistic (as implemented in samLRT). We follow the heuristic described in [1] and adapt the code of the fudge2 function in the siggene R package. [1] Tusher, Tibshirani and Chu, Significance analysis of microarrays applied to the ionizing radiation response, PNAS 2001 98: 5116-5121, (Apr 24).
fudge2LRT( lmm.res.h0, lmm.res.h1, cc, n, p, s, alpha = seq(0, 1, 0.05), include.zero = TRUE )fudge2LRT( lmm.res.h0, lmm.res.h1, cc, n, p, s, alpha = seq(0, 1, 0.05), include.zero = TRUE )
lmm.res.h0 |
a vector of object containing the estimates (used to compute the statistic) under H0 for each connected component. If the fast version of the estimator was used (as implemented in this package), lmm.res.h0 is a vector containing averages of squared residuals. If a fixed effect model was used, it is a vector of lm objects and if a mixed effect model was used it is a vector or lmer object. |
lmm.res.h1 |
similar to lmm.res.h0, a vector of object containing the estimates (used to compute the statistic) under H1 for each protein. |
cc |
a list containing the indices of peptides and proteins belonging to each connected component. |
n |
the number of samples used in the test |
p |
the number of proteins in the experiment |
s |
a vector containing the maximum likelihood estimate of the variance for the chosen model. When using the fast version of the estimator implemented in this package, this is the same thing as the input lmm.res.h1. For other models (e.g. mixed models) it can be obtained from samLRT. |
alpha |
A vector of proportions used to build candidate values for the regularizer. We use quantiles of s with these proportions. Default to seq(0, 1, 0.05) |
include.zero |
logical value indicating if 0 should be included in the list of candidates. Default to TRUE. |
(same as the fudge2 function of siggene):
s.zero: the value of the fudge factor s0.
alpha.hat: the optimal quantile of the 's' values. If s0=0, 'alpha.hat' will not be returned.
vec.cv: the vector of the coefficients of variations. Following Tusher et al. (2001), the optimal 'alpha' quantile is given by the quantile that leads to the smallest CV of the modified test statistics.
msg: a character string summarizing the most important information about the fudge factor.
Thomas Burger, Laurent Jacob
NULLNULL
Builds a complete color palette for the conditions given in argument
GetColorsForConditions(conds, pal = NULL)GetColorsForConditions(conds, pal = NULL)
conds |
The extended vector of samples conditions |
pal |
A vector of HEX color code that form the basis palette from which to build the complete color vector for the conditions. |
NA
Samuel Wieczorek
data(subR25pept) GetColorsForConditions(design_qf(subR25pept)$Condition) GetColorsForConditions(design_qf(subR25pept)$Condition, ExtendPalette(2))data(subR25pept) GetColorsForConditions(design_qf(subR25pept)$Condition) GetColorsForConditions(design_qf(subR25pept)$Condition, ExtendPalette(2))
Get design level
getDesignLevel(sTab)getDesignLevel(sTab)
sTab |
A |
An integer
data(subR25pept) sTab <- SummarizedExperiment::colData(subR25pept) getDesignLevel(sTab)data(subR25pept) sTab <- SummarizedExperiment::colData(subR25pept) getDesignLevel(sTab)
paramshistory function.Wrapper for the paramshistory function.
GetHistory(obj.se, history)GetHistory(obj.se, history)
obj.se |
An instance of the class |
history |
A |
A data.frame()
Samuel Wieczorek
data(subR25prot) GetHistory(subR25prot[[1]])data(subR25prot) GetHistory(subR25prot[[1]])
This function looks for the lines that respect the request in either all conditions or at least one condition.
GetIndices_BasedOnConditions(metacell.mask, type, conds, percent, op, th)GetIndices_BasedOnConditions(metacell.mask, type, conds, percent, op, th)
metacell.mask |
A |
type |
Available values are:
|
conds |
A |
percent |
A boolean to indicate whether the threshold represent an absolute value (percent = FALSE) or a percentage (percent=TRUE). |
op |
String for operator to use. List of operators is available with the function 'SymFilteringOperators()'. |
th |
The threshold to apply |
A vector of integer()
data(subR25pept) level <- typeDataset(subR25pept[[1]]) pattern <- 'Missing' metacell.mask <- matchMetacell( metadata=qMetacell(subR25pept[[1]]), pattern=pattern, level=level) type <- 'AllCond' conds <- design_qf(subR25pept)$Condition op <- '>=' th <- 0.5 percent <- TRUE ind <- GetIndices_BasedOnConditions(metacell.mask, type, conds, percent, op, th)data(subR25pept) level <- typeDataset(subR25pept[[1]]) pattern <- 'Missing' metacell.mask <- matchMetacell( metadata=qMetacell(subR25pept[[1]]), pattern=pattern, level=level) type <- 'AllCond' conds <- design_qf(subR25pept)$Condition op <- '>=' th <- 0.5 percent <- TRUE ind <- GetIndices_BasedOnConditions(metacell.mask, type, conds, percent, op, th)
Delete the lines in the matrix of intensities and the metadata table given their indices.
GetIndices_FunFiltering( obj, conds, level, pattern = NULL, type = NULL, percent, op, th )GetIndices_FunFiltering( obj, conds, level, pattern = NULL, type = NULL, percent, op, th )
obj |
An object of class |
conds |
A vector containing the names of the conditions from the sample. |
level |
A vector of integers which are the indices of lines to delete. |
pattern |
A string to be included in the |
type |
Available values are:
|
percent |
A boolean to indicate whether the threshold represent an absolute value (percent = FALSE) or a percentage (percent=TRUE). |
op |
String for operator to use. List of operators is available with 'SymFilteringOperators()'. |
th |
A floating number which is in the interval |
An instance of class SummarizedExperiment that have been filtered.
Samuel Wieczorek
NANA
This function looks for the lines where each element respect the query.
GetIndices_WholeLine(metacell.mask)GetIndices_WholeLine(metacell.mask)
metacell.mask |
A |
A vector of integer()
data(subR25pept) level <- 'peptide' pattern <- "Missing POV" metacell.mask <- matchMetacell(metadata = qMetacell(subR25pept[[1]]), pattern = pattern, level = level) ind <- GetIndices_WholeLine(metacell.mask)data(subR25pept) level <- 'peptide' pattern <- "Missing POV" metacell.mask <- matchMetacell(metadata = qMetacell(subR25pept[[1]]), pattern = pattern, level = level) ind <- GetIndices_WholeLine(metacell.mask)
This function looks for the lines that respect the request in either all conditions or at least one condition.
GetIndices_WholeMatrix(metacell.mask, op = "==", percent = FALSE, th = 0)GetIndices_WholeMatrix(metacell.mask, op = "==", percent = FALSE, th = 0)
metacell.mask |
A |
op |
String for operator to use. List of operators is available with 'SymFilteringOperators()'. |
percent |
A boolean to indicate whether the threshold represent an absolute value (percent = FALSE) or a percentage (percent=TRUE). |
th |
A floating number which is in the interval |
A vector of integer()
data(subR25pept) level <- 'peptide' pattern <- "Missing" metacell.mask <- matchMetacell( metadata = qMetacell(subR25pept[[1]]), pattern = pattern, level = level) percent <- FALSE th <- 3 op <- ">=" ind <- GetIndices_WholeMatrix(metacell.mask, op, percent, th)data(subR25pept) level <- 'peptide' pattern <- "Missing" metacell.mask <- matchMetacell( metadata = qMetacell(subR25pept[[1]]), pattern = pattern, level = level) percent <- FALSE th <- 3 op <- ">=" ind <- GetIndices_WholeMatrix(metacell.mask, op, percent, th)
Returns the possible number of values in lines in the data
getListNbValuesInLines(object, conds, type = "WholeMatrix")getListNbValuesInLines(object, conds, type = "WholeMatrix")
object |
An object of class |
conds |
A |
type |
WholeMatrix, AllCond or AtLeastOneCond |
An integer
Samuel Wieczorek, Enora Fremy
data(subR25prot) res <- getListNbValuesInLines(subR25prot[[1]])data(subR25prot) res <- getListNbValuesInLines(subR25prot[[1]])
Number of each metacell tags
GetNbTags(obj)GetNbTags(obj)
obj |
A instance of the class |
An integer
library(DaparToolshed) data(subR25pept, package = 'DaparToolshed') GetNbTags(subR25pept[[1]])library(DaparToolshed) data(subR25pept, package = 'DaparToolshed') GetNbTags(subR25pept[[1]])
Returns the number of empty lines in a matrix.
getNumberOfEmptyLines(qData)getNumberOfEmptyLines(qData)
qData |
A matrix corresponding to the quantitative data. |
An integer
Samuel Wieczorek
library(QFeatures) data(subR25prot) qData <- SummarizedExperiment::assay(subR25prot[[1]]) getNumberOfEmptyLines(qData)library(QFeatures) data(subR25prot) qData <- SummarizedExperiment::assay(subR25prot[[1]]) getNumberOfEmptyLines(qData)
Build the list of connex composant of the adjacency matrix
getPepProtCC(X)getPepProtCC(X)
X |
An adjacency matrix |
A list of CC
Thomas Burger, Samuel Wieczorek
data(subR25pept) X <- QFeatures::adjacencyMatrix(subR25pept[[1]]) ll <- getPepProtCC(X)data(subR25pept) X <- QFeatures::adjacencyMatrix(subR25pept[[1]]) ll <- getPepProtCC(X)
The set of available softwares to convert from
GetSoftAvailables()GetSoftAvailables()
A vecotr of charatcer
GetSoftAvailables()GetSoftAvailables()
Computes the adjusted p-values on all the stacked contrasts using CP4P
globalAdjPval(x, pval.threshold = 1.05, method = 1, display = TRUE)globalAdjPval(x, pval.threshold = 1.05, method = 1, display = TRUE)
x |
a proteins x contrasts dataframe of (raw) p-values |
pval.threshold |
all the p-values above the threshold are not considered. Default is 1.05 (which is equivalent to have no threshold). Applying a threshold nearby 1 can be instrumental to improve the uniformity under the null, notably in case of upstream mutliple contrat correction (for experienced users only) |
method |
method a method to estimate pi_0, see CP4P |
display |
if T, a calibration plot is diplayed using CP4P |
a proteins x contrasts table of adjusted p-values
Thomas Burger
data(subR25prot) obj <- subR25prot[seq_len(5),] globalAdjPval(testAnovaModels( applyAnovasOnProteins(obj, 1), "TukeyHSD")$P_Value)data(subR25prot) obj <- subR25prot[seq_len(5),] globalAdjPval(testAnovaModels( applyAnovasOnProteins(obj, 1), "TukeyHSD")$P_Value)
This function show the density plots of Fold Change (the same as calculated by limma) for a list of the comparisons of conditions in a differential analysis.
hc_logFC_DensityPlot(df_logFC, th_logFC = 0, pal = NULL)hc_logFC_DensityPlot(df_logFC, th_logFC = 0, pal = NULL)
df_logFC |
A dataframe that contains the logFC values |
th_logFC |
The threshold on log(Fold Change) to distinguish between differential and non-differential data |
pal |
A |
A plotly density plot
Samuel Wieczorek
library(SummarizedExperiment) data(subR25pept) # Simulate missing value imputation SummarizedExperiment::assay(subR25pept[[1]])[which(is.na(assay(subR25pept[[1]])))] <- 0 qData <- as.matrix(SummarizedExperiment::assay(subR25pept[[1]])) sTab <- SummarizedExperiment::colData(subR25pept) limma <- limmaCompleteTest(qData, sTab) pal <- ExtendPalette(2, "Dark2") hc_logFC_DensityPlot(limma$logFC, th_logFC = 1, pal = pal)library(SummarizedExperiment) data(subR25pept) # Simulate missing value imputation SummarizedExperiment::assay(subR25pept[[1]])[which(is.na(assay(subR25pept[[1]])))] <- 0 qData <- as.matrix(SummarizedExperiment::assay(subR25pept[[1]])) sTab <- SummarizedExperiment::colData(subR25pept) limma <- limmaCompleteTest(qData, sTab) pal <- ExtendPalette(2, "Dark2") hc_logFC_DensityPlot(limma$logFC, th_logFC = 1, pal = pal)
Display a heatmap for data with missing values
heatmapForMissingValues( x, col = NULL, srtCol = NULL, labCol = NULL, labRow = NULL, key = TRUE, key.title = NULL, main = NULL, ylab = NULL )heatmapForMissingValues( x, col = NULL, srtCol = NULL, labCol = NULL, labRow = NULL, key = TRUE, key.title = NULL, main = NULL, ylab = NULL )
x |
A numeric matrix |
col |
See |
srtCol |
See |
labCol |
See |
labRow |
See |
key |
See |
key.title |
See |
main |
See |
ylab |
See |
A heatmap
Plots a histogram of p-values
histPValue_HC(pval_ll, bins = 80, pi0 = 1)histPValue_HC(pval_ll, bins = 80, pi0 = 1)
pval_ll |
A vector of the p-values. |
bins |
A integer indicating the number of cells for the histogram |
pi0 |
A |
A histogram of the p-values with pi0
Samuel Wieczorek
data(subR25prot) obj <- subR25prot # Simulate imputation obj <- NAIsZero(obj, 1) allComp <- limmaCompleteTest( SummarizedExperiment::assay(obj[[length(obj)]]), design_qf(obj), comp.type="OnevsOne") histPValue_HC(allComp$P_Value[1])data(subR25prot) obj <- subR25prot # Simulate imputation obj <- NAIsZero(obj, 1) allComp <- limmaCompleteTest( SummarizedExperiment::assay(obj[[length(obj)]]), design_qf(obj), comp.type="OnevsOne") histPValue_HC(allComp$P_Value[1])
MSnSet objectThis method is a variation to the function impute.pa() from the
package imp4p.
imputePA2( tab, conditions, q.min = 0, q.norm = 3, eps = 0, distribution = "unif" )imputePA2( tab, conditions, q.min = 0, q.norm = 3, eps = 0, distribution = "unif" )
tab |
An object of class |
conditions |
A vector of conditions in the dataset |
q.min |
A quantile value of the observed values allowing defining the maximal value which can be generated. This maximal value is defined by the quantile q.min of the observed values distribution minus eps. Default is 0 (the maximal value is the minimum of observed values minus eps). |
q.norm |
A quantile value of a normal distribution allowing defining the minimal value which can be generated. Default is 3 (the minimal value is the maximal value minus qn*median(sd(observed values)) where sd is the standard deviation of a row in a condition). |
eps |
A value allowing defining the maximal value which can be generated. This maximal value is defined by the quantile q.min of the observed values distribution minus eps. Default is 0. |
distribution |
The type of distribution used. Values are unif or beta. |
The object obj which has been imputed
Thomas Burger, Samuel Wieczorek
library(QFeatures) utils::data(subR25pept) qdata <- SummarizedExperiment::assay(subR25pept[[1]]) conds <- design_qf(subR25pept)$Condition obj.imp <- imputePA2(qdata, conds, distribution = "beta")library(QFeatures) utils::data(subR25pept) qdata <- SummarizedExperiment::assay(subR25pept[[1]]) conds <- design_qf(subR25pept)$Condition obj.imp <- imputePA2(qdata, conds, distribution = "beta")
This function initializes the history.
InitializeHistory()InitializeHistory()
An empty data.frame with 4 columns ('Process', 'Step', 'Parameter' and 'Value')
InitializeHistory()InitializeHistory()
This function allows to identify differentially abundant peptide/protein
isDifferential(pvalue, logFC, thpvalue, thlogFC)isDifferential(pvalue, logFC, thpvalue, thlogFC)
pvalue |
A vector of p-values. |
logFC |
A vector of logFC. |
thpvalue |
A float indicating the p-value threshold. |
thlogFC |
A float indicating the logFC threshold. |
A vector indicating which peptide/protein is differentially abundant (1) or not (0).
Manon Gaudin
data(subR25prot) obj <- subR25prot # Simulate imputation obj <- NAIsZero(obj, 1) allComp <- limmaCompleteTest( SummarizedExperiment::assay(obj[[length(obj)]]), design_qf(obj), comp.type="OnevsOne") isDifferential(allComp$P_Value[, 1], allComp$logFC[, 1], 0.05, 0.5)data(subR25prot) obj <- subR25prot # Simulate imputation obj <- NAIsZero(obj, 1) allComp <- limmaCompleteTest( SummarizedExperiment::assay(obj[[length(obj)]]), design_qf(obj), comp.type="OnevsOne") isDifferential(allComp$P_Value[, 1], allComp$logFC[, 1], 0.05, 0.5)
is.na() but focused on the equality
with the paramter 'type'.Similar to the function is.na() but focused on the equality
with the paramter 'type'.
isOfType(data, type)isOfType(data, type)
data |
A data.frame |
type |
The value to search in the dataframe |
A boolean dataframe
Samuel Wieczorek
library(QFeatures) data(subR25prot) obj <- subR25prot[[1]] data <- qMetacell(obj) isOfType(as.data.frame(data), "MEC")library(QFeatures) data(subR25prot) obj <- subR25prot[[1]] data <- qMetacell(obj) isOfType(as.data.frame(data), "MEC")
Check is a given set is a subset of another one.
isSubset(set1, set2)isSubset(set1, set2)
set1 |
A vector of |
set2 |
A vector of |
A boolean
isSubset('a', letters) isSubset(c('a', 'c', 't'), letters) isSubset(c('a', 3, 't'), letters) isSubset(3, letters)isSubset('a', letters) isSubset(c('a', 'c', 't'), letters) isSubset(c('a', 3, 't'), letters) isSubset(3, letters)
QFeatures objectRemoves one or more items from the dataset. This function is specific of the type of dataset.
Keep_Items_from_Dataset(dataset, range)Keep_Items_from_Dataset(dataset, range)
dataset |
An instance of the |
range |
A vector of integers |
The dataset minus some items
Compute the likelihood of the null hypothesis for the global model
LH0(X, y1, y2)LH0(X, y1, y2)
X |
an n.pep*n.prot indicator matrix. |
y1 |
n.pep*n.samples matrice giving the observed counts for |
y2 |
n.pep*n.samples matrice giving the observed counts for |
A list of likelihoods
Thomas Burger, Laurent Jacob
NULLNULL
Compute the likelihoods of the null hypothesis for the "local" component-wise model
LH0_lm(X, y1, y2)LH0_lm(X, y1, y2)
X |
an n.pep*n.prot indicator matrix. |
y1 |
n.pep*n.samples matrice giving the observed counts for each peptide in each sample from the condition 1 |
y2 |
n.pep*n.samples matrice giving the observed counts for each peptide in each sample from the condition 2 |
A list of likelihoods with associated linear models
Thomas Burger, Laurent Jacob
NULLNULL
Compute the likelihood of the alternative hypothesis for the global model
LH1(X, y1, y2, j)LH1(X, y1, y2, j)
X |
an n.pep*n.prot indicator matrix. |
y1 |
n.pep*n.samples matrice giving the observed counts for |
y2 |
n.pep*n.samples matrice giving the observed counts for |
j |
the index of the protein being tested, ie which has different |
A list of likelihoods
Thomas Burger, Laurent Jacob
NULLNULL
Compute the likelihoods of the alternative hypothesis for the "local" component-wise model
LH1_lm(X, y1, y2, j)LH1_lm(X, y1, y2, j)
X |
an n.pep*n.prot indicator matrix. |
y1 |
n.pep*n.samples matrix giving the observed counts for |
y2 |
n.pep*n.samples matrix giving the observed counts for |
j |
the index of the protein being tested, ie which has different |
A list of likelihoods with associated linear models
Thomas Burger, Laurent Jacob
NULLNULL
Computes a hierarchical differential analysis
limmaCompleteTest(qData, sTab, comp.type = "OnevsOne")limmaCompleteTest(qData, sTab, comp.type = "OnevsOne")
qData |
A matrix of quantitative data, without any missing values. |
sTab |
A dataframe of experimental design (design_qf()). |
comp.type |
A string that corresponds to the type of comparison. Values are: 'anova1way', 'OnevsOne' and 'OnevsAll'; default is 'OnevsOne'. |
A list of two dataframes : logFC and P_Value. The first one contains the logFC values of all the comparisons (one column for one comparison), the second one contains the pvalue of all the comparisons (one column for one comparison). The names of the columns for those two dataframes are identical and correspond to the description of the comparison.
Hélène Borges, Thomas Burger, Quentin Giai-Gianetto, Samuel Wieczorek
data(subR25pept) qData <- as.matrix(SummarizedExperiment::assay(subR25pept[[1]])) sTab <- SummarizedExperiment::colData(subR25pept) limma <- limmaCompleteTest(qData, sTab, comp.type = "anova1way")data(subR25pept) qData <- as.matrix(SummarizedExperiment::assay(subR25pept[[1]])) sTab <- SummarizedExperiment::colData(subR25pept) limma <- limmaCompleteTest(qData, sTab, comp.type = "anova1way")
Builds the contrast matrix
makeContrast(design, condition, contrast = 1, design.level = 1)makeContrast(design, condition, contrast = 1, design.level = 1)
design |
The data.frame which correspond to the |
condition |
A |
contrast |
An integer that Indicates if the test consists of the comparison of each biological condition versus each of the other ones (Contrast=1; for example H0:"C1=C2" vs H1:"C1!=C2", etc.) or each condition versus all others (Contrast=2; e.g. H0:"C1=(C2+C3)/2" vs H1:"C1!=(C2+C3)/2", etc. if there are three conditions). |
design.level |
An |
A contrast matrix
Thomas Burger, Quentin Giai-Gianetto, Samuel Wieczorek
data(subR25pept) design <- makeDesign(SummarizedExperiment::colData(subR25pept)) conds <- design_qf(subR25pept)$Condition makeContrast(design, conds)data(subR25pept) design <- makeDesign(SummarizedExperiment::colData(subR25pept)) conds <- design_qf(subR25pept)$Condition makeContrast(design, conds)
Builds the design matrix
makeDesign(sTab)makeDesign(sTab)
sTab |
The data.frame which correspond to the |
A design matrix
Thomas Burger, Quentin Giai-Gianetto, Samuel Wieczorek
data(subR25pept) makeDesign(SummarizedExperiment::colData(subR25pept))data(subR25pept) makeDesign(SummarizedExperiment::colData(subR25pept))
Builds the design matrix for designs of level 1
makeDesign1(sTab)makeDesign1(sTab)
sTab |
The data.frame which correspond to the |
A design matrix
Thomas Burger, Quentin Giai-Gianetto, Samuel Wieczorek
data(subR25pept) makeDesign1(SummarizedExperiment::colData(subR25pept))data(subR25pept) makeDesign1(SummarizedExperiment::colData(subR25pept))
Builds the design matrix for designs of level 2
makeDesign2(sTab)makeDesign2(sTab)
sTab |
The data.frame which correspond to the |
A design matrix
Thomas Burger, Quentin Giai-Gianetto, Samuel Wieczorek
data(subR25pept) makeDesign2(SummarizedExperiment::colData(subR25pept))data(subR25pept) makeDesign2(SummarizedExperiment::colData(subR25pept))
Builds the design matrix for designs of level 3
makeDesign3(sTab)makeDesign3(sTab)
sTab |
The data.frame which correspond to the |
A design matrix
Thomas Burger, Quentin Giai-Gianetto, Samuel Wieczorek
data(subR25pept) sTab <- cbind(SummarizedExperiment::colData(subR25pept), Tech.Rep = seq_len(6)) makeDesign3(sTab)data(subR25pept) sTab <- cbind(SummarizedExperiment::colData(subR25pept), Tech.Rep = seq_len(6)) makeDesign3(sTab)
is.na() but focused on the equality
with the paramter 'type'.Similar to the function is.na() but focused on the equality
with the paramter 'type'.
matchMetacell(metadata, pattern = NULL, level)matchMetacell(metadata, pattern = NULL, level)
metadata |
A data.frame |
pattern |
The value to search in the dataframe |
level |
A string designing the type of entity/pipeline.
Available values are: |
A boolean dataframe
Samuel Wieczorek
data(subR25pept) metadata <- qMetacell(subR25pept[[1]]) m <- matchMetacell(metadata, pattern = "Missing", level = "peptide") m <- matchMetacell(metadata, pattern = 'Missing POV', level = "peptide") m <- matchMetacell(metadata, pattern = c('Missing', 'Missing POV'), level = "peptide")data(subR25pept) metadata <- qMetacell(subR25pept[[1]]) m <- matchMetacell(metadata, pattern = "Missing", level = "peptide") m <- matchMetacell(metadata, pattern = 'Missing POV', level = "peptide") m <- matchMetacell(metadata, pattern = c('Missing', 'Missing POV'), level = "peptide")
Actually, this function uses the generic function to generate metacell info
Metacell_DIA_NN(qdata, conds, df, level = NULL)Metacell_DIA_NN(qdata, conds, df, level = NULL)
qdata |
An object of class |
conds |
A 1-col dataframe with the condition associated to each sample. |
df |
A dataframe with the same dimension as qdata containing the metacell. |
level |
A string designing the type of entity/pipeline.
Available values are: |
NA
Samuel Wieczorek
data(subR25pept) conds <- design_qf(subR25pept)$Condition qdata <- SummarizedExperiment::assay(subR25pept[[1]]) df <- Metacell_DIA_NN(qdata, conds, df, level = "peptide")data(subR25pept) conds <- design_qf(subR25pept)$Condition qdata <- SummarizedExperiment::assay(subR25pept[[1]]) df <- Metacell_DIA_NN(qdata, conds, df, level = "peptide")
Initial conversion rules for maxquant |————|———————–|——–| | Quanti | Identification | Tag | |————|———————–|——–| | == 0 | whatever | 2.0 | | > 0 | 'By MS/MS' | 1.1 | | > 0 | 'By matching' | 1.2 | | > 0 | unknown col | 1.0 | |————|———————–|——–|
Metacell_maxquant(qdata, conds, df = NULL, level = NULL)Metacell_maxquant(qdata, conds, df = NULL, level = NULL)
qdata |
An object of class |
conds |
A 1-col dataframe with the condition associated to each sample. |
df |
A dataframe with the same dimension as qdata containing the metacell. |
level |
A string designing the type of entity/pipeline.
Available values are: |
NA
Samuel Wieczorek
data(subR25pept) conds <- design_qf(subR25pept)$Condition qdata <- SummarizedExperiment::assay(subR25pept[[1]]) df2 <- Metacell_maxquant(qdata, conds, level = "peptide")data(subR25pept) conds <- design_qf(subR25pept)$Condition qdata <- SummarizedExperiment::assay(subR25pept[[1]]) df2 <- Metacell_maxquant(qdata, conds, level = "peptide")
In the quantitative columns, a missing value is identified by no value rather than a value equal to 0.
In these datasets, the metacell info is computed from the 'PSM count' columns.
Conversion rules Initial conversion rules for proline |————–|—————–|—–| | Quanti | PSM count | Tag | |————–|—————–|—–| | == 0 | N.A. | whatever | 2.0 | | > 0 | > 0 | 1.1 | | > 0 | == 0 | 1.2 | | > 0 | unknown col | 1.0 | |————–|—————–|—–|
Metacell_proline(qdata, conds, df = NULL, level = NULL)Metacell_proline(qdata, conds, df = NULL, level = NULL)
qdata |
An object of class |
conds |
A 1-col dataframe with the condition associated to each sample. |
df |
A dataframe with the same dimension as qdata containing the metacell. |
level |
A string designing the type of entity/pipeline.
Available values are: |
NA
Samuel Wieczorek
data(subR25pept) conds <- design_qf(subR25pept)$Condition qdata <- SummarizedExperiment::assay(subR25pept[[1]]) df <- Metacell_proline(qdata, conds, level = "peptide")data(subR25pept) conds <- design_qf(subR25pept)$Condition qdata <- SummarizedExperiment::assay(subR25pept[[1]]) df <- Metacell_proline(qdata, conds, level = "peptide")
This method plots a bar plot which represents the distribution of the number of missing values (NA) per lines (ie proteins).
Plots a heatmap of the quantitative data. Each column represent one of
the conditions in the object of class obj and
the color is proportional to the mean of intensity for each line of
the dataset.
The lines have been sorted in order to vizualize easily the different
number of missing values. A white square is plotted for missing values.
#' Plots a heatmap of the quantitative data. Each column represent one of
the conditions in the object of class MsnSet and
the color is proportional to the mean of intensity for each line of
the dataset.
The lines have been sorted in order to vizualize easily the different
number of missing values. A white square is plotted for missing values.
This method shows density plots which represents the repartition of
Partial Observed Values for each replicate in the dataset.
The colors correspond to the different conditions (slot Condition in in the
dataset of class MsnSet).
The x-axis represent the mean of intensity for one condition and one
entity in the dataset (i. e. a protein)
whereas the y-axis count the number of observed values for this entity
and the considered condition.
metacellPerLinesHisto_HC( obj, group, pattern = NULL, detailed = FALSE, indLegend = "auto", showValues = FALSE ) metacellPerLinesHistoPerCondition_HC( obj, group, pattern = NULL, indLegend = "auto", showValues = FALSE, pal = NULL ) metacellHisto_HC( obj, group = NULL, pattern = NULL, indLegend = "auto", showValues = FALSE, pal = NULL ) wrapperMVImage(obj, group = NULL, pattern = "Missing MEC") mvImage(obj, group) hc_mvTypePlot2(obj, group, pal = NULL, pattern, title = NULL)metacellPerLinesHisto_HC( obj, group, pattern = NULL, detailed = FALSE, indLegend = "auto", showValues = FALSE ) metacellPerLinesHistoPerCondition_HC( obj, group, pattern = NULL, indLegend = "auto", showValues = FALSE, pal = NULL ) metacellHisto_HC( obj, group = NULL, pattern = NULL, indLegend = "auto", showValues = FALSE, pal = NULL ) wrapperMVImage(obj, group = NULL, pattern = "Missing MEC") mvImage(obj, group) hc_mvTypePlot2(obj, group, pal = NULL, pattern, title = NULL)
obj |
An instance of the class |
group |
A vector |
pattern |
A |
detailed |
'value' or 'percent' |
indLegend |
A |
showValues |
A logical that indicates whether numeric values should be drawn above the bars. |
pal |
The different colors for conditions |
title |
The title of the plot |
A bar plot
A heatmap
A heatmap
Density plots
Florence Combes, Samuel Wieczorek
Samuel Wieczorek, Alexia Dorffer
Samuel Wieczorek, Thomas Burger
Samuel Wieczorek
data(subR25prot) grp <- design_qf(subR25prot)$Condition metacellPerLinesHisto_HC(subR25prot[[1]], group = grp, pattern = "Missing POV") metacellPerLinesHisto_HC(subR25prot[[1]]) metacellPerLinesHisto_HC(subR25prot[[1]], group = grp, pattern = "Quantified") metacellPerLinesHisto_HC(subR25prot[[1]], group = grp, pattern = "Quant. by direct id") metacellPerLinesHisto_HC(subR25prot[[1]], group = grp, pattern = "Quant. by recovery") pattern <- c("Quantified", "Quant. by direct id", "Quant. by recovery") metacellPerLinesHisto_HC(subR25prot[[1]], group = grp, pattern = pattern) metacellPerLinesHistoPerCondition_HC(subR25prot[[1]], group = grp, pattern = "Missing POV") metacellPerLinesHistoPerCondition_HC(subR25prot[[1]]) metacellPerLinesHistoPerCondition_HC(subR25prot[[1]], group = grp, pattern = "Quantified") metacellPerLinesHistoPerCondition_HC(subR25prot[[1]], group = grp, pattern = "Quant. by direct id") metacellPerLinesHistoPerCondition_HC(subR25prot[[1]], group = grp, pattern = "Quant. by recovery") pattern <- c("Quantified", "Quant. by direct id", "Quant. by recovery") metacellPerLinesHistoPerCondition_HC(subR25prot[[1]], group = grp, pattern = pattern) metacellHisto_HC(subR25prot[[1]], group = grp, pattern = "Missing POV") metacellHisto_HC(subR25prot[[1]]) metacellHisto_HC(subR25prot[[1]], group = grp, pattern = "Quantified") metacellHisto_HC(subR25prot[[1]], group = grp, pattern = "Quant. by direct id") metacellHisto_HC(subR25prot[[1]], group = grp, pattern = "Quant. by recovery") pattern <- c("Quantified", "Quant. by direct id", "Quant. by recovery") metacellHisto_HC(subR25prot[[1]], group = grp, pattern = pattern) data(subR25pept) pattern <- "Missing POV" pal <- ExtendPalette(2, "Dark2") metacellHisto_HC(subR25pept[[1]], pattern, showValues = TRUE, pal = pal) data(subR25pept) mvImage(subR25pept[[1]], design_qf(subR25pept)$Condition) data(subR25pept) pal <- ExtendPalette(length(unique(design_qf(subR25pept)$Condition)), "Dark2") pattern <- "Missing MEC" hc_mvTypePlot2(subR25pept[[1]], group = design_qf(subR25pept)$Condition, pattern = pattern, pal = pal)data(subR25prot) grp <- design_qf(subR25prot)$Condition metacellPerLinesHisto_HC(subR25prot[[1]], group = grp, pattern = "Missing POV") metacellPerLinesHisto_HC(subR25prot[[1]]) metacellPerLinesHisto_HC(subR25prot[[1]], group = grp, pattern = "Quantified") metacellPerLinesHisto_HC(subR25prot[[1]], group = grp, pattern = "Quant. by direct id") metacellPerLinesHisto_HC(subR25prot[[1]], group = grp, pattern = "Quant. by recovery") pattern <- c("Quantified", "Quant. by direct id", "Quant. by recovery") metacellPerLinesHisto_HC(subR25prot[[1]], group = grp, pattern = pattern) metacellPerLinesHistoPerCondition_HC(subR25prot[[1]], group = grp, pattern = "Missing POV") metacellPerLinesHistoPerCondition_HC(subR25prot[[1]]) metacellPerLinesHistoPerCondition_HC(subR25prot[[1]], group = grp, pattern = "Quantified") metacellPerLinesHistoPerCondition_HC(subR25prot[[1]], group = grp, pattern = "Quant. by direct id") metacellPerLinesHistoPerCondition_HC(subR25prot[[1]], group = grp, pattern = "Quant. by recovery") pattern <- c("Quantified", "Quant. by direct id", "Quant. by recovery") metacellPerLinesHistoPerCondition_HC(subR25prot[[1]], group = grp, pattern = pattern) metacellHisto_HC(subR25prot[[1]], group = grp, pattern = "Missing POV") metacellHisto_HC(subR25prot[[1]]) metacellHisto_HC(subR25prot[[1]], group = grp, pattern = "Quantified") metacellHisto_HC(subR25prot[[1]], group = grp, pattern = "Quant. by direct id") metacellHisto_HC(subR25prot[[1]], group = grp, pattern = "Quant. by recovery") pattern <- c("Quantified", "Quant. by direct id", "Quant. by recovery") metacellHisto_HC(subR25prot[[1]], group = grp, pattern = pattern) data(subR25pept) pattern <- "Missing POV" pal <- ExtendPalette(2, "Dark2") metacellHisto_HC(subR25pept[[1]], pattern, showValues = TRUE, pal = pal) data(subR25pept) mvImage(subR25pept[[1]], design_qf(subR25pept)$Condition) data(subR25pept) pal <- ExtendPalette(length(unique(design_qf(subR25pept)$Condition)), "Dark2") pattern <- "Missing MEC" hc_mvTypePlot2(subR25pept[[1]], group = design_qf(subR25pept)$Condition, pattern = pattern, pal = pal)
Lists the metacell scopes for filtering
MetacellFilteringScope()MetacellFilteringScope()
A vector of character()
MetacellFilteringScope()MetacellFilteringScope()
Methods available are:
wrapperImputeDetQuant():
This method is a wrapper of the function impute.detQuant() for objects
of class MSnSet
wrapperImputeKNN(): Can impute only POV missing values. This method is
a wrapper for objects of class QFeatures and imputes missing values with
a fixed value. This function imputes the missing values condition by
condition.
wrapperImputeSLSA():
Imputation of peptides having no values in a biological condition. This
method is a wrapper to the function impute.slsa() of the package
imp4p adapted to an object of class MSnSet.
wrapperImputeFixedValue():
This method is a wrapper to objects of class MSnSet and imputes
missing values with a fixed value.
wrapperImputePA():
Imputation of peptides having no values in a biological condition.
This method is a wrapper to the function impute.pa of the package
imp4p adapted to an object of class MSnSet.
findMECBlock(obj, grp) reIntroduceMEC(obj, grp, MECIndex) wrapperImputeKNN(obj = NULL, grp, K) wrapperImputeFixedValue(obj, grp, fixVal = 0, na.type) wrapperImputePA(obj = NULL, grp, q.min = 0.025) wrapperImputeDetQuant(obj, qval = 0.025, factor = 1, na.type) getQuantile4Imp(qdata, qval = 0.025, factor = 1) wrapperImputeSLSA(obj = NULL, design = NULL)findMECBlock(obj, grp) reIntroduceMEC(obj, grp, MECIndex) wrapperImputeKNN(obj = NULL, grp, K) wrapperImputeFixedValue(obj, grp, fixVal = 0, na.type) wrapperImputePA(obj = NULL, grp, q.min = 0.025) wrapperImputeDetQuant(obj, qval = 0.025, factor = 1, na.type) getQuantile4Imp(qdata, qval = 0.025, factor = 1) wrapperImputeSLSA(obj = NULL, design = NULL)
obj |
An object of class |
grp |
A |
MECIndex |
A data.frame that contains index of MEC (see findMECBlock) |
K |
the number of neighbors. |
fixVal |
A float. |
na.type |
A string which indicates the type of missing values to impute.
Available values are: |
q.min |
Same as the function |
qval |
An expression set containing quantitative values of various replicates |
factor |
A scaling factor to multiply the imputation value with |
qdata |
A |
design |
A |
A data.frame containing the indexes of LAPALA
A list of two vectors, respectively containing the imputation values and the rescaled imputation values
findMECBlock()
reIntroduceMEC()
getQuantile4Imp(): Quantile imputation value definition. This method returns the q-th quantile of each column of an expression set, up to a s calling factor
Samuel Wieczorek
data(subR25prot) obj <- subR25prot[[1]] grp <- design_qf(subR25prot)$Condition lapala <- findMECBlock(obj, grp) na.type = c("Missing POV", "Missing MEC") obj.imp.pov <- wrapperImputeDetQuant(obj, na.type = na.type) obj.imp.pov <- reIntroduceMEC(obj, grp, lapala) obj.imp.pov <- wrapperImputeKNN(obj, grp, 3) obj.imp.pov <- wrapperImputeFixedValue(obj, grp, 0.001, na.type = "Missing POV") obj.imp.mec <- wrapperImputeFixedValue(obj, grp, 0.001, na.type = "Missing MEC") obj.imp.na <- wrapperImputeFixedValue( obj, grp, 0.001, na.type = c("Missing MEC", "Missing POV")) obj.imp.pov <- wrapperImputePA(obj, grp) qdata <- SummarizedExperiment::assay(obj) quant <- getQuantile4Imp(qdata)data(subR25prot) obj <- subR25prot[[1]] grp <- design_qf(subR25prot)$Condition lapala <- findMECBlock(obj, grp) na.type = c("Missing POV", "Missing MEC") obj.imp.pov <- wrapperImputeDetQuant(obj, na.type = na.type) obj.imp.pov <- reIntroduceMEC(obj, grp, lapala) obj.imp.pov <- wrapperImputeKNN(obj, grp, 3) obj.imp.pov <- wrapperImputeFixedValue(obj, grp, 0.001, na.type = "Missing POV") obj.imp.mec <- wrapperImputeFixedValue(obj, grp, 0.001, na.type = "Missing MEC") obj.imp.na <- wrapperImputeFixedValue( obj, grp, 0.001, na.type = c("Missing MEC", "Missing POV")) obj.imp.pov <- wrapperImputePA(obj, grp) qdata <- SummarizedExperiment::assay(obj) quant <- getQuantile4Imp(qdata)
Set NA values to 0
NAIsZero(obj, i)NAIsZero(obj, i)
obj |
An instance of QFeatures class |
i |
An integer which is the index of the assay in the QFeatures object |
An instance of QFeatures class
This function counts the number of empty lines (all elements are equal to NA).
nEmptyLines(df)nEmptyLines(df)
df |
A |
A integer(1)
Samuel Wieczorek
library(QFeatures) data(subR25prot) nEmptyLines(SummarizedExperiment::assay(subR25prot, 1))library(QFeatures) data(subR25prot) nEmptyLines(SummarizedExperiment::assay(subR25prot, 1))
This function retrieves the indices of non-zero elements in sparse matrices
of class dgCMatrix from package Matrix. This function is largely inspired
from the package RINGO.
nonzero(x)nonzero(x)
x |
A sparse matrix of class dgCMatrix |
A two-column matrix
Samuel Wieczorek
library(Matrix) mat <- Matrix(c(0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1), nrow = 5, byrow = TRUE, sparse = TRUE) res <- nonzero(mat)library(Matrix) mat <- Matrix(c(0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 1), nrow = 5, byrow = TRUE, sparse = TRUE) res <- nonzero(mat)
Provides several methods to normalize quantitative data from
a SummarizedExperiment object.
They are organized in six main families : GlobalQuantileAlignement,
sumByColumns, QuantileCentering, MeanCentering, LOESS, vsn
For the first family, there is no type.
For the five other families, two type categories are available :
"Overall" which means that the value for each protein
(ie line in the expression data tab) is computed over all the samples ;
"within conditions" which means that the value for each protein
(ie line in the SummarizedExperiment::assay() data tab) is computed condition
by condition.
normalizeMethods(target = "all") GlobalQuantileAlignment(qData) SumByColumns(qData, conds = NULL, type = NULL, subset.norm = NULL) QuantileCentering( qData, conds = NULL, type = "overall", subset.norm = NULL, quantile = 0.15 ) MeanCentering( qData, conds, type = "overall", subset.norm = NULL, scaling = FALSE ) vsn(qData, conds, type = NULL) LOESS(qData, conds, type = "overall", span = 0.7)normalizeMethods(target = "all") GlobalQuantileAlignment(qData) SumByColumns(qData, conds = NULL, type = NULL, subset.norm = NULL) QuantileCentering( qData, conds = NULL, type = "overall", subset.norm = NULL, quantile = 0.15 ) MeanCentering( qData, conds, type = "overall", subset.norm = NULL, scaling = FALSE ) vsn(qData, conds, type = NULL) LOESS(qData, conds, type = "overall", span = 0.7)
target |
Category of normalization method to show. Either "all", "withTracking" or "withoutTracking". |
qData |
A data.frame with quantitative data to normalize. |
conds |
A |
type |
"overall" (shift all the sample distributions at once) or "within conditions" (shift the sample distributions within each condition at a time). |
subset.norm |
A vector of index indicating rows to be used for normalization. |
quantile |
A float that corresponds to the quantile used to align the data. |
scaling |
A boolean that indicates if the variance of the data have to be forced to unit (variance reduction) or not. |
span |
A float between 0 and 1 indicating the span of loess smoothing window. |
A vector of character()
A normalized numeric matrix
A normalized numeric matrix
A normalized numeric matrix
A normalized numeric matrix
A normalized numeric matrix
A normalized numeric matrix
Samuel Wieczorek, Thomas Burger, Helene Borges, Anais Courtier, Enora Fremy
## Get the list of methods normalizeMethods() data(subR25pept) qData <- SummarizedExperiment::assay(subR25pept[[1]]) conds <- design_qf(subR25pept)$Condition #normalized <- GlobalQuantileAlignment(qData) normalized <- SumByColumns(qData, conds, type = "within conditions", subset.norm = seq_len(10) ) normalized <- QuantileCentering( SummarizedExperiment::assay(subR25pept), conds, type = "within conditions", subset.norm = seq_len(10) ) normalized <- MeanCentering(qData, conds, type = "overall") normalized <- LOESS(qData, conds, type = "overall")## Get the list of methods normalizeMethods() data(subR25pept) qData <- SummarizedExperiment::assay(subR25pept[[1]]) conds <- design_qf(subR25pept)$Condition #normalized <- GlobalQuantileAlignment(qData) normalized <- SumByColumns(qData, conds, type = "within conditions", subset.norm = seq_len(10) ) normalized <- QuantileCentering( SummarizedExperiment::assay(subR25pept), conds, type = "within conditions", subset.norm = seq_len(10) ) normalized <- MeanCentering(qData, conds, type = "overall") normalized <- LOESS(qData, conds, type = "overall")
This method is a wrapper that provides several methods to normalize quantitative
data from objects of class QFeatures or SummarizedExperiment.
They are organized in six main families : GlobalQuantileAlignement,
sumByColumns, QuantileCentering, MeanCentering, LOESS, vsn
For the first family, there is no type.
For the five other families, two type categories are available :
"Overall" which means that the value for each protein
(ie line in the expression data tab) is computed over all the samples ;
"within conditions" which means that the value for each protein
(ie line in the SummarizedExperiment::assay() data tab) is computed condition
by condition.
The available methods are described in normalizeMethods().
normalizeFunction( obj, method, conditions = NULL, type = "overall", subset.norm = NULL, quantile = 0.15, scaling = FALSE, span = 0.7 )normalizeFunction( obj, method, conditions = NULL, type = "overall", subset.norm = NULL, quantile = 0.15, scaling = FALSE, span = 0.7 )
obj |
An object of class |
method |
Define the normalization method used : |
conditions |
A vector of conditions in the dataset.
If not provided, the vector |
type |
"overall" (shift all the sample distributions at once) or "within conditions" (shift the sample distributions within each condition at a time). |
subset.norm |
A vector of index indicating rows to be used for normalization |
quantile |
A float that corresponds to the quantile used to align the data. |
scaling |
A boolean that indicates if the variance of the data have to be forced to unit (variance reduction) or not. |
span |
A floating number |
QFeatures including a new assay with normalized data or
SummarizedExperiment with normalized data.
Manon Gaudin
data(subR25pept) normalized <- normalizeFunction(subR25pept, method = 'GlobalQuantileAlignment')data(subR25pept) normalized <- normalizeFunction(subR25pept, method = 'GlobalQuantileAlignment')
This function exports a MSnSet data object to a Excel file.
Each of the three data.frames in the MSnSet object (ie experimental
data, phenoData and metaData are respectively integrated into separate sheets
in the Excel file).
The colored cells in the experimental data correspond to the original missing values which have been imputed.
readExcel(file, sheet = NULL) listSheets(file) write_Assay_To_Excel(wb, obj, i, n) WriteHistory(wb, obj, n) Write_SamplesData_to_Excel(wb, obj, n) Write_RowData(wb, obj, i, n) writeExcel(obj, filename)readExcel(file, sheet = NULL) listSheets(file) write_Assay_To_Excel(wb, obj, i, n) WriteHistory(wb, obj, n) Write_SamplesData_to_Excel(wb, obj, n) Write_RowData(wb, obj, i, n) writeExcel(obj, filename)
file |
The name of the Excel file. |
sheet |
The worksheet to write to. Can be the worksheet index or name. |
wb |
A Workbook object containing a worksheet. |
obj |
An instance of the class |
i |
An integer which is the index of the assay in the QFeatures object |
n |
The total number of sheets |
filename |
A character string for the name of the Excel file. |
A Excel file (.xlsx)
Samuel Wieczorek
library(QFeatures) data(subR25prot) df <- SummarizedExperiment::assay(subR25prot[[1]]) tags <- qMetacell(subR25prot[[1]]) colors <- list( "Missing POV" = "lightblue", "Missing MEC" = "orange", "Quant. by recovery" = "lightgrey", "Quant. by direct id" = "white", "Combined tags" = "red" ) file <- tempfile('toto.xlsx') writeExcel(subR25prot, filename = file) unlink(file) data(subR25pept) file <- tempfile('foo.xlsx') writeExcel(subR25pept, file) unlink(file)library(QFeatures) data(subR25prot) df <- SummarizedExperiment::assay(subR25prot[[1]]) tags <- qMetacell(subR25prot[[1]]) colors <- list( "Missing POV" = "lightblue", "Missing MEC" = "orange", "Quant. by recovery" = "lightgrey", "Quant. by direct id" = "white", "Combined tags" = "red" ) file <- tempfile('toto.xlsx') writeExcel(subR25prot, filename = file) unlink(file) data(subR25pept) file <- tempfile('foo.xlsx') writeExcel(subR25pept, file) unlink(file)
Applies aov() on a vector of protein abundances using the design derived from the sample names (simple aov wrapper)
OWAnova(current_protein, conditions)OWAnova(current_protein, conditions)
current_protein |
a real vector |
conditions |
the list of groups the protein belongs to |
See aov()
Thomas Burger
protein_abundance <- rep(rnorm(3, mean= 18, sd=2), each=3) + rnorm(9) groups <- c(rep("group1",3),rep("group2",3),rep("group3",3)) OWAnova(protein_abundance,groups)protein_abundance <- rep(rnorm(3, mean= 18, sd=2), each=3) + rnorm(9) groups <- c(rep("group1",3),rep("group2",3),rep("group3",3)) OWAnova(protein_abundance,groups)
This function gives the list of metacell tags available.
onlyPresent: In this case, the function gives the tags found in a dataset. In addition, and w.r.t to the hierarchy of tags, if all leaves of a node are present, then the tag corresponding to this node is added.
These names are common to all assays contained in the object. This is why they are stored in the global metadata. This function is used whenever it i s necessary to (re)detect MEC and POV (new dataset or when post processing protein qMetacell after aggregation)
paramshistory(object, ...) ## S4 method for signature 'QFeatures' paramshistory(object, i, slotName = "paramshistory") ## S4 method for signature 'SummarizedExperiment' paramshistory(object, slotName = "paramshistory") paramshistory(object, i, slotName = "paramshistory") <- value GetMetacellTags(object, ...) ## S4 method for signature 'QFeatures' GetMetacellTags(object, i, ...) ## S4 method for signature 'SummarizedExperiment' GetMetacellTags(object, ...) ## S4 method for signature 'data.frame' GetMetacellTags(object, ...) qMetacell(object, ...) ## S4 method for signature 'QFeatures' qMetacell(object, i) ## S4 method for signature 'SummarizedExperiment' qMetacell(object) qMetacell(object, i, slotName = "qMetacell") <- value GetUniqueTags(object, ...) ## S4 method for signature 'QFeatures' GetUniqueTags(object, i) ## S4 method for signature 'SummarizedExperiment' GetUniqueTags(object) GetMetadataSlot(object, slotName = NULL) GetRowdataSlot(object, slotName = NULL) ConnectedComp(object, ...) ## S4 method for signature 'QFeatures' ConnectedComp(object, i, slotName = "ConnectedComp") ## S4 method for signature 'SummarizedExperiment' ConnectedComp(object, slotName = "ConnectedComp") ConnectedComp(object, i, slotName = "ConnectedComp") <- value typeDataset(object, ...) ## S4 method for signature 'QFeatures' typeDataset(object, i, slotName = "typeDataset") ## S4 method for signature 'SummarizedExperiment' typeDataset(object, slotName = "typeDataset") typeDataset(object, i, slotName = "typeDataset") <- value idcol(object, ...) ## S4 method for signature 'QFeatures' idcol(object, i, slotName = "idcol") ## S4 method for signature 'SummarizedExperiment' idcol(object, slotName = "idcol") idcol(object, i, slotName = "idcol") <- value parentProtId(object, ...) ## S4 method for signature 'QFeatures' parentProtId(object, i, slotName = "parentProtId") ## S4 method for signature 'SummarizedExperiment' parentProtId(object, slotName = "parentProtId") parentProtId(object, i, slotName = "parentProtId") <- value filename(object, ...) ## S4 method for signature 'QFeatures' filename(object, slotName = "filename") filename(object, slotName = "filename") <- value analysis(object, ...) ## S4 method for signature 'QFeatures' analysis(object, i, slotName = "analysis") ## S4 method for signature 'SummarizedExperiment' analysis(object, slotName = "analysis") analysis(object, i, slotName = "analysis") <- value version(object, ...) ## S4 method for signature 'QFeatures' version(object, slotName = "version") version(object, slotName = "version") <- value design_qf(object, ...) ## S4 method for signature 'QFeatures' design_qf(object, slotName = "design") design_qf(object, slotName = "design") <- value mainAssay(object) HypothesisTest(object, ...) ## S4 method for signature 'QFeatures' HypothesisTest(object, i, slotName = "HypothesisTest") ## S4 method for signature 'SummarizedExperiment' HypothesisTest(object, slotName = "HypothesisTest") HypothesisTest(object, i) <- value DifferentialAnalysis(object, ...) ## S4 method for signature 'QFeatures' DifferentialAnalysis(object, i, slotName = "DifferentialAnalysis") ## S4 method for signature 'SummarizedExperiment' DifferentialAnalysis(object, slotName = "DifferentialAnalysis") DifferentialAnalysis(object, i) <- value names_metacell(object, ...) ## S4 method for signature 'QFeatures' names_metacell(object, i, slotName = "names_metacell") ## S4 method for signature 'SummarizedExperiment' names_metacell(object, slotName = "names_metacell") names_metacell(object, i, slotName = "names_metacell") <- valueparamshistory(object, ...) ## S4 method for signature 'QFeatures' paramshistory(object, i, slotName = "paramshistory") ## S4 method for signature 'SummarizedExperiment' paramshistory(object, slotName = "paramshistory") paramshistory(object, i, slotName = "paramshistory") <- value GetMetacellTags(object, ...) ## S4 method for signature 'QFeatures' GetMetacellTags(object, i, ...) ## S4 method for signature 'SummarizedExperiment' GetMetacellTags(object, ...) ## S4 method for signature 'data.frame' GetMetacellTags(object, ...) qMetacell(object, ...) ## S4 method for signature 'QFeatures' qMetacell(object, i) ## S4 method for signature 'SummarizedExperiment' qMetacell(object) qMetacell(object, i, slotName = "qMetacell") <- value GetUniqueTags(object, ...) ## S4 method for signature 'QFeatures' GetUniqueTags(object, i) ## S4 method for signature 'SummarizedExperiment' GetUniqueTags(object) GetMetadataSlot(object, slotName = NULL) GetRowdataSlot(object, slotName = NULL) ConnectedComp(object, ...) ## S4 method for signature 'QFeatures' ConnectedComp(object, i, slotName = "ConnectedComp") ## S4 method for signature 'SummarizedExperiment' ConnectedComp(object, slotName = "ConnectedComp") ConnectedComp(object, i, slotName = "ConnectedComp") <- value typeDataset(object, ...) ## S4 method for signature 'QFeatures' typeDataset(object, i, slotName = "typeDataset") ## S4 method for signature 'SummarizedExperiment' typeDataset(object, slotName = "typeDataset") typeDataset(object, i, slotName = "typeDataset") <- value idcol(object, ...) ## S4 method for signature 'QFeatures' idcol(object, i, slotName = "idcol") ## S4 method for signature 'SummarizedExperiment' idcol(object, slotName = "idcol") idcol(object, i, slotName = "idcol") <- value parentProtId(object, ...) ## S4 method for signature 'QFeatures' parentProtId(object, i, slotName = "parentProtId") ## S4 method for signature 'SummarizedExperiment' parentProtId(object, slotName = "parentProtId") parentProtId(object, i, slotName = "parentProtId") <- value filename(object, ...) ## S4 method for signature 'QFeatures' filename(object, slotName = "filename") filename(object, slotName = "filename") <- value analysis(object, ...) ## S4 method for signature 'QFeatures' analysis(object, i, slotName = "analysis") ## S4 method for signature 'SummarizedExperiment' analysis(object, slotName = "analysis") analysis(object, i, slotName = "analysis") <- value version(object, ...) ## S4 method for signature 'QFeatures' version(object, slotName = "version") version(object, slotName = "version") <- value design_qf(object, ...) ## S4 method for signature 'QFeatures' design_qf(object, slotName = "design") design_qf(object, slotName = "design") <- value mainAssay(object) HypothesisTest(object, ...) ## S4 method for signature 'QFeatures' HypothesisTest(object, i, slotName = "HypothesisTest") ## S4 method for signature 'SummarizedExperiment' HypothesisTest(object, slotName = "HypothesisTest") HypothesisTest(object, i) <- value DifferentialAnalysis(object, ...) ## S4 method for signature 'QFeatures' DifferentialAnalysis(object, i, slotName = "DifferentialAnalysis") ## S4 method for signature 'SummarizedExperiment' DifferentialAnalysis(object, slotName = "DifferentialAnalysis") DifferentialAnalysis(object, i) <- value names_metacell(object, ...) ## S4 method for signature 'QFeatures' names_metacell(object, i, slotName = "names_metacell") ## S4 method for signature 'SummarizedExperiment' names_metacell(object, slotName = "names_metacell") names_metacell(object, i, slotName = "names_metacell") <- value
object |
n instance of class |
... |
Additional parameters |
i |
The index or name of the assays to extract the quantitative
metadata from. All must have a rowdata variable named as |
slotName |
A character(0) which is the name of the slot in the metadata |
value |
The content of the slot in the metadata |
Additional slots for Metadata for a SummarizedExperiment object:
qMetacell: A data.frame()
parentProtId: A character()
idcol: A character()
typeDataset: A character()
A vector of tags.
NA
NA
NA
NA
NA
NA
NA
NA
Default slotName is "qMetacell".
The value is an adjacency matrix with row and column names. The
matrix will be coerced to compressed, column-oriented sparse
matrix (class dgCMatrix) as defined in the Matrix package,
as generaled by the Matrix::sparseMatrix() constructor.
Samuel Wieczorek
data(subR25pept) GetMetacellTags(subR25pept, 1, level="peptide") GetMetacellTags(subR25pept, 1, level="peptide", onlyPresent=TRUE) data(subR25pept) design_qf(subR25pept)data(subR25pept) GetMetacellTags(subR25pept, 1, level="peptide") GetMetacellTags(subR25pept, 1, level="peptide", onlyPresent=TRUE) data(subR25pept) design_qf(subR25pept)
Parent name of a node
Parent(level, node = NULL)Parent(level, node = NULL)
level |
A string designing the type of entity/pipeline.
Available values are: |
node |
A #' @examples Parent('protein', 'Missing') Parent('protein', 'Missing POV') Parent('protein', c('Missing POV', 'Missing MEC')) Parent('protein', c('Missing', 'Missing POV', 'Missing MEC')) |
NA
PEptide based Protein differential Abundance test
pepaTest(X, y, n1, n2, global = FALSE, use.lm = FALSE)pepaTest(X, y, n1, n2, global = FALSE, use.lm = FALSE)
X |
Binary q x p design matrix for q peptides and p proteins. X_(ij)=1 if peptide i belongs to protein j, 0 otherwise. |
y |
q x n matrix representing the log intensities of q peptides among n MS samples. |
n1 |
number of samples under condition 1. It is assumed that the first n1 columns of y correspond to observations under condition 1. |
n2 |
number of samples under condition 2. |
global |
if TRUE, the test statistic for each protein uses all residues, including the ones for peptides in different connected components. Can be much faster as it does not require to compute connected components. However the p-values are not well calibrated in this case, as it amounts to adding a ridge to the test statistic. Calibrating the p-value would require knowing the amplitude of the ridge, which in turns would require computing the connected components. |
use.lm |
if TRUE (and if global=FALSE), use lm() rather than the result in Proposition 1 to compute the test statistic |
A list of the following elements: llr: log likelihood ratio statistic (maximum likelihood version). llr.map: log likelihood ratio statistic (maximum a posteriori version). llr.pv: p-value for llr. llr.map.pv: p-value for llr.map. mse.h0: Mean squared error under H0 mse.h1: Mean squared error under H1 s: selected regularization hyperparameter for llr.map. wchi2: weight used to make llr.map chi2-distributed under H0.
Thomas Burger, Laurent Jacob
NANA
Get the list of pipelines available in the package
Pipelines()Pipelines()
NA
Checks if a package is available to load it
pkgsRequire(ll.deps)pkgsRequire(ll.deps)
ll.deps |
A |
NA
Samuel Wieczorek
NULLNULL
This plot compares the quantitative proteomics data between two assays. It can be used for example to compare the effect of the normalization process.
The comparison is made with the division operator.
plotCompareAssays( obj, i, j, info = NULL, pal.name = "Set1", subset.view = NULL, n = 100, type = "scatter" )plotCompareAssays( obj, i, j, info = NULL, pal.name = "Set1", subset.view = NULL, n = 100, type = "scatter" )
obj |
An instance of the class |
i |
A numeric matrix containing quantitative data after normalization. |
j |
A numeric matrix containing quantitative data after normalization |
info |
A vector |
pal.name |
The name of the palette to use. Default is 'Set1' |
subset.view |
A |
n |
The number of points to display |
type |
The type of plot. Available values are 'scatter' (default) or 'line' |
A plot
Samuel Wieczorek, Enora Fremy
data(subR25prot) obj <- subR25prot obj <- normalizeFunction(obj, method = "MeanCentering") plotCompareAssays(obj, 1, 2, n = 5)data(subR25prot) obj <- subR25prot obj <- normalizeFunction(obj, method = "MeanCentering") plotCompareAssays(obj, 1, 2, n = 5)
Jitter plot of CC
plotJitter(list.of.cc = NULL)plotJitter(list.of.cc = NULL)
list.of.cc |
List of cc such as returned by the function getPepProtCC |
A plot
Thomas Burger
data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) ll <- getPepProtCC(X) plotJitter(ll)data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) ll <- getPepProtCC(X) plotJitter(ll)
Display a a jitter plot for CC
plotJitter_rCharts(df)plotJitter_rCharts(df)
df |
A |
A plot
Thomas Burger, Samuel Wieczorek
data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) ll <- getPepProtCC(X)[seq_len(4)] n.prot <- unlist(lapply(ll, function(x) {length(x$proteins)})) n.pept <- unlist(lapply(ll, function(x) {length(x$peptides)})) df <- tibble::tibble( x = jitter(n.pept), y = jitter(n.prot), index = seq_len(length(ll)) ) plotJitter_rCharts(df)data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) ll <- getPepProtCC(X)[seq_len(4)] n.prot <- unlist(lapply(ll, function(x) {length(x$proteins)})) n.pept <- unlist(lapply(ll, function(x) {length(x$peptides)})) df <- tibble::tibble( x = jitter(n.pept), y = jitter(n.prot), index = seq_len(length(ll)) ) plotJitter_rCharts(df)
This function allows to compute a post-hoc test after a 1-way
ANOVA analysis. It expects as input an object obtained with the function
classic1wayAnova. The second parameter allows to choose between 2
different post-hoc tests: the Tukey Honest Significant Differences
(specified as "TukeyHSD") and the Dunnett test (specified as "Dunnett").
postHocTest(aov_fits, post_hoc_test = "TukeyHSD")postHocTest(aov_fits, post_hoc_test = "TukeyHSD")
aov_fits |
a list containing aov fitted model objects |
post_hoc_test |
a character string indicating which post-hoc test to use. Possible values are "TukeyHSD" or "Dunnett". See details for what to choose according to your experimental design. |
This is a function allowing to realise post-hoc tests for a set of
proteins/peptides for which a classic 1-way anova has been performed with
the function classic1wayAnova. Two types of tests are currently
available: The Tukey HSD's test and the Dunnett's test. Default is Tukey's
test.
The Tukey HSD's test compares all possible pairs of means, and is based on a
studentized range distribution. Here is used the TukeyHSD() function,
which can be applied to balanced designs (same number of samples in each
group), but also to midly unbalanced designs.
The Dunnett's test compares a single control group to all other groups.
Make sure the factor levels are properly ordered.
a list of 2 dataframes: first one called "LogFC" contains all pairwise comparisons logFC values (one column for one comparison) for each analysed feature; The second one named "P_Value" contains the corresponding pvalues.
Hélène Borges
library(SummarizedExperiment) data(subR25prot) obj <- subR25prot filter <- FunctionFilter('qMetacellOnConditions', cmd = 'delete', mode = 'AtLeastOneCond', pattern = c("Missing POV", "Missing MEC"), conds = design_qf(obj)$Condition, percent = TRUE, th = 0.8, operator = '>') obj <- filterFeaturesOneSE(obj, name = "Filtered", filters = list(filter)) qdata <- SummarizedExperiment::assay(obj[[2]]) conds <- design_qf(obj)$Condition anova_tests <- apply(qdata, 1, classic1wayAnova, conditions = as.factor(conds)) anova_tests <- t(anova_tests) names(anova_tests) <- rownames(qdata) pht <- postHocTest(aov_fits = anova_tests)library(SummarizedExperiment) data(subR25prot) obj <- subR25prot filter <- FunctionFilter('qMetacellOnConditions', cmd = 'delete', mode = 'AtLeastOneCond', pattern = c("Missing POV", "Missing MEC"), conds = design_qf(obj)$Condition, percent = TRUE, th = 0.8, operator = '>') obj <- filterFeaturesOneSE(obj, name = "Filtered", filters = list(filter)) qdata <- SummarizedExperiment::assay(obj[[2]]) conds <- design_qf(obj)$Condition anova_tests <- apply(qdata, 1, classic1wayAnova, conditions = as.factor(conds)) anova_tests <- t(anova_tests) names(anova_tests) <- rownames(qdata) pht <- postHocTest(aov_fits = anova_tests)
This function allows to push p-values to 1 based on metacell tags.
pushpvalue( obj, pvalue, scope = "WholeMatrix", pattern = "Imputed MEC", percent = TRUE, threshold = 1, conditions = NULL, operator = ">=", level = NULL, value = 1.00000000001 )pushpvalue( obj, pvalue, scope = "WholeMatrix", pattern = "Imputed MEC", percent = TRUE, threshold = 1, conditions = NULL, operator = ">=", level = NULL, value = 1.00000000001 )
obj |
An object of class |
pvalue |
A vector of p-values. |
scope |
A string for scope to use. Available values are "WholeLine", "WholeMatrix", "AllCond" and "AtLeastOneCond". |
pattern |
A vector of tag to use. |
percent |
A boolean to indicate whether the threshold represent an absolute value (percent = FALSE) or a percentage (percent = TRUE). |
threshold |
A value that corresponds to the threshold value. Either an integer if percent = FALSE, or a float between 0 and 1 of percent = TRUE. |
conditions |
A vector of conditions in the dataset.
If not provided, the vector |
operator |
A string for operator to use. Available operators are "<=", "<", ">=", ">", "==" and "!=". |
level |
A string for dataset type. Either "peptide" or "protein"
If not provided, the string obtained from |
value |
A float, value to assign to the pushed p-value. By default, the value is set slightly above 1 to be able to differentiate the pushed value. |
A vector with pushed p-values.
Manon Gaudin
data(subR25prot) obj <- subR25prot # Simulate imputation obj <- NAIsZero(obj, 1) allComp <- limmaCompleteTest(SummarizedExperiment::assay( obj[[length(obj)]]), design_qf(obj), comp.type="OnevsOne") pushpvalue(obj, allComp$P_Value[, 1], scope = "WholeMatrix", pattern = c("Missing MEC", "Missing POV"), percent = TRUE, threshold = 0.5, operator = ">=",)data(subR25prot) obj <- subR25prot # Simulate imputation obj <- NAIsZero(obj, 1) allComp <- limmaCompleteTest(SummarizedExperiment::assay( obj[[length(obj)]]), design_qf(obj), comp.type="OnevsOne") pushpvalue(obj, allComp$P_Value[, 1], scope = "WholeMatrix", pattern = c("Missing MEC", "Missing POV"), percent = TRUE, threshold = 0.5, operator = ">=",)
This function gives the vocabulary used for the quantitative metadata of each entity in each condition.
This function is based on the qMetacell dataframe to look for either missing values (used to update an initial dataset) or imputed values (used when post processing protein qMetacell after aggregation)
In the quantitative columns, a missing value is identified by no value rather than a value equal to 0. Conversion rules Quanti Tag NA or 0 NA
Update the quantitative metadata information of missing values that were imputed
Gives all the tags of the metadata vocabulary containing the pattern (parent and all its children).
Agregation rules for the cells quantitative metadata of peptides.
Please refer to the qmetacellDef vocabulary in qmetacellDef()
metacellDef(level) custom_metacell_colors() Set_POV_MEC_tags(obj, conds) Set_POV_MEC_tags2(conds, df, level) Metacell_generic(qdata, conds, level) UpdateMetacellAfterImputation(object, ...) ## S4 method for signature 'SummarizedExperiment' UpdateMetacellAfterImputation(object) searchMetacellTags(pattern, level, depth = "1") metacombine(met, level)metacellDef(level) custom_metacell_colors() Set_POV_MEC_tags(obj, conds) Set_POV_MEC_tags2(conds, df, level) Metacell_generic(qdata, conds, level) UpdateMetacellAfterImputation(object, ...) ## S4 method for signature 'SummarizedExperiment' UpdateMetacellAfterImputation(object) searchMetacellTags(pattern, level, depth = "1") metacombine(met, level)
level |
A string designing the type of entity/pipeline.
Available values are: |
obj |
An object of class |
conds |
A 1-col dataframe with the condition associated to each sample. |
df |
An object of class |
qdata |
A matrix of quantitative data |
object |
An object of class |
... |
Additional parameters |
pattern |
The string to search. |
depth |
Either "0", "1" or "*". |
met |
Metacells |
A data.frame containing the different tags and corresponding colors for the level given in parameter
A list
An instance of class QFeatures.
NA
NA
NA
Peptide-level vocabulary
|– 'Any' | | | |– 1.0 'Quantified' | | | | | |– 1.1 "Quant. by direct id" (color 4, white) | | | | | |– 1.2 "Quant. by recovery" (color 3, lightgrey) | | | |– 2.0 "Missing" (no color) | | | | | |– 2.1 "Missing POV" (color 1) | | | | | |– 2.2 'Missing MEC' (color 2) | | | |– 3.0 'Imputed' | | | | | |– 3.1 'Imputed POV' (color 1) | | | | | |– 3.2 'Imputed MEC' (color 2)
Protein-level vocabulary: |– 'Any' | | | |– 1.0 'Quantified' | | | | | |– 1.1 "Quant. by direct id" (color 4, white) | | | | | |– 1.2 "Quant. by recovery" (color 3, lightgrey) | | | |– 2.0 "Missing" | | | | | |– 2.1 "Missing POV" (color 1) | | | | | |– 2.2 'Missing MEC' (color 2) | | | |– 3.0 'Imputed' | | | | | |– 3.1 'Imputed POV' (color 1) | | | | | |– 3.2 'Imputed MEC' (color 2) | | | |– 4.0 'Combined tags' (color 3bis, lightgrey)
A generic conversion
Conversion for Proline datasets
Conversion from Maxquant datasets
Agregation of non imputed values (2.X) with quantitative values
| (1.0, 1.X, 3.0, 3.X) |
| Not possible |
| ---------------------------- |
| Agregation of different types of missing values (among 2.1, 2.2) |
Agregation of 2.1 peptides between each other gives a missing value non imputed (2.0)
Agreagtion of 2.2 peptides between each other givesa missing value non imputed (2.0)
Agregation of a mix of 2.1 and 2.2 gives a missing value non imputed (2.0) |—————————-
| Agregation of a mix of quantitative values (among 1.0, 1.1, 1.2, 3.0, 3.X) |
if the type of all the peptides to agregate is 1.0, 1.1 or 1.2, then the final metadata is set the this tag
if the set of metacell to agregate is a mix of 1.0, 1.1 or 1.2, then the final metadata is set to 1.0
if the set of metacell to agregate is a mix of 3.X and 3.0, then the final metadata is set to 3.0
if the set of metacell to agregate is a mix of 3.X and 3.0 and other (X.X), then the final metadata is set to 4.0 |—————————-
Update metacell with POV/MEC status for the categories 2.0 and 3.0 TODO
Thomas Burger, Samuel Wieczorek
Samuel Wieczorek
metacellDef('protein') metacellDef('peptide') library(QFeatures) data(subR25prot) conds <- design_qf(subR25prot)$Condition df <- Set_POV_MEC_tags(subR25prot[[1]], conds) library(SummarizedExperiment) data(subR25pept) conds <- design_qf(subR25pept)$Condition qdata <- SummarizedExperiment::assay(subR25pept[[1]]) df <- Metacell_generic(qdata, conds, 'peptide') data(subR25prot) subR25prot[[1]] <- UpdateMetacellAfterImputation(subR25prot[[1]]) searchMetacellTags('Missing POV', 'peptide') searchMetacellTags('Quantified', 'peptide') ll <- metacellDef('peptide')$node for (i in seq_along(ll)) test <- lapply(combn(ll, i, simplify = FALSE), function(x) tag <- metacombine(x, 'peptide'))metacellDef('protein') metacellDef('peptide') library(QFeatures) data(subR25prot) conds <- design_qf(subR25prot)$Condition df <- Set_POV_MEC_tags(subR25prot[[1]], conds) library(SummarizedExperiment) data(subR25pept) conds <- design_qf(subR25pept)$Condition qdata <- SummarizedExperiment::assay(subR25pept[[1]]) df <- Metacell_generic(qdata, conds, 'peptide') data(subR25prot) subR25prot[[1]] <- UpdateMetacellAfterImputation(subR25prot[[1]]) searchMetacellTags('Missing POV', 'peptide') searchMetacellTags('Quantified', 'peptide') ll <- metacellDef('peptide')$node for (i in seq_along(ll)) test <- lapply(combn(ll, i, simplify = FALSE), function(x) tag <- metacombine(x, 'peptide'))
QFeatures object to a Excel file.This function exports an instance of the class QFeatures to a Excel file.
The resulting file is composed of four sheets:
quantitative data which contains the content of assay() object with a
color code for each cell w.r.t. to cell quantitative metadata.
metadata which is the content of rowData() with only one-dimensionnal
data (i.e. the adjacencyMatrix and the qMetacell slots are not part of
the sheet),
exp. design which is the content of colData(). Each condition in the
table is colored with a different color,
quantitative metadata which is the content of qMetacell(). There is a
color code for the different tags.
write2excel(object, ...) ## S4 method for signature 'QFeatures' write2excel(object, i = NULL, filename = "newFile", writeColdData = TRUE, ...) ## S4 method for signature 'SummarizedExperiment' write2excel(object, filename, exp.design, writeColData = TRUE, ...) write2excelSE(object, filename, exp.design, writeColData = TRUE) addColors(wb, n, tags, colors)write2excel(object, ...) ## S4 method for signature 'QFeatures' write2excel(object, i = NULL, filename = "newFile", writeColdData = TRUE, ...) ## S4 method for signature 'SummarizedExperiment' write2excel(object, filename, exp.design, writeColData = TRUE, ...) write2excelSE(object, filename, exp.design, writeColData = TRUE) addColors(wb, n, tags, colors)
object |
An instance of the class |
... |
Additional parameters. |
i |
An integer which is the index of the assay in the QFeatures object |
filename |
A |
writeColdData |
A |
exp.design |
A |
writeColData |
A |
wb |
A workbook |
n |
A |
tags |
A |
colors |
A |
A Excel file.
Samuel Wieczorek
data(subR25prot) #--------------------------------------- # Export the whole dataset #--------------------------------------- write2excel(subR25prot, filename = "foo") unlink('foo.xls') write2excel(subR25prot, 1, "foo") unlink('foo.xls')data(subR25prot) #--------------------------------------- # Export the whole dataset #--------------------------------------- write2excel(subR25prot, filename = "foo") unlink('foo.xls') write2excel(subR25prot, 1, "foo") unlink('foo.xls')
The filterFeaturesOneSE methods enables users to filter features
based on a variable in their rowData. It is directly inspired of the
function filterFeature of the package QFeatures.
The first difference is that the filter only applies to one
SummarizedExperiment contained in the object rather than applying on
all the SE.
This method generates a new SummarizedExperiment object which is added
to the QFeatures object. If the SE on which the filter applies is the
last one of the object, then a new SE is created If it is not the last one, the
new SE is added and all the further SE are deleted. The features matching
the. The filters can be provided as instances of class AnnotationFilter
(see the package QFeatures) or of class FunctionFilter (see below).
FunctionFilter(name, ...) filterFeaturesOneSE(object, ...) ## S4 method for signature 'QFeatures' filterFeaturesOneSE(object, i, name = "newAssay", filters)FunctionFilter(name, ...) filterFeaturesOneSE(object, ...) ## S4 method for signature 'QFeatures' filterFeaturesOneSE(object, i, name = "newAssay", filters)
name |
A |
... |
Additional arguments |
object |
An instance of class |
i |
The index or name of the assay which features will be filtered the create the new assay. |
filters |
A |
A filtered QFeature object
The function filters are filters as defined in the
DaparToolshed package. Each filter is defined by a name (which is the
name of a function) and a list which contains the parameters passed to the
function. Those filters can be created with the FunctionFilter
constructor.
Those functions are divided into two main categories:
the one that filter on one rowData feature,
the one based on a two-dimensional information such as the adjacency matrix
for the first category, all filters of class AnnotationFilter::AnnotationFilter can be
used as they are used in QFeatures
For the second category, the package DaparToolshed provides filter
functions based either on the adjacency matrix:
Or based on the quantitative metadata (identification):
Samuel Wieczorek
data("subR25prot") data("subR25pept") ## ---------------------------------------- ## Creating function filters ## ---------------------------------------- #FunctionFilter('FUN', # param1 = 'value_of_param1', # param2 = 'value_of_param2') FunctionFilter('qMetacellWholeLine', cmd = 'delete', pattern = 'Missing MEC') ## ---------------------------------------------------------------- ## Filter the last assay to keep only specific peptides. This filter ## only applies on peptide dataset. ## ---------------------------------------------------------------- spec.filter <- FunctionFilter('specPeptides', list()) ## using a user-defined character filter filterFeaturesOneSE(subR25pept, filters = list(FunctionFilter('specPeptides', list()))) ## ---------------------------------------------------------------- ## Filter the last assay to keep only specific peptides and topn ## peptides. The two filters are run sequentially. ## ---------------------------------------------------------------- lst.filters <- list(FunctionFilter('specPeptides', list())) lst.filters <- append(lst.filters, FunctionFilter('topnPeptides', fun = 'rowSums', top = 2)) filterFeaturesOneSE(subR25pept, filters = lst.filters) ## ---------------------------------------------------------------- ## Filter the last assay to delete peptides where, in at least one ## condition, there is less than 80% of samples marked as 'imputed POV' ## ---------------------------------------------------------------- filter <- FunctionFilter('qMetacellOnConditions', cmd = 'delete', mode = 'AtLeastOneCond', pattern = 'Missing POV', conds = SummarizedExperiment::colData(subR25prot)$Condition, percent = TRUE, th = 0.8, operator = '<') filterFeaturesOneSE(subR25prot, filters = list(filter))data("subR25prot") data("subR25pept") ## ---------------------------------------- ## Creating function filters ## ---------------------------------------- #FunctionFilter('FUN', # param1 = 'value_of_param1', # param2 = 'value_of_param2') FunctionFilter('qMetacellWholeLine', cmd = 'delete', pattern = 'Missing MEC') ## ---------------------------------------------------------------- ## Filter the last assay to keep only specific peptides. This filter ## only applies on peptide dataset. ## ---------------------------------------------------------------- spec.filter <- FunctionFilter('specPeptides', list()) ## using a user-defined character filter filterFeaturesOneSE(subR25pept, filters = list(FunctionFilter('specPeptides', list()))) ## ---------------------------------------------------------------- ## Filter the last assay to keep only specific peptides and topn ## peptides. The two filters are run sequentially. ## ---------------------------------------------------------------- lst.filters <- list(FunctionFilter('specPeptides', list())) lst.filters <- append(lst.filters, FunctionFilter('topnPeptides', fun = 'rowSums', top = 2)) filterFeaturesOneSE(subR25pept, filters = lst.filters) ## ---------------------------------------------------------------- ## Filter the last assay to delete peptides where, in at least one ## condition, there is less than 80% of samples marked as 'imputed POV' ## ---------------------------------------------------------------- filter <- FunctionFilter('qMetacellOnConditions', cmd = 'delete', mode = 'AtLeastOneCond', pattern = 'Missing POV', conds = SummarizedExperiment::colData(subR25prot)$Condition, percent = TRUE, th = 0.8, operator = '<') filterFeaturesOneSE(subR25prot, filters = list(filter))
Utility funcitons to dela with QFeatures objects.
last_assay(object) n_assays_in_qf(object) QFeaturesFromSE( obj.se, colData = data.frame(), metadata.qf = data.frame(), name = "myname" )last_assay(object) n_assays_in_qf(object) QFeaturesFromSE( obj.se, colData = data.frame(), metadata.qf = data.frame(), name = "myname" )
object |
An instance of the class |
obj.se |
An instance of the class |
colData |
A data.frame() which contains data for the future object, |
metadata.qf |
A data.frame() which contains the metadata for the future object, |
name |
The name of the assay in the QFeatures object |
NA
An instance of QFeatures class
NULL # example codeNULL # example code
Replace ".", ' ', '-' in character() by '_' to be compliant
with functions of Shinyjs, Shiny
ReplaceSpecialChars(x)ReplaceSpecialChars(x)
x |
A |
A character() of the same length as 'x' with modified
names.
Samuel Wieczorek
ReplaceSpecialChars(c("foo.1", "foo-2", "foo 3"))ReplaceSpecialChars(c("foo.1", "foo-2", "foo 3"))
This function computes a regularized version of the likelihood ratio statistic. The regularization adds a user-input fudge factor s1 to the variance estimator. This is straightforward when using a fixed effect model (cases 'numeric' and 'lm') but requires some more care when using a mixed model.
samLRT(lmm.res.h0, lmm.res.h1, cc, n, p, s1)samLRT(lmm.res.h0, lmm.res.h1, cc, n, p, s1)
lmm.res.h0 |
a vector of object containing the estimates (used to compute the statistic) under H0 for each connected component. If the fast version of the estimator was used (as implemented in this package), lmm.res.h0 is a vector containing averages of squared residuals. If a fixed effect model was used, it is a vector of lm objects and if a mixed effect model was used it is a vector or lmer object. |
lmm.res.h1 |
similar to lmm.res.h0, a vector of object containing the estimates (used to compute the statistic) under H1 for each protein. |
cc |
a list containing the indices of peptides and proteins belonging to each connected component. |
n |
the number of samples used in the test |
p |
the number of proteins in the experiment |
s1 |
the fudge factor to be added to the variance estimate |
llr.sam: a vector of numeric containing the regularized log likelihood ratio statistic for each protein. s: a vector containing the maximum likelihood estimate of the variance for the chosen model. When using the fast version of the estimator implemented in this package, this is the same thing as the input lmm.res.h1. lh1.sam: a vector of numeric containing the regularized log likelihood under H1 for each protein. lh0.sam: a vector of numeric containing the regularized log likelihood under H0 for each connected component. sample.sizes: a vector of numeric containing the sample size (number of biological samples times number of peptides) for each protein. This number is the same for all proteins within each connected component.
Thomas Burger, Laurent Jacob
NULLNULL
Computes the adjusted p-values separately on contrast using CP4P
separateAdjPval(x, pval.threshold = 1.05, method = 1)separateAdjPval(x, pval.threshold = 1.05, method = 1)
x |
a proteins x contrasts dataframe of (raw) p-values |
pval.threshold |
all the p-values above the threshold are not considered. Default is 1.05 (which is equivalent to have no threshold). Applying a threshold nearby 1 can be instrumental to improve the uniformity under the null, notably in case of upstream mutliple contrat correction (for experienced users only) |
method |
a method to estimate pi_0, see CP4P |
a proteins x contrasts table of adjusted p-values
Thomas Burger
data(subR25prot) obj <- subR25prot[seq_len(5),] separateAdjPval( testAnovaModels( applyAnovasOnProteins(obj, 1), "TukeyHSD")$P_Value)data(subR25prot) obj <- subR25prot[seq_len(5),] separateAdjPval( testAnovaModels( applyAnovasOnProteins(obj, 1), "TukeyHSD")$P_Value)
Standardize names
SetHistory(obj.se, history)SetHistory(obj.se, history)
obj.se |
An instance of the class |
history |
A |
A data.frame()
Samuel Wieczorek
data(subR25prot) history <- GetHistory(subR25prot[[1]]) history <- rbind(history, c('Example', 'Step Ex', 'ex_param', 'Ex')) subR25prot[[1]] <- SetHistory(subR25prot[[1]], history)data(subR25prot) history <- GetHistory(subR25prot[[1]]) history <- rbind(history, c('Example', 'Step Ex', 'ex_param', 'Ex')) subR25prot[[1]] <- SetHistory(subR25prot[[1]], history)
Method to split an adjacency matrix into specific and shared
splitAdjacencyMat(X)splitAdjacencyMat(X)
X |
An adjacency matrix |
A list of two adjacency matrices
Samuel Wieczorek
data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) ll <- splitAdjacencyMat(X)data(subR25pept) X <- BuildAdjacencyMatrix(subR25pept[[1]]) ll <- splitAdjacencyMat(X)
This dataset is a subset of the final outcome of a quantitative mass spectrometry-based proteomic analysis of two samples containing different concentrations of 48 human proteins (UPS1 standard from Sigma-Aldrich) within a constant yeast background (see Giai Gianetto et al. (2016) for details). It contains the abundance values of the different human and yeast proteins identified and quantified in these two conditions. The two conditions represent the measured abundances of peptides when respectively 5 fmol and 10 fmol of UPS1 human proteins were mixed with the yeast extract before mass spectrometry analyses. This results in a concentration ratio of 2. Three technical replicates were acquired for each condition.
The original dataset is available as a CSV file (see inst/extdata/Exp1_R25_pept_100.txt). In the latter case, the quantitative data are those of the raw intensities.
This dataset is a subset containing the first 500 peptides from the original dataset, which comes from: https://doi.org/10.1002/pmic.201500189
data(subR25pept)data(subR25pept)
An object of class QFeatures related to proteins
quantification. It contains 6 samples divided into two conditions
(10fmol and 5fmol) and 500 peptides
The data frame assay(subR25pept) contains six columns that are the quantitation of peptides for the six replicates.
The data frame fData(subR25pept) contains the meta data about the peptides
The data frame pData(subR25pept) contains the experimental design and gives few information about the samples.
An object of class QFeatures related to proteins
quantification.
Cox J., Hein M.Y., Luber C.A., Paron I., Nagaraj N., Mann M. Accurate proteome-wide label-free quantification by delayed normalization and maximal peptide ratio extraction, termed MaxLFQ. Mol Cell Proteomics. 2014 Sep, 13(9):2513-26.
Giai Gianetto, Q., Combes, F., Ramus, C., Bruley, C., Coute, Y., Burger, T. (2016). Calibration plot for proteomics: A graphical tool to visually check the assumptions underlying FDR control in quantitative experiments. Proteomics, 16(1), 29-32.
This dataset is a subset of the final outcome of a quantitative mass spectrometry-based proteomic analysis of two samples containing different concentrations of 48 human proteins (UPS1 standard from Sigma-Aldrich) within a constant yeast background (see Giai Gianetto et al. (2016) for details). It contains the abundance values of the different human and yeast proteins identified and quantified in these two conditions. The two conditions represent the measured abundances of proteins when respectively 5 fmol and 10 fmol of UPS1 human proteins were mixed with the yeast extract before mass spectrometry analyses. This results in a concentration ratio of 2. Three technical replicates were acquired for each condition.
The original dataset is available as a CSV file (see inst/extdata/Exp1_R25_prot_100.txt). In the latter case, the quantitative data are those of the raw intensities.
This dataset is a subset containing the first 100 proteins from the original dataset, which comes from: https://doi.org/10.1002/pmic.201500189
data(subR25prot)data(subR25prot)
An object of class QFeatures related to proteins
quantification. It contains 6 samples divided into two conditions
(10fmol and 5fmol) and 100 proteins.
The data frame assay(subR25prot) contains six columns that are the quantitation of proteins for the six replicates.
The data frame fData(subR25prot) contains the meta data about the proteins.
The data frame pData(subR25prot) contains the experimental design and gives few informations about the samples.
An object of class QFeatures related to proteins
quantification.
Cox J., Hein M.Y., Luber C.A., Paron I., Nagaraj N., Mann M. Accurate proteome-wide label-free quantification by delayed normalization and maximal peptide ratio extraction, termed MaxLFQ. Mol Cell Proteomics. 2014 Sep, 13(9):2513-26.
Giai Gianetto, Q., Combes, F., Ramus, C., Bruley, C., Coute, Y., Burger, T. (2016). Calibration plot for proteomics: A graphical tool to visually check the assumptions underlying FDR control in quantitative experiments. Proteomics, 16(1), 29-32.
This function looks for the lines that respect the request in either all conditions or at least one condition.
SymFilteringOperators() qMetacellFilteringScope() qMetacellWholeMatrix( object, cmd, pattern, percent = "Percentage", th, operator ) qMetacellWholeLine(object, cmd, pattern) qMetacellOnConditions( object, cmd, mode, pattern, conds, percent = "Percentage", operator, th )SymFilteringOperators() qMetacellFilteringScope() qMetacellWholeMatrix( object, cmd, pattern, percent = "Percentage", th, operator ) qMetacellWholeLine(object, cmd, pattern) qMetacellOnConditions( object, cmd, mode, pattern, conds, percent = "Percentage", operator, th )
object |
An instance of the class |
cmd |
A |
pattern |
A |
percent |
A |
th |
The threshold to apply |
operator |
String for operator to use. List of operators is available with 'SymFilteringOperators()'. |
mode |
A |
conds |
A vector of conditions in the dataset. |
A vector of operators
NA
A vector of filtering scopes
NA
NA
NA
SymFilteringOperators() data(subR25prot) obj <- subR25prot[[1]] level <- typeDataset(obj) pattern <- "Missing" mask <- matchMetacell( metadata = qMetacell(obj), pattern = pattern, level = level ) percent <- FALSE th <- 3 op <- ">=" cmd <- 'delete' ind <- qMetacellWholeMatrix(obj, cmd, pattern, percent, th, op) data(subR25prot) ind <- qMetacellWholeLine(obj, cmd, pattern) conds <- design_qf(subR25prot)$Condition op <- ">=" th <- 0.5 percent <- "Percentage" mode <- "AllCond" ind <- qMetacellOnConditions(obj, cmd, mode, pattern, conds, percent, op, th) qMetacellFilteringScope() data(subR25prot) obj <- subR25prot[[1]]SymFilteringOperators() data(subR25prot) obj <- subR25prot[[1]] level <- typeDataset(obj) pattern <- "Missing" mask <- matchMetacell( metadata = qMetacell(obj), pattern = pattern, level = level ) percent <- FALSE th <- 3 op <- ">=" cmd <- 'delete' ind <- qMetacellWholeMatrix(obj, cmd, pattern, percent, th, op) data(subR25prot) ind <- qMetacellWholeLine(obj, cmd, pattern) conds <- design_qf(subR25prot)$Condition op <- ">=" th <- 0.5 percent <- "Percentage" mode <- "AllCond" ind <- qMetacellOnConditions(obj, cmd, mode, pattern, conds, percent, op, th) qMetacellFilteringScope() data(subR25prot) obj <- subR25prot[[1]]
Applies a statistical test on each element of a list of linear models
testAnovaModels(aov_fits, test = "Omnibus")testAnovaModels(aov_fits, test = "Omnibus")
aov_fits |
a list of linear models, such as those outputted by applyAnovasOnProteins |
test |
a character string among "Omnibus", "TukeyHSD", "TukeySinglestep", "TukeyStepwise", "TukeyNoMTC", "DunnettSinglestep", "DunnettStepwise" and "DunnettNoMTC". "Omnibus" tests the all-mean equality, the Tukey tests compares all pairs of means and the Dunnet tests compare all the means to the first one. For multiple tests (Dunnet's or Tukey's) it is possible to correct for multiplicity (either with single-step or step-wise FWER) or not. All the Tukey's and Dunnet's tests use the multcomp package expect for "TukeyHSD" which relies on the stats package. "TukeyHSD" and "TukeyStepwise" gives similar results. |
a list of 2 tables (p-values and fold-changes, respectively)
Thomas Burger
data(subR25prot) obj <- subR25prot[seq_len(5),] testAnovaModels(applyAnovasOnProteins(obj, 1))data(subR25prot) obj <- subR25prot[seq_len(5),] testAnovaModels(applyAnovasOnProteins(obj, 1))
Check the validity of the design
testDesign(tab)testDesign(tab)
tab |
A data.frame which correspond to the design |
A list of two items
Thomas Burger, Samuel Wieczorek
data(subR25pept) testDesign(SummarizedExperiment::colData(subR25pept)[, -1])data(subR25pept) testDesign(SummarizedExperiment::colData(subR25pept)[, -1])
Applies p-value adjustment using cp4p on p-values below a given threshold
thresholdpval4fdr(x, pval.T, M)thresholdpval4fdr(x, pval.T, M)
x |
vector of p-values |
pval.T |
p-value threshold |
M |
a pi0.method from cp4p package |
adjusted p-values
Thomas Burger
NULLNULL
Generator of simulated values
translatedRandomBeta(n, min, max, param1 = 3, param2 = 1)translatedRandomBeta(n, min, max, param1 = 3, param2 = 1)
n |
An integer which is the number of simulation (same as in rbeta) |
min |
An integer that corresponds to the lower bound of the interval |
max |
An integer that corresponds to the upper bound of the interval |
param1 |
An integer that is the first parameter of rbeta function. |
param2 |
An integer that is second parameter of rbeta function. |
A vector of n simulated values
Thomas Burger
translatedRandomBeta(1000, 5, 10, 1, 1)translatedRandomBeta(1000, 5, 10, 1, 1)
SummarizedExperiment object,
calling the cp4p package functions.This function is a wrapper to the calibration.plot method of the
cp4p package for use with SummarizedExperiment objects.
wrapperCalibrationPlot(vPVal, pi0Method = "pounds")wrapperCalibrationPlot(vPVal, pi0Method = "pounds")
vPVal |
A dataframe that contains quantitative data. |
pi0Method |
A vector of the conditions (one condition per sample). |
A plot
Samuel Wieczorek
data(subR25prot) obj <- subR25prot # Simulate imputation obj <- NAIsZero(obj, 1) allComp <- limmaCompleteTest( SummarizedExperiment::assay(obj[[length(obj)]]), design_qf(obj), comp.type="OnevsOne") wrapperCalibrationPlot(allComp$P_Value[, 1])data(subR25prot) obj <- subR25prot # Simulate imputation obj <- NAIsZero(obj, 1) allComp <- limmaCompleteTest( SummarizedExperiment::assay(obj[[length(obj)]]), design_qf(obj), comp.type="OnevsOne") wrapperCalibrationPlot(allComp$P_Value[, 1])
Wrapper for One-way Anova statistical test
wrapperClassic1wayAnova(obj, i, with_post_hoc = "No", post_hoc_test = "No")wrapperClassic1wayAnova(obj, i, with_post_hoc = "No", post_hoc_test = "No")
obj |
An object of class |
i |
An integer which is the index of the assay in the QFeatures object |
with_post_hoc |
a character string with 2 possible values: "Yes" and "No" (default) saying if function must perform a Post-Hoc test or not. |
post_hoc_test |
character string, possible values are "No" (for no
test; default value) or TukeyHSD" or "Dunnett". See details of
|
This function allows to perform a 1-way Analysis of Variance. Also
computes the post-hoc tests if the with_post_hoc parameter is set to
yes. There are two possible post-hoc tests: the Tukey Honest Significant
Differences (specified as "TukeyHSD") and the Dunnett test
(specified as "Dunnett").
A list of two dataframes. First one called "logFC" contains all pairwise comparisons logFC values (one column for one comparison) for each analysed feature (Except in the case without post-hoc testing, for which NAs are returned.); The second one named "P_Value" contains the corresponding p-values.
Hélène Borges
postHocTest()
library(SummarizedExperiment) data(subR25prot) obj <- subR25prot filter <- FunctionFilter('qMetacellOnConditions', cmd = 'delete', mode = 'AtLeastOneCond', pattern = c("Missing POV", "Missing MEC"), conds = design_qf(obj)$Condition, percent = TRUE, th = 0.8, operator = '>') obj <- filterFeaturesOneSE(obj, name = "Filtered", filters = list(filter)) anovatest <- wrapperClassic1wayAnova(obj, 2)library(SummarizedExperiment) data(subR25prot) obj <- subR25prot filter <- FunctionFilter('qMetacellOnConditions', cmd = 'delete', mode = 'AtLeastOneCond', pattern = c("Missing POV", "Missing MEC"), conds = design_qf(obj)$Condition, percent = TRUE, th = 0.8, operator = '>') obj <- filterFeaturesOneSE(obj, name = "Filtered", filters = list(filter)) anovatest <- wrapperClassic1wayAnova(obj, 2)
This method is a wrapper to the function impute.mi() of the package
imp4p adapted to an object of class SummarizedExperiment.
wrapperDaparImputeMI( obj, design, nb.iter = 3, nknn = 15, selec = 600, siz = 500, weight = 1, ind.comp = 1, progress.bar = FALSE, x.step.mod = 300, x.step.pi = 300, nb.rei = 100, method = 4, gridsize = 300, q = 0.95, q.min = 0, q.norm = 3, eps = 0, methodi = "slsa", lapala = TRUE, distribution = "unif" )wrapperDaparImputeMI( obj, design, nb.iter = 3, nknn = 15, selec = 600, siz = 500, weight = 1, ind.comp = 1, progress.bar = FALSE, x.step.mod = 300, x.step.pi = 300, nb.rei = 100, method = 4, gridsize = 300, q = 0.95, q.min = 0, q.norm = 3, eps = 0, methodi = "slsa", lapala = TRUE, distribution = "unif" )
obj |
An object of class |
design |
A |
nb.iter |
Same as the function |
nknn |
Same as the function |
selec |
Same as the function |
siz |
Same as the function |
weight |
Same as the function |
ind.comp |
Same as the function |
progress.bar |
Same as the function |
x.step.mod |
Same as the function |
x.step.pi |
Same as the function |
nb.rei |
Same as the function |
method |
Same as the function |
gridsize |
Same as the function |
q |
Same as the function |
q.min |
Same as the function |
q.norm |
Same as the function |
eps |
Same as the function |
methodi |
Same as the function |
lapala |
A |
distribution |
The type of distribution used. Values are |
A matrix with imputed values instead of missing values.
Samuel Wieczorek
utils::data(subR25pept) design <- design_qf(subR25pept) obj.imp.na <- wrapperDaparImputeMI(subR25pept[[1]], design, nb.iter = 1, lapala = TRUE) obj.imp.pov <- wrapperDaparImputeMI(subR25pept[[1]], design, nb.iter = 1, lapala = FALSE)utils::data(subR25pept) design <- design_qf(subR25pept) obj.imp.na <- wrapperDaparImputeMI(subR25pept[[1]], design, nb.iter = 1, lapala = TRUE) obj.imp.pov <- wrapperDaparImputeMI(subR25pept[[1]], design, nb.iter = 1, lapala = FALSE)
This method is a wrapper to the function impute.mle() of the
package imp4p adapted to an object of class SummarizedExperiment.
It does not impute MEC missing values.
wrapperImputeMLE(obj, grp)wrapperImputeMLE(obj, grp)
obj |
An object of class |
grp |
A vector of conditions in the dataset. |
The SummarizedExperiment::assay(obj) matrix with imputed values instead
of missing values.
Samuel Wieczorek
utils::data(subR25pept) level <- 'peptide' # Delete whole empty lines metacell.mask <- DaparToolshed::matchMetacell( qMetacell(subR25pept[[1]]), c("Missing POV", "Missing MEC"), level) indices <- GetIndices_WholeMatrix(metacell.mask, op = ">=", th = 1) grp <- design_qf(subR25pept)$Condition subR25pept <- wrapperImputeMLE(subR25pept[[1]], grp)utils::data(subR25pept) level <- 'peptide' # Delete whole empty lines metacell.mask <- DaparToolshed::matchMetacell( qMetacell(subR25pept[[1]]), c("Missing POV", "Missing MEC"), level) indices <- GetIndices_WholeMatrix(metacell.mask, op = ">=", th = 1) grp <- design_qf(subR25pept)$Condition subR25pept <- wrapperImputeMLE(subR25pept[[1]], grp)
SummarizedExperiment objectThis method is a wrapper to the function imputePA2() adapted to
objects of class SummarizedExperiment.
wrapperImputePA2( obj, design, q.min = 0, q.norm = 3, eps = 0, distribution = "unif" )wrapperImputePA2( obj, design, q.min = 0, q.norm = 3, eps = 0, distribution = "unif" )
obj |
An object of class |
design |
A data.frame containing the columns "quantCols" corresponding to the samples name and "Condition" to the condition of each sample. |
q.min |
A quantile value of the observed values allowing defining the maximal value which can be generated. This maximal value is defined by the quantile q.min of the observed values distribution minus eps. Default is 0 (the maximal value is the minimum of observed values minus eps). |
q.norm |
A quantile value of a normal distribution allowing defining the minimal value which can be generated. Default is 3 (the minimal value is the maximal value minus qn*median(sd(observed values)) where sd is the standard deviation of a row in a condition). |
eps |
A value allowing defining the maximal value which can be generated. This maximal value is defined by the quantile q.min of the observed values distribution minus eps. Default is 0. |
distribution |
The type of distribution used. Values are |
The object obj which has been imputed
Thomas Burger, Samuel Wieczorek
NULLNULL
This method is a wrapper to the function pipeline_llkimpute() of the
package Pirat adapted to an object of class QFeatures of SummarizedExperiment.
wrapperPirat(data, adjmat, rnas_ab = NULL, adj_rna_pg = NULL, ...)wrapperPirat(data, adjmat, rnas_ab = NULL, adj_rna_pg = NULL, ...)
data |
An object of class |
adjmat |
Adjacency matrix corresponding to the |
rnas_ab |
Transcriptomic data with sample as row, used only if extension = 'T'. |
adj_rna_pg |
Adjacency matrix of rna (rows) and peptides or precursors (columns), used only if extension = 'T'. |
... |
Additional arguments to pass to |
QFeatures including a new assay with imputed data or SummarizedExperiment with imputed data.
Manon Gaudin
data(subR25pept) # Delete whole empty lines filter_emptyline <- FunctionFilter("qMetacellWholeLine", cmd = 'delete', pattern = 'Missing MEC') subR25pept <- filterFeaturesOneSE(object = subR25pept, i = length(subR25pept), name = "Filtered", filters = list(filter_emptyline)) subR25pept <- wrapperPirat(data = subR25pept, adjmat = SummarizedExperiment::rowData(subR25pept[[length(subR25pept)]])$adjacencyMatrix, extension = "base")data(subR25pept) # Delete whole empty lines filter_emptyline <- FunctionFilter("qMetacellWholeLine", cmd = 'delete', pattern = 'Missing MEC') subR25pept <- filterFeaturesOneSE(object = subR25pept, i = length(subR25pept), name = "Filtered", filters = list(filter_emptyline)) subR25pept <- wrapperPirat(data = subR25pept, adjmat = SummarizedExperiment::rowData(subR25pept[[length(subR25pept)]])$adjacencyMatrix, extension = "base")