Title: | Comparison and Visualization of Ranking and Assignment Methods |
---|---|
Description: | This package provides functions for calculation and visualization of performance metrics for evaluation of ranking and binary classification (assignment) methods. Various types of performance plots can be generated programmatically. The package also contains a shiny application for interactive exploration of results. |
Authors: | Charlotte Soneson [aut, cre] |
Maintainer: | Charlotte Soneson <[email protected]> |
License: | GPL (>=2) |
Version: | 1.35.0 |
Built: | 2024-12-03 06:13:44 UTC |
Source: | https://github.com/bioc/iCOBRA |
Accessor function to extract the methods that are represented in an
COBRAPerformance
or COBRAPlot
object.
basemethods(x, ...) ## S4 method for signature 'COBRAPerformance' basemethods(x)
basemethods(x, ...) ## S4 method for signature 'COBRAPerformance' basemethods(x)
x |
A |
... |
Additional arguments. |
A character vector of all methods represented in the object.
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrtprcurve") basemethods(cobraperf)
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrtprcurve") basemethods(cobraperf)
Calculate adjusted p-values for methods where only nominal p-values are
available in a COBRAData
object.
calculate_adjp(cobradata, method = "BH")
calculate_adjp(cobradata, method = "BH")
cobradata |
A |
method |
A character string giving the method (selected from
|
A COBRAData
object, extended with the calculated adjusted
p-values.
Charlotte Soneson
data(cobradata_example) cobradata_example <- calculate_adjp(cobradata_example, method = "BH")
data(cobradata_example) cobradata_example <- calculate_adjp(cobradata_example, method = "BH")
Calculate performance measures from a given collection of p-values, adjusted
p-values and scores provided in a COBRAData
object.
calculate_performance( cobradata, binary_truth = NULL, cont_truth = NULL, aspects = c("fdrtpr", "fdrtprcurve", "fdrnbr", "fdrnbrcurve", "tpr", "fpr", "roc", "fpc", "overlap", "corr", "scatter", "deviation", "fsrnbr", "fsrnbrcurve"), thrs = c(0.01, 0.05, 0.1), svalthrs = c(0.01, 0.05, 0.1), splv = "none", maxsplit = 3, onlyshared = FALSE, thr_venn = 0.05, type_venn = "adjp", topn_venn = 100, rank_by_abs = TRUE, prefer_pval = TRUE )
calculate_performance( cobradata, binary_truth = NULL, cont_truth = NULL, aspects = c("fdrtpr", "fdrtprcurve", "fdrnbr", "fdrnbrcurve", "tpr", "fpr", "roc", "fpc", "overlap", "corr", "scatter", "deviation", "fsrnbr", "fsrnbrcurve"), thrs = c(0.01, 0.05, 0.1), svalthrs = c(0.01, 0.05, 0.1), splv = "none", maxsplit = 3, onlyshared = FALSE, thr_venn = 0.05, type_venn = "adjp", topn_venn = 100, rank_by_abs = TRUE, prefer_pval = TRUE )
cobradata |
A |
binary_truth |
A character string giving the name of the column of truth(cobradata) that contains the binary truth (true assignment of variables into two classes, represented by 0/1). |
cont_truth |
A character string giving the name of the column of truth(cobradata) that contains the continuous truth (a continuous value that the observations can be compared to). |
aspects |
A character vector giving the types of performance measures to calculate. Must be a subset of c("fdrtpr", "fdrtprcurve", "fdrnbr", "fdrnbrcurve", "tpr", "fpr", "roc", "fpc", "overlap", "corr", "scatter", "deviation", "fsrnbr", "fsrnbrcurve"). |
thrs |
A numeric vector of adjusted p-value thresholds for which to calculate the performance measures. Affects "fdrtpr", "fdrnbr", "tpr" and "fpr". |
svalthrs |
A numeric vector of s-value thresholds for which to calculate the FSR. Affects "fsrnbr". |
splv |
A character string giving the name of the column of truth(cobradata) that will be used to stratify the results. The default value is "none", indicating no stratification. |
maxsplit |
A numeric value giving the maximal number of categories to keep in the stratification. The largest categories containing both positive and negative features will be retained. By setting this argument to 'Inf' or 'NA_integer_', all categories (as well as the order of categories) will be retained. |
onlyshared |
A logical, indicating whether to only consider features for which both the true assignment and a result (p-value, adjusted p-value or score) is given. If FALSE, all features contained in the truth table are used. |
thr_venn |
A numeric value giving the adjusted p-value threshold to use
to create Venn diagrams (if |
type_venn |
Either "adjp" or "rank", indicating whether Venn diagrams should be constructed based on features with adjusted p-values below a certain threshold, or based on the same number of top-ranked features by different methods. |
topn_venn |
A numeric value giving the number of top-ranked features to
compare between methods (if |
rank_by_abs |
Whether to take the absolute value of the score before using it to rank the variables for ROC, FPC, FDR/NBR and FDR/TPR curves. |
prefer_pval |
Whether to preferentially rank variables by p-values or
adjusted p-values rather than score for ROC and FPC calculations. From
version 1.5.5, this is the default behaviour. To obtain the behaviour of
previous versions, set to |
Depending on the collection of observations that are available for a given
method, the appropriate one will be chosen for each performance measure. For
fpr
, tpr
, fdrtpr
, fdrnbr
and overlap
aspects, results will only be calculated for methods where adjusted p-values
are included in the COBRAData
object, since these calculations make
use of specific adjusted p-value cutoffs. For fdrtprcurve
and
fdrnbrcurve
aspects, the score
observations will be
preferentially used, given that they are monotonically associated with the
adjusted p-values (if provided). If the score
is not provided, the
nominal p-values will be used, given that they are monotonically associated
with the adjusted p-values (if provided). In other cases, the adjusted
p-values will be used also for these aspects. For roc
and fpc
,
the score
observations will be used if they are provided, otherwise
p-values and, as a last instance, adjusted p-values. Finally, for the
fsrnbr
, corr
, scatter
and deviation
aspects, the
score
observations will be used if they are provided, otherwise no
results will be calculated.
A COBRAPerformance
object
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = c("fdrtpr", "fdrtprcurve", "tpr", "roc"), thrs = c(0.01, 0.05, 0.1), splv = "none")
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = c("fdrtpr", "fdrtprcurve", "tpr", "roc"), thrs = c(0.01, 0.05, 0.1), splv = "none")
Interactive shiny app for visualization of results. The app can be
initialized with a COBRAData
object. If no object is provided, truth
and results are loaded into the app from text files (see the Instructions tab
of the app for formatting instructions). Properly formatted text files can
also be obtained using the function COBRAData_to_text
.
COBRAapp(cobradata = NULL, autorun = FALSE)
COBRAapp(cobradata = NULL, autorun = FALSE)
cobradata |
An (optional) |
autorun |
A logical indicating whether the app calculations should start automatically on launch, or wait for the user to press the 'Start calculation!' button. |
Returns (and runs) an object representing the shiny app.
Charlotte Soneson
data(cobradata_example) app <- COBRAapp(cobradata_example) if (interactive()) { shiny::runApp(app) }
data(cobradata_example) app <- COBRAapp(cobradata_example) if (interactive()) { shiny::runApp(app) }
A data set consisting of p-values, adjusted p-values and estimated absolute
log fold changes (in the 'scores' slot) obtained by three methods for
differential expression analysis of RNA-seq data, applied to a small
synthetic data set of 3,858 human genes. The values are stored in a
COBRAData
object together with a 'truth' data frame containing the
true differential expression status for each gene as well as various
additional annotations such as the true log fold change, the number of
isoforms of the gene and the average expression level.
cobradata_example
cobradata_example
A COBRAData
object with five slots:
data frame with p-values for 2,399 genes, from three different methods.
data frame with adjusted p-values for 2,399 genes, from two different methods.
empty data frame
data frame with estimated absolute log fold changes for 2,399 genes, from three different methods.
data frame with true differential expression status (status column), the number of isoforms (n_isoforms column), the true absolute log fold change (logFC and logFC_cat columns) and average expression level (expr and expr_cat columns) for 3,858 genes.
A COBRAData
object.
A data set consisting of p-values, adjusted p-values, s-values and estimated
log fold changes (in the 'scores' slot) obtained by three methods for
differential expression analysis of RNA-seq data, applied to a small
synthetic data set of 3,858 human genes. The values are stored in a
COBRAData
object together with a 'truth' data frame containing the
true differential expression status for each gene as well as various
additional annotations such as the true log fold change, the number of
isoforms of the gene and the average expression level.
cobradata_example_sval
cobradata_example_sval
A COBRAData
object with five slots:
data frame with p-values for 2,399 genes, from three different methods.
data frame with adjusted p-values for 2,399 genes, from two different methods.
data frame representing s-values for 2,399 genes, from two different methods. Since the purpose of this data set is only to demonstrate functionality, the s-values were obtained by copying the adjusted p-value slot, and thus these values do not represent true s-values.
data frame with estimated log fold changes for 2,399 genes, from three different methods.
data frame with true differential expression status (status column), the number of isoforms (n_isoforms column), the true log fold change (logFC and logFC_cat columns) and average expression level (expr and expr_cat columns) for 3,858 genes.
A COBRAData
object.
COBRAData
object and constructorThe COBRAData
class contains slots to hold calculated p-values,
adjusted p-values and general 'scores' for a set of features, as well as
s-values (see Stephens (2017)). The slots can contain values from multiple
methods, and each method can contribute to one or more slots. The class also
contains a slot giving the 'truth' (a binary assignment and/or a continuous
score) for each feature, as well as additional annotations that can be used
to stratify the performance calculations.
COBRAData( pval = data.frame(), padj = data.frame(), score = data.frame(), sval = data.frame(), truth = data.frame(), object_to_extend = NULL ) COBRAData_from_text(truth_file, result_files, feature_id) COBRAData_to_text(cobradata, truth_file, result_files, feature_id)
COBRAData( pval = data.frame(), padj = data.frame(), score = data.frame(), sval = data.frame(), truth = data.frame(), object_to_extend = NULL ) COBRAData_from_text(truth_file, result_files, feature_id) COBRAData_to_text(cobradata, truth_file, result_files, feature_id)
pval |
A data frame with features as rows and methods as columns,
containing nominal p-values. Missing values ( |
padj |
A data frame with features as rows and methods as columns,
containing adjusted p-values. Missing values ( |
score |
A data frame with features as rows and methods as columns,
containing generic scores. In case of comparison to a binary truth, larger
values of the scores should correspond to 'more significant' features.
Missing values ( |
sval |
A data frame with features as rows and methods as columns,
containing s-values (analogous to q-values, but for sign errors, see
Stephens (2017)). Missing values ( |
truth |
A data frame with features as rows columns containing feature annotations such as, e.g., binary and continuous truths and additional annotations that can be used to stratify the performance calculations. The row names should be feature names. |
object_to_extend |
A |
truth_file |
A character string giving the path to a file with true labels and other feature annotations. |
result_files |
A character vector giving path(s) to file(s) with results (p-values, adjusted p-values, s-values, scores) for one or more methods. The column names of these files must be of the form "method:measure", where measure is one of P, adjP, S or score, depending on what is given in the column. |
feature_id |
A character string giving the name of the column in the truth and result files that encodes the feature identifier. |
cobradata |
A |
If adjusted p-values are missing for some methods, for which nominal p-values
are available, the adjusted p-values can be calculated using the
calculate_adjp
function.
The text files generated by COBRAData_to_text
can be used as input to
iCOBRAapp
, when it is called without an input argument.
COBRAData
and COBRAData_from_text
return a
COBRAData
object.
Charlotte Soneson
## Empty COBRAData object: COBRAData() ## COBRAData object from individual data frames set.seed(123) pval <- data.frame(m1 = runif(100), m2 = runif(100), row.names = paste0("F", 1:100)) truth <- data.frame(status = round(runif(100)), row.names = paste0("F", 1:100)) cobradata <- COBRAData(pval = pval, truth = truth)
## Empty COBRAData object: COBRAData() ## COBRAData object from individual data frames set.seed(123) pval <- data.frame(m1 = runif(100), m2 = runif(100), row.names = paste0("F", 1:100)) truth <- data.frame(status = round(runif(100)), row.names = paste0("F", 1:100)) cobradata <- COBRAData(pval = pval, truth = truth)
COBRAPerformance
object and constructorThe COBRAPerformance
class holds various types of calculated
performance measures. Objects from this class are typically generated from
COBRAData
objects by means of the function
calculate_performance
.
COBRAPerformance( fdrtpr = data.frame(), fdrtprcurve = data.frame(), fdrnbr = data.frame(), fdrnbrcurve = data.frame(), fsrnbr = data.frame(), fsrnbrcurve = data.frame(), tpr = data.frame(), fpr = data.frame(), splv = "", roc = data.frame(), fpc = data.frame(), deviation = data.frame(), onlyshared = NA, overlap = data.frame(), maxsplit = NA_integer_, corr = data.frame(), scatter = data.frame() )
COBRAPerformance( fdrtpr = data.frame(), fdrtprcurve = data.frame(), fdrnbr = data.frame(), fdrnbrcurve = data.frame(), fsrnbr = data.frame(), fsrnbrcurve = data.frame(), tpr = data.frame(), fpr = data.frame(), splv = "", roc = data.frame(), fpc = data.frame(), deviation = data.frame(), onlyshared = NA, overlap = data.frame(), maxsplit = NA_integer_, corr = data.frame(), scatter = data.frame() )
fdrtpr |
A data frame containing observed FDR and TPR values at various adjusted p-value thresholds. |
fdrtprcurve |
A data frame containing observed FDR and TPR values for a (potentially large) number of cutoffs applied to a 'score' (that can be p-value, adjusted p-value or a more general score). |
fdrnbr |
A data frame containing observed FDR and the number of features considered to be significant at various adjusted p-value thresholds. |
fdrnbrcurve |
A data frame containing observed FDR and number of features considered to be significant for a (potentially large) number of cutoffs applied to a 'score' (that can be p-value, adjusted p-value or a more general score). |
fsrnbr |
A data frame containing observed false sign rate (FSR) and the number of features considered to be significant at various s-value thresholds |
fsrnbrcurve |
A data frame containing observed false sign rate (FSR) and number of features considered to be significant for a (potentially large) number of cutoffs applied to the s-value |
tpr |
A data frame containing observed TPR values at various adjusted p-value thresholds. |
fpr |
A data frame containing observed FPR values at various adjusted p-value thresholds. |
splv |
A character string giving the name of the stratification factor, "none" if the results are not stratified. |
roc |
A data frame containing observed FPR and TPR values for a (potentially large) number of cutoffs applied to a 'score' (that can be p-value, adjusted p-value or a more general score), which can be used to generate a ROC curve. |
fpc |
A data frame containing observed numbers of false positive findings among the N top-ranked features (ranked by p-values, adjusted p-values or more general scores), for a (potentially large) number of Ns, which can be used to generate a false positive curve. |
deviation |
A data frame containing deviations between observed scores and true scores. |
onlyshared |
A logical value indicating whether only features shared between the results and the truth should be retained, or if all features present in the truth should be used. |
overlap |
A data frame or list of data frames with binary values indicating, for each of a number of methods and number of features, whether the method consider the feature 'positive' (significant, 1) or 'negative' (non-significant, 0). If it is a list of data frames, each list element corresponds to one level of a stratifying factor. |
maxsplit |
A numeric value indicating the largest number of levels to retain if the results have been stratified by an annotation. |
corr |
A data frame containing observed (Pearson and Spearman) correlation values between observed and true scores. |
scatter |
A data frame containing observed 'scores' (p-values, adjusted p-values or more general scores) and true scores, which can be used to generate scatter plots. |
A COBRAPerformance
object.
Charlotte Soneson
## Empty COBRAPerformance object COBRAPerformance()
## Empty COBRAPerformance object COBRAPerformance()
COBRAPlot
object and constructorThe COBRAPlot
class is similar to the COBRAPerformance
class in
that it holds various types of calculated performance measures. However, it
also contains other attributes that are necessary for plotting, such as color
assignments. Several COBRAPlot
objects can be generated from the same
COBRAPerformance
object, without having to go through the potentially
time consuming task of recalculating all performance measures. Objects from
this class are typically generated from a COBRAPerformance
objects by
means of the function prepare_data_for_plot
.
COBRAPlot( fdrtpr = data.frame(), fdrtprcurve = data.frame(), fsrnbr = data.frame(), fsrnbrcurve = data.frame(), fdrnbr = data.frame(), corr = data.frame(), fdrnbrcurve = data.frame(), tpr = data.frame(), fpr = data.frame(), roc = data.frame(), scatter = data.frame(), onlyshared = NA, fpc = data.frame(), overlap = data.frame(), plotcolors = "", splv = "", deviation = data.frame(), maxsplit = NA_integer_, facetted = NA )
COBRAPlot( fdrtpr = data.frame(), fdrtprcurve = data.frame(), fsrnbr = data.frame(), fsrnbrcurve = data.frame(), fdrnbr = data.frame(), corr = data.frame(), fdrnbrcurve = data.frame(), tpr = data.frame(), fpr = data.frame(), roc = data.frame(), scatter = data.frame(), onlyshared = NA, fpc = data.frame(), overlap = data.frame(), plotcolors = "", splv = "", deviation = data.frame(), maxsplit = NA_integer_, facetted = NA )
fdrtpr |
A data frame containing observed FDR and TPR values at various adjusted p-value thresholds. |
fdrtprcurve |
A data frame containing observed FDR and TPR values for a (potentially large) number of cutoffs applied to a 'score' (that can be p-value, adjusted p-value or a more general score). |
fsrnbr |
A data frame containing observed false sign rate (FSR) and the number of features considered to be significant at various s-value thresholds |
fsrnbrcurve |
A data frame containing observed false sign rate (FSR) and number of features considered to be significant for a (potentially large) number of cutoffs applied to the s-value |
fdrnbr |
A data frame containing observed FDR and the number of features considered to be significant at various adjusted p-value thresholds. |
corr |
A data frame containing observed (Pearson and Spearman) correlation values between observed and true scores. |
fdrnbrcurve |
A data frame containing observed FDR and number of features considered to be significant for a (potentially large) number of cutoffs applied to a 'score' (that can be p-value, adjusted p-value or a more general score). |
tpr |
A data frame containing observed TPR values at various adjusted p-value thresholds. |
fpr |
A data frame containing observed FPR values at various adjusted p-value thresholds. |
roc |
A data frame containing observed FPR and TPR values for a (potentially large) number of cutoffs applied to a 'score' (that can be p-value, adjusted p-value or a more general score), which can be used to generate a ROC curve. |
scatter |
A data frame containing observed 'scores' (p-values, adjusted p-values or more general scores) and true scores, which can be used to generate scatter plots. |
onlyshared |
A logical value indicating whether only features shared between the results and the truth should be retained, or if all features present in the truth should be used. |
fpc |
A data frame containing observed numbers of false positive findings among the N top-ranked features (ranked by p-values, adjusted p-values or more general scores), for a (potentially large) number of Ns, which can be used to generate a false positive curve. |
overlap |
A data frame or list of data frames with binary values indicating, for each of a number of methods and number of features, whether the method consider the feature 'positive' (significant, 1) or 'negative' (non-significant, 0). If it is a list of data frames, each list element corresponds to one level of a stratifying factor. |
plotcolors |
A character vector giving the color for each method (or method-stratification level combination). |
splv |
A character string giving the name of the stratification factor, "none" if the results are not stratified. |
deviation |
A data frame containing deviations between observed scores and true scores. |
maxsplit |
A numeric value indicating the largest number of levels to retain if the results have been stratified by an annotation. |
facetted |
A logical indicating whether the data is prepared for a facetted plot (separating different stratification levels into different panels) or for displaying all values in one plot panel. |
A COBRAPlot
object.
Charlotte Soneson
## Empty COBRAPlot object cobraplot <- COBRAPlot()
## Empty COBRAPlot object cobraplot <- COBRAPlot()
Convert object between COBRAPerformance
and COBRAPlot
classes.
from |
The object that is to be coerced into another class. |
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrtpr") cobraplot <- prepare_data_for_plot(cobraperf) ## Coerce COBRAPerformance object into COBRAPlot object as(cobraperf, "COBRAPlot") ## Coerce COBRAPlot object into COBRAPerformance object as(cobraplot, "COBRAPerformance")
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrtpr") cobraplot <- prepare_data_for_plot(cobraperf) ## Coerce COBRAPerformance object into COBRAPlot object as(cobraperf, "COBRAPlot") ## Coerce COBRAPlot object into COBRAPerformance object as(cobraplot, "COBRAPerformance")
corr
slotAccessor and replacement functions for the corr
slot in a
COBRAPerformance
or COBRAPlot
object.
corr(x, ...) corr(x, ...) <- value ## S4 method for signature 'COBRAPerformance' corr(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' corr(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' corr(x) <- value
corr(x, ...) corr(x, ...) <- value ## S4 method for signature 'COBRAPerformance' corr(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' corr(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' corr(x) <- value
x |
A |
... |
Additional arguments. |
value |
A data frame giving correlation values for each method and each stratification level. |
The accessor function returns a data frame giving correlation values for each method and each stratification level.
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, cont_truth = "logFC", aspects = "corr") head(corr(cobraperf))
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, cont_truth = "logFC", aspects = "corr") head(corr(cobraperf))
deviation
slotAccessor and replacement functions for the deviation
slot in a
COBRAPerformance
or COBRAPlot
object.
deviation(x, ...) deviation(x, ...) <- value ## S4 method for signature 'COBRAPerformance' deviation(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' deviation(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' deviation(x) <- value
deviation(x, ...) deviation(x, ...) <- value ## S4 method for signature 'COBRAPerformance' deviation(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' deviation(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' deviation(x) <- value
x |
A |
... |
Additional arguments. |
value |
A data frame giving information necessary to plots of deviations between observed and true scores for each method and each stratification level. |
The accessor function returns a data frame giving information necessary to plots of deviations between observed and true scores for each method and each stratification level.
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, cont_truth = "logFC", aspects = "deviation") head(deviation(cobraperf))
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, cont_truth = "logFC", aspects = "deviation") head(deviation(cobraperf))
COBRAData
, COBRAPerformance
or COBRAPlot
objectsFunctions to subset COBRAData
, COBRAPerformance
or
COBRAPlot
objects. COBRAData
objects are subset by features
(rows), while COBRAPerformance
and COBRAPlot
objects are subset
by methods (columns). Numeric indices are not allowed, since not all slots
may be arranged in the same order.
## S4 method for signature 'COBRAData' x[i, j = "missing", drop = "missing"] ## S4 method for signature 'COBRAPerformance' x[i = "missing", j, drop = "missing"] ## S4 method for signature 'COBRAPlot' x[i = "missing", j, drop = "missing"]
## S4 method for signature 'COBRAData' x[i, j = "missing", drop = "missing"] ## S4 method for signature 'COBRAPerformance' x[i = "missing", j, drop = "missing"] ## S4 method for signature 'COBRAPlot' x[i = "missing", j, drop = "missing"]
x |
A |
i |
For |
j |
For |
drop |
not used. |
A subset of the original object, of the same class
data(cobradata_example) cobradata_example[c("ENSG00000000457", "ENSG00000000971", "ENSG00000000460"), ] cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrtpr") cobraperf[, c("voom")] cobraplot <- prepare_data_for_plot(cobraperf) cobraplot[, c("voom")]
data(cobradata_example) cobradata_example[c("ENSG00000000457", "ENSG00000000971", "ENSG00000000460"), ] cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrtpr") cobraperf[, c("voom")] cobraplot <- prepare_data_for_plot(cobraperf) cobraplot[, c("voom")]
facetted
slotAccessor and replacement functions for the facetted
slot in an
COBRAPlot
object.
facetted(x, ...) facetted(x, ...) <- value ## S4 method for signature 'COBRAPlot' facetted(x) ## S4 replacement method for signature 'COBRAPlot,logical' facetted(x) <- value
facetted(x, ...) facetted(x, ...) <- value ## S4 method for signature 'COBRAPlot' facetted(x) ## S4 replacement method for signature 'COBRAPlot,logical' facetted(x) <- value
x |
A |
... |
Additional arguments. |
value |
A logical value, indicating whether the object is formatted for facetted plots (visualizing each stratification level in a separate panel) or not. |
The accessor function returns a logical value, indicating whether the object is formatted for facetted plots (visualizing each stratification level in a separate panel) or not.
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrtpr") cobraplot <- prepare_data_for_plot(cobraperf) facetted(cobraplot)
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrtpr") cobraplot <- prepare_data_for_plot(cobraperf) facetted(cobraplot)
fdrnbr
slotAccessor and replacement functions for the fdrnbr
slot in a
COBRAPerformance
or COBRAPlot
object.
fdrnbr(x, ...) fdrnbr(x, ...) <- value ## S4 method for signature 'COBRAPerformance' fdrnbr(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' fdrnbr(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' fdrnbr(x) <- value
fdrnbr(x, ...) fdrnbr(x, ...) <- value ## S4 method for signature 'COBRAPerformance' fdrnbr(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' fdrnbr(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' fdrnbr(x) <- value
x |
A |
... |
Additional arguments. |
value |
A data frame giving information about the observed FPR and the number of features called positive for each method and each stratification level, at various adjusted p-value thresholds. |
The accessor function returns a data frame giving information about the observed FPR and the number of features called positive for each method and each stratification level, at various adjusted p-value thresholds.
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrnbr") head(fdrnbr(cobraperf))
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrnbr") head(fdrnbr(cobraperf))
fdrnbrcurve
slotAccessor and replacement functions for the fdrnbrcurve
slot in a
COBRAPerformance
or COBRAPlot
object.
fdrnbrcurve(x, ...) fdrnbrcurve(x, ...) <- value ## S4 method for signature 'COBRAPerformance' fdrnbrcurve(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' fdrnbrcurve(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' fdrnbrcurve(x) <- value
fdrnbrcurve(x, ...) fdrnbrcurve(x, ...) <- value ## S4 method for signature 'COBRAPerformance' fdrnbrcurve(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' fdrnbrcurve(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' fdrnbrcurve(x) <- value
x |
A |
... |
Additional arguments. |
value |
A data frame giving information necessary to generate curves of observed FDR vs number of features called positive for each method and each stratification level. |
The accessor function returns a data frame giving information necessary to generate curves of observed FDR vs number of features called positive for each method and each stratification level.
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrnbrcurve") head(fdrnbrcurve(cobraperf))
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrnbrcurve") head(fdrnbrcurve(cobraperf))
fdrtpr
slotAccessor and replacement functions for the fdrtpr
slot in a
COBRAPerformance
or COBRAPlot
object.
fdrtpr(x, ...) fdrtpr(x, ...) <- value ## S4 method for signature 'COBRAPerformance' fdrtpr(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' fdrtpr(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' fdrtpr(x) <- value
fdrtpr(x, ...) fdrtpr(x, ...) <- value ## S4 method for signature 'COBRAPerformance' fdrtpr(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' fdrtpr(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' fdrtpr(x) <- value
x |
A |
... |
Additional arguments. |
value |
A data frame giving information about the observed FPR and TPR for each method and each stratification level, at various adjusted p-value thresholds. |
The accessor function returns a data frame giving information about the observed FPR and TPR for each method and each stratification level, at various adjusted p-value thresholds.
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrtpr") head(fdrtpr(cobraperf))
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrtpr") head(fdrtpr(cobraperf))
fdrtprcurve
slotAccessor and replacement functions for the fdrtprcurve
slot in a
COBRAPerformance
or COBRAPlot
object.
fdrtprcurve(x, ...) fdrtprcurve(x, ...) <- value ## S4 method for signature 'COBRAPerformance' fdrtprcurve(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' fdrtprcurve(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' fdrtprcurve(x) <- value
fdrtprcurve(x, ...) fdrtprcurve(x, ...) <- value ## S4 method for signature 'COBRAPerformance' fdrtprcurve(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' fdrtprcurve(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' fdrtprcurve(x) <- value
x |
A |
... |
Additional arguments. |
value |
A data frame giving information necessary to generate curves of observed FDR vs TPR for each method and each stratification level. |
The accessor function returns a data frame giving information necessary to generate curves of observed FDR vs TPR for each method and each stratification level.
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrtprcurve") head(fdrtprcurve(cobraperf))
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrtprcurve") head(fdrtprcurve(cobraperf))
fpc
slotAccessor and replacement functions for the fpc
slot in a
COBRAPerformance
or COBRAPlot
object.
fpc(x, ...) fpc(x, ...) <- value ## S4 method for signature 'COBRAPerformance' fpc(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' fpc(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' fpc(x) <- value
fpc(x, ...) fpc(x, ...) <- value ## S4 method for signature 'COBRAPerformance' fpc(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' fpc(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' fpc(x) <- value
x |
A |
... |
Additional arguments. |
value |
A data frame giving information necessary to generate false positive curves for each method and each stratification level. |
The accessor function returns a data frame giving information necessary to generate false positive curves for each method and each stratification level.
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fpc") head(fpc(cobraperf))
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fpc") head(fpc(cobraperf))
fpr
slotAccessor and replacement functions for the fpr
slot in a
COBRAPerformance
or COBRAPlot
object.
fpr(x, ...) fpr(x, ...) <- value ## S4 method for signature 'COBRAPerformance' fpr(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' fpr(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' fpr(x) <- value
fpr(x, ...) fpr(x, ...) <- value ## S4 method for signature 'COBRAPerformance' fpr(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' fpr(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' fpr(x) <- value
x |
A |
... |
Additional arguments. |
value |
A data frame giving information about the observed FPR for each method and each stratification level, at various adjusted p-value thresholds. |
The accessor function returns a data frame giving information about the observed FPR for each method and each stratification level, at various adjusted p-value thresholds.
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fpr") head(fpr(cobraperf))
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fpr") head(fpr(cobraperf))
fsrnbr
slotAccessor and replacement functions for the fsrnbr
slot in a
COBRAPerformance
or COBRAPlot
object.
fsrnbr(x, ...) fsrnbr(x, ...) <- value ## S4 method for signature 'COBRAPerformance' fsrnbr(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' fsrnbr(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' fsrnbr(x) <- value
fsrnbr(x, ...) fsrnbr(x, ...) <- value ## S4 method for signature 'COBRAPerformance' fsrnbr(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' fsrnbr(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' fsrnbr(x) <- value
x |
A |
... |
Additional arguments. |
value |
A data frame giving information about the observed FSR and the number of features called positive for each method and each stratification level, at various s-value thresholds. If the object does not have an fsrnbr slot (older versions of the class did not have this slot), an empty data frame is returned for simplicity. |
The accessor function returns a data frame giving information about the observed FSR and the number of features called positive for each method and each stratification level, at various s-value thresholds.
Charlotte Soneson
cobradata <- cobradata_example_sval cobraperf <- calculate_performance(cobradata, cont_truth = "logFC", aspects = "fsrnbr") head(fsrnbr(cobraperf))
cobradata <- cobradata_example_sval cobraperf <- calculate_performance(cobradata, cont_truth = "logFC", aspects = "fsrnbr") head(fsrnbr(cobraperf))
fsrnbrcurve
slotAccessor and replacement functions for the fsrnbrcurve
slot in a
COBRAPerformance
or COBRAPlot
object.
fsrnbrcurve(x, ...) fsrnbrcurve(x, ...) <- value ## S4 method for signature 'COBRAPerformance' fsrnbrcurve(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' fsrnbrcurve(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' fsrnbrcurve(x) <- value
fsrnbrcurve(x, ...) fsrnbrcurve(x, ...) <- value ## S4 method for signature 'COBRAPerformance' fsrnbrcurve(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' fsrnbrcurve(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' fsrnbrcurve(x) <- value
x |
A |
... |
Additional arguments. |
value |
A data frame giving information necessary to generate curves of observed FSR vs number of features called positive for each method and each stratification level. If the object does not have an fsrnbrcurve slot (older versions of the class did not have this slot), an empty data frame is returned for simplicity. |
The accessor function returns a data frame giving information necessary to generate curves of observed FSR vs number of features called positive for each method and each stratification level.
Charlotte Soneson
cobradata <- cobradata_example_sval cobraperf <- calculate_performance(cobradata, cont_truth = "logFC", aspects = "fsrnbrcurve") head(fsrnbrcurve(cobraperf))
cobradata <- cobradata_example_sval cobraperf <- calculate_performance(cobradata, cont_truth = "logFC", aspects = "fsrnbrcurve") head(fsrnbrcurve(cobraperf))
maxsplit
slotAccessor and replacement functions for the maxsplit
slot in a
COBRAPerformance
or COBRAPlot
object.
maxsplit(x, ...) maxsplit(x, ...) <- value ## S4 method for signature 'COBRAPerformance' maxsplit(x) ## S4 replacement method for signature 'COBRAPerformance,numeric' maxsplit(x) <- value ## S4 replacement method for signature 'COBRAPlot,numeric' maxsplit(x) <- value
maxsplit(x, ...) maxsplit(x, ...) <- value ## S4 method for signature 'COBRAPerformance' maxsplit(x) ## S4 replacement method for signature 'COBRAPerformance,numeric' maxsplit(x) <- value ## S4 replacement method for signature 'COBRAPlot,numeric' maxsplit(x) <- value
x |
A |
... |
Additional arguments. |
value |
A numeric value giving the maximal number of strata to retain. |
The accessor function returns a numeric value giving the maximal number of strata to retain.
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrtpr", splv = "expr_cat", maxsplit = 3) maxsplit(cobraperf)
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrtpr", splv = "expr_cat", maxsplit = 3) maxsplit(cobraperf)
overlap
slotAccessor and replacement functions for the overlap
slot in a
COBRAPerformance
or COBRAPlot
object.
overlap(x, ...) overlap(x, ...) <- value ## S4 method for signature 'COBRAPerformance' overlap(x) ## S4 replacement method for signature 'COBRAPerformance,list_df' overlap(x) <- value ## S4 replacement method for signature 'COBRAPlot,list_df' overlap(x) <- value
overlap(x, ...) overlap(x, ...) <- value ## S4 method for signature 'COBRAPerformance' overlap(x) ## S4 replacement method for signature 'COBRAPerformance,list_df' overlap(x) <- value ## S4 replacement method for signature 'COBRAPlot,list_df' overlap(x) <- value
x |
A |
... |
Additional arguments. |
value |
A data frame or a list, giving information about which feature that are classified as 'positive' by each method and for each stratification level. |
The accessor function returns a data frame or a list, giving information about which feature that are classified as 'positive' by each method and for each stratification level.
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "overlap") head(overlap(cobraperf))
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "overlap") head(overlap(cobraperf))
padj
slotAccessor and replacement functions for the padj
slot in a
COBRAData
object.
padj(x, ...) padj(x, ...) <- value ## S4 method for signature 'COBRAData' padj(x) ## S4 replacement method for signature 'COBRAData,data.frame' padj(x) <- value
padj(x, ...) padj(x, ...) <- value ## S4 method for signature 'COBRAData' padj(x) ## S4 replacement method for signature 'COBRAData,data.frame' padj(x) <- value
x |
A |
... |
Additional arguments. |
value |
A data frame containing adjusted p-values for each feature and each method. |
The accessor function returns a data frame containing adjusted p-values for each feature and each method.
Charlotte Soneson
data(cobradata_example) head(padj(cobradata_example))
data(cobradata_example) head(padj(cobradata_example))
Plot correlations between observations and a continuous truth value.
plot_corr( cobraplot, title = "", stripsize = 15, titlecol = "black", pointsize = 5, xaxisrange = c(-1, 1), corrtype = "pearson" )
plot_corr( cobraplot, title = "", stripsize = 15, titlecol = "black", pointsize = 5, xaxisrange = c(-1, 1), corrtype = "pearson" )
cobraplot |
A |
title |
A character string giving the title of the plot. |
stripsize |
A numeric value giving the size of the strip text, when the results are stratified by an annotation. |
titlecol |
A character string giving the color of the title. |
pointsize |
A numeric value giving the size of the plot characters. |
xaxisrange |
A numeric vector with two elements, giving the lower and upper boundary of the x-axis, respectively. |
corrtype |
A character string giving the type of correlation to show. Either "pearson" or "spearman". |
A ggplot object
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, cont_truth = "logFC", aspects = "corr") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_corr(cobraplot, corrtype = "spearman")
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, cont_truth = "logFC", aspects = "corr") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_corr(cobraplot, corrtype = "spearman")
Plot the deviations between observed scores and the continuous truth variable.
plot_deviation( cobraplot, title = "", stripsize = 15, titlecol = "black", xaxisrange = NULL, plottype = "boxplot", dojitter = TRUE, transf = "raw" )
plot_deviation( cobraplot, title = "", stripsize = 15, titlecol = "black", xaxisrange = NULL, plottype = "boxplot", dojitter = TRUE, transf = "raw" )
cobraplot |
A |
title |
A character string giving the title of the plot. |
stripsize |
A numeric value giving the size of the strip text, when the results are stratified by an annotation. |
titlecol |
A character string giving the color of the title. |
xaxisrange |
A numeric vector with two elements, giving the lower and upper boundary of the x-axis, respectively. |
plottype |
Either "boxplot" or "violinplot", indicating what type of plot to make. |
dojitter |
A logical indicating whether to include jittered data points or not. |
transf |
A character indicating the transformation to apply to the deviations before plotting. Must be one of "raw", "absolute" or "squared" |
A ggplot object
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, cont_truth = "logFC", aspects = "deviation") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_deviation(cobraplot)
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, cont_truth = "logFC", aspects = "deviation") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_deviation(cobraplot)
Plot the number of features considered significant vs observed false discovery rate (FDR), for given adjusted p-value thresholds and/or as curves traced out by considering all threshold values.
plot_fdrnbrcurve( cobraplot, title = "", stripsize = 15, titlecol = "black", pointsize = 5, xaxisrange = c(0, 1), plottype = c("curve", "points"), linewidth = 1 )
plot_fdrnbrcurve( cobraplot, title = "", stripsize = 15, titlecol = "black", pointsize = 5, xaxisrange = c(0, 1), plottype = c("curve", "points"), linewidth = 1 )
cobraplot |
A |
title |
A character string giving the title of the plot. |
stripsize |
A numeric value giving the size of the strip text, when the results are stratified by an annotation. |
titlecol |
A character string giving the color of the title. |
pointsize |
A numeric value giving the size of the plot characters. |
xaxisrange |
A numeric vector with two elements, giving the lower and upper boundary of the x-axis, respectively. |
plottype |
A character vector giving the type of plot to construct. Can be any combination of the two elements "curve" and "points". |
linewidth |
The line width used for plotting |
A ggplot object
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = c("fdrnbr", "fdrnbrcurve")) cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_fdrnbrcurve(cobraplot, plottype = c("curve", "points"))
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = c("fdrnbr", "fdrnbrcurve")) cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_fdrnbrcurve(cobraplot, plottype = c("curve", "points"))
Plot observed true positive rate (TPR) vs observed false discovery rate (FDR), for given adjusted p-value thresholds and/or as curves traced out by considering all threshold values.
plot_fdrtprcurve( cobraplot, title = "", stripsize = 15, titlecol = "black", pointsize = 5, xaxisrange = c(0, 1), yaxisrange = c(0, 1), plottype = c("curve", "points"), linewidth = 1 )
plot_fdrtprcurve( cobraplot, title = "", stripsize = 15, titlecol = "black", pointsize = 5, xaxisrange = c(0, 1), yaxisrange = c(0, 1), plottype = c("curve", "points"), linewidth = 1 )
cobraplot |
A |
title |
A character string giving the title of the plot. |
stripsize |
A numeric value giving the size of the strip text, when the results are stratified by an annotation. |
titlecol |
A character string giving the color of the title. |
pointsize |
A numeric value giving the size of the plot characters. |
xaxisrange |
A numeric vector with two elements, giving the lower and upper boundary of the x-axis, respectively. |
yaxisrange |
A numeric vector with two elements, giving the lower and upper boundary of the y-axis, respectively. |
plottype |
A character vector giving the type of plot to construct. Can be any combination of the two elements "curve" and "points". |
linewidth |
The line width used for plotting |
A ggplot object
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = c("fdrtpr", "fdrtprcurve")) cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_fdrtprcurve(cobraplot, plottype = c("curve", "points"))
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = c("fdrtpr", "fdrtprcurve")) cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_fdrtprcurve(cobraplot, plottype = c("curve", "points"))
Plot false positive curves, indicating the number of false positives among the top-ranked N variables, for varying values of N.
plot_fpc( cobraplot, title = "", stripsize = 15, titlecol = "black", maxnfdc = 500, linewidth = 1 )
plot_fpc( cobraplot, title = "", stripsize = 15, titlecol = "black", maxnfdc = 500, linewidth = 1 )
cobraplot |
A |
title |
A character string giving the title of the plot. |
stripsize |
A numeric value giving the size of the strip text, when the results are stratified by an annotation. |
titlecol |
A character string giving the color of the title. |
maxnfdc |
A numeric value giving the largest N to consider. |
linewidth |
The line width used for plotting |
A ggplot object
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fpc") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_fpc(cobraplot, maxnfdc = 750)
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fpc") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_fpc(cobraplot, maxnfdc = 750)
Plot observed false positive rate (FPR) for given adjusted p-value thresholds.
plot_fpr( cobraplot, title = "", stripsize = 15, titlecol = "black", pointsize = 5, xaxisrange = c(0, 1) )
plot_fpr( cobraplot, title = "", stripsize = 15, titlecol = "black", pointsize = 5, xaxisrange = c(0, 1) )
cobraplot |
A |
title |
A character string giving the title of the plot. |
stripsize |
A numeric value giving the size of the strip text, when the results are stratified by an annotation. |
titlecol |
A character string giving the color of the title. |
pointsize |
A numeric value giving the size of the plot characters. |
xaxisrange |
A numeric vector with two elements, giving the lower and upper boundary of the x-axis, respectively. |
A ggplot object
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fpr") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_fpr(cobraplot, xaxisrange = c(0, 0.25))
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fpr") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_fpr(cobraplot, xaxisrange = c(0, 0.25))
Plot the number of features with an s-value below a threshold vs the observed false sign rate (FSR), for given adjusted p-value thresholds and/or as curves traced out by considering all threshold values.
plot_fsrnbrcurve( cobraplot, title = "", stripsize = 15, titlecol = "black", pointsize = 5, xaxisrange = c(0, 1), plottype = c("curve", "points"), linewidth = 1 )
plot_fsrnbrcurve( cobraplot, title = "", stripsize = 15, titlecol = "black", pointsize = 5, xaxisrange = c(0, 1), plottype = c("curve", "points"), linewidth = 1 )
cobraplot |
A |
title |
A character string giving the title of the plot. |
stripsize |
A numeric value giving the size of the strip text, when the results are stratified by an annotation. |
titlecol |
A character string giving the color of the title. |
pointsize |
A numeric value giving the size of the plot characters. |
xaxisrange |
A numeric vector with two elements, giving the lower and upper boundary of the x-axis, respectively. |
plottype |
A character vector giving the type of plot to construct. Can be any combination of the two elements "curve" and "points". |
linewidth |
The line width used for plotting |
A ggplot object
Charlotte Soneson
data(cobradata_example_sval) cobraperf <- calculate_performance(cobradata_example_sval, cont_truth = "logFC", aspects = c("fsrnbr", "fsrnbrcurve")) cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_fsrnbrcurve(cobraplot, plottype = c("curve", "points"))
data(cobradata_example_sval) cobraperf <- calculate_performance(cobradata_example_sval, cont_truth = "logFC", aspects = c("fsrnbr", "fsrnbrcurve")) cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_fsrnbrcurve(cobraplot, plottype = c("curve", "points"))
Plot a Venn diagram showing the overlaps among sets of significant feature
for a given adjusted p-value threshold (see thr_venn
argument of
calculate_performance
). Optionally, the truth can be included
as a "perfect" method. Note that maximally five methods (including the truth,
if applicable) can be compared.
plot_overlap(cobraplot, ...)
plot_overlap(cobraplot, ...)
cobraplot |
A |
... |
Additional arguments to |
Nothing, displays a graph
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "overlap") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_overlap(cobraplot)
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "overlap") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_overlap(cobraplot)
Plot receiver operating characteristics (ROC) curves.
plot_roc( cobraplot, title = "", stripsize = 15, titlecol = "black", xaxisrange = c(0, 1), yaxisrange = c(0, 1), linewidth = 1 )
plot_roc( cobraplot, title = "", stripsize = 15, titlecol = "black", xaxisrange = c(0, 1), yaxisrange = c(0, 1), linewidth = 1 )
cobraplot |
A |
title |
A character string giving the title of the plot. |
stripsize |
A numeric value giving the size of the strip text, when the results are stratified by an annotation. |
titlecol |
A character string giving the color of the title. |
xaxisrange |
A numeric vector with two elements, giving the lower and upper boundary of the x-axis, respectively. |
yaxisrange |
A numeric vector with two elements, giving the lower and upper boundary of the y-axis, respectively. |
linewidth |
The line width used for plotting |
A ggplot object
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "roc") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_roc(cobraplot)
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "roc") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_roc(cobraplot)
Plot scatter plots, indicating the relationship between observed values and a continuous truth.
plot_scatter( cobraplot, title = "", stripsize = 10, titlecol = "black", pointsize = 3, doflip = FALSE, dolog = FALSE )
plot_scatter( cobraplot, title = "", stripsize = 10, titlecol = "black", pointsize = 3, doflip = FALSE, dolog = FALSE )
cobraplot |
A |
title |
A character string giving the title of the plot. |
stripsize |
A numeric value giving the size of the strip text, when the results are stratified by an annotation. |
titlecol |
A character string giving the color of the title. |
pointsize |
A numeric value giving the size of the plot characters. |
doflip |
A logical indicating whether to flip the axes when results are
stratified by an annotation. By default ( |
dolog |
A logical indicating whether to log10-transform values before plotting. |
A ggplot object
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, cont_truth = "logFC", aspects = "scatter") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_scatter(cobraplot)
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, cont_truth = "logFC", aspects = "scatter") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_scatter(cobraplot)
Plot observed true positive rate (TPR) for given adjusted p-value thresholds.
plot_tpr( cobraplot, title = "", stripsize = 15, titlecol = "black", pointsize = 5, xaxisrange = c(0, 1) )
plot_tpr( cobraplot, title = "", stripsize = 15, titlecol = "black", pointsize = 5, xaxisrange = c(0, 1) )
cobraplot |
A |
title |
A character string giving the title of the plot. |
stripsize |
A numeric value giving the size of the strip text, when the results are stratified by an annotation. |
titlecol |
A character string giving the color of the title. |
pointsize |
A numeric value giving the size of the plot characters. |
xaxisrange |
A numeric vector with two elements, giving the lower and upper boundary of the x-axis, respectively. |
A ggplot object
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "tpr") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_tpr(cobraplot)
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "tpr") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_tpr(cobraplot)
Generate UpSet plots showing the overlaps among sets of significant feature
for a given adjusted p-value threshold (see thr_venn
argument of
calculate_performance
). Optionally, the truth can be included
as a "perfect" method. Note that if the results are stratified, only one
category at a time can be displayed.
plot_upset( cobraplot, stratum = NULL, nsets = NULL, nintersects = NULL, sets.bar.color = NULL, ... )
plot_upset( cobraplot, stratum = NULL, nsets = NULL, nintersects = NULL, sets.bar.color = NULL, ... )
cobraplot |
A |
stratum |
If results are stratified, the category to plot results for. Can be numeric or categorical (the name of the category). |
nsets |
The number of methods to include. By default, it is determined
automatically from the |
nintersects |
The number of set intersections to display. By default, it
is determined automatically from the |
sets.bar.color |
The colors to use for the bars in the UpSet plot. By
default, they are extracted from the |
... |
Additional arguments to |
Nothing, displays a graph
Charlotte Soneson
Lex and Gehlenborg (2014): Points of view: Sets and intersections. Nature Methods 11, 779.
Lex et al (2014): UpSet: Visualization of intersecting sets. IEEE Transactions on Visualization and Computer Graphics 20(12), 1983-1992.
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "overlap") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_upset(cobraplot) plot_upset(cobraplot, order.by = "freq", decreasing = TRUE) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "overlap", splv = "expr_cat") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_upset(cobraplot, stratum = "[2.85e+00,1.45e+01)")
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "overlap") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_upset(cobraplot) plot_upset(cobraplot, order.by = "freq", decreasing = TRUE) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "overlap", splv = "expr_cat") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) plot_upset(cobraplot, stratum = "[2.85e+00,1.45e+01)")
plotcolors
slotAccessor and replacement functions for the plotcolors
slot in an
COBRAPlot
object.
plotcolors(x, ...) plotcolors(x, ...) <- value ## S4 method for signature 'COBRAPlot' plotcolors(x) ## S4 replacement method for signature 'COBRAPlot,character' plotcolors(x) <- value
plotcolors(x, ...) plotcolors(x, ...) <- value ## S4 method for signature 'COBRAPlot' plotcolors(x) ## S4 replacement method for signature 'COBRAPlot,character' plotcolors(x) <- value
x |
A |
... |
Additional arguments. |
value |
A character vector giving the colors assigned to each of the
methods (or method/stratification level combinations) represented in the
|
The accessor function returns a character vector giving the colors
assigned to each of the methods (or method/stratification level
combinations) represented in the COBRAPlot
object.
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrtpr") cobraplot <- prepare_data_for_plot(cobraperf) plotcolors(cobraplot)
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrtpr") cobraplot <- prepare_data_for_plot(cobraperf) plotcolors(cobraplot)
Prepare performance data provided in a COBRAPerformance
object
(obtained by calculate_performance
) for plotting.
prepare_data_for_plot( cobraperf, keepmethods = NULL, incloverall = TRUE, colorscheme = "hue_pal", facetted = TRUE, incltruth = TRUE, conditionalfill = TRUE )
prepare_data_for_plot( cobraperf, keepmethods = NULL, incloverall = TRUE, colorscheme = "hue_pal", facetted = TRUE, incltruth = TRUE, conditionalfill = TRUE )
cobraperf |
A |
keepmethods |
A character vector consisting of methods to retain for
plotting (these should be a subset of |
incloverall |
A logical indicating whether the "overall" results should be included if the results are stratified by an annotation. |
colorscheme |
Either a character string giving the color palette to use to define colors for the different methods, or a character vector with colors to use. The available pre-defined palettes depend on the number of different methods to distinguish. The choices are:
If the number of allowed methods is exceeded, the colorscheme defaults to
|
facetted |
A logical indicating whether the results should be split into
subpanels when stratified by an annotation ( |
incltruth |
A logical indicating whether the truth should be included in Venn diagrams. |
conditionalfill |
A logical indicating whether the points (in FDR/TPR, FDR/NBR, FSR/NBR plots) should be filled conditional on whether they satisfy the imposed criterion (e.g., false discovery rate control at imposed threshold). |
A COBRAPlot
object
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", cont_truth = "none", aspects = c("fdrtpr", "fdrtprcurve", "tpr", "roc"), thrs = c(0.01, 0.05, 0.1), splv = "none") cobraplot <- prepare_data_for_plot(cobraperf, keepmethods = NULL, colorscheme = "Dark2") ## User-specified colors cobraplot2 <- prepare_data_for_plot(cobraperf, keepmethods = NULL, colorscheme = c("blue", "red", "green"))
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", cont_truth = "none", aspects = c("fdrtpr", "fdrtprcurve", "tpr", "roc"), thrs = c(0.01, 0.05, 0.1), splv = "none") cobraplot <- prepare_data_for_plot(cobraperf, keepmethods = NULL, colorscheme = "Dark2") ## User-specified colors cobraplot2 <- prepare_data_for_plot(cobraperf, keepmethods = NULL, colorscheme = c("blue", "red", "green"))
pval
slotAccessor and replacement functions for the pval
slot in a
COBRAData
object.
pval(x, ...) pval(x, ...) <- value ## S4 method for signature 'COBRAData' pval(x) ## S4 replacement method for signature 'COBRAData,data.frame' pval(x) <- value
pval(x, ...) pval(x, ...) <- value ## S4 method for signature 'COBRAData' pval(x) ## S4 replacement method for signature 'COBRAData,data.frame' pval(x) <- value
x |
A |
... |
Additional arguments. |
value |
A data frame containing p-values for each feature and each method. |
The accessor function returns a data frame containing p-values for each feature and each method.
Charlotte Soneson
data(cobradata_example) head(pval(cobradata_example))
data(cobradata_example) head(pval(cobradata_example))
Reorder levels in COBRAPlot object to achieve desired ordering in figure legends etc. If facetted(cobraplot) is TRUE, the releveling will be applied to the "method" column. If facetted(cobraplot) is FALSE, it will be applied to the "fullmethod" column.
reorder_levels(cobraplot, levels)
reorder_levels(cobraplot, levels)
cobraplot |
A COBRAPlot object |
levels |
A character vector giving the order of the levels. Any values not present in the COBRAPlot object will be removed. Any methods present in the COBRAPlot object but not contained in this vector will be added at the end. |
A COBRAPlot object
Charlotte Soneson
data(cobradata_example_sval) cobraperf <- calculate_performance(cobradata_example_sval, binary_truth = "status", aspects = "fpr") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) cobraplot <- reorder_levels(cobraplot, c("Method2", "Method1"))
data(cobradata_example_sval) cobraperf <- calculate_performance(cobradata_example_sval, binary_truth = "status", aspects = "fpr") cobraplot <- prepare_data_for_plot(cobraperf, colorscheme = "Dark2", incltruth = TRUE) cobraplot <- reorder_levels(cobraplot, c("Method2", "Method1"))
roc
slotAccessor and replacement functions for the roc
slot in a
COBRAPerformance
or COBRAPlot
object.
roc(x, ...) roc(x, ...) <- value ## S4 method for signature 'COBRAPerformance' roc(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' roc(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' roc(x) <- value
roc(x, ...) roc(x, ...) <- value ## S4 method for signature 'COBRAPerformance' roc(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' roc(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' roc(x) <- value
x |
A |
... |
Additional arguments. |
value |
A data frame giving information necessary to generate ROC curves for each method and each stratification level. |
The accessor function returns a data frame giving information necessary to generate ROC curves for each method and each stratification level.
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "roc") head(roc(cobraperf))
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "roc") head(roc(cobraperf))
scatter
slotAccessor and replacement functions for the scatter
slot in a
COBRAPerformance
or COBRAPlot
object.
scatter(x, ...) scatter(x, ...) <- value ## S4 method for signature 'COBRAPerformance' scatter(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' scatter(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' scatter(x) <- value
scatter(x, ...) scatter(x, ...) <- value ## S4 method for signature 'COBRAPerformance' scatter(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' scatter(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' scatter(x) <- value
x |
A |
... |
Additional arguments. |
value |
A data frame giving information necessary to generate scatter plots of observed vs true values for each method and each stratification level. |
The accessor function returns a data frame giving information necessary to generate scatter plots of observed vs true values for each method and each stratification level.
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, cont_truth = "logFC", aspects = "scatter") head(scatter(cobraperf))
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, cont_truth = "logFC", aspects = "scatter") head(scatter(cobraperf))
score
slotAccessor and replacement functions for the score
slot in a
COBRAData
object.
score(x, ...) score(x, ...) <- value ## S4 method for signature 'COBRAData' score(x) ## S4 replacement method for signature 'COBRAData,data.frame' score(x) <- value
score(x, ...) score(x, ...) <- value ## S4 method for signature 'COBRAData' score(x) ## S4 replacement method for signature 'COBRAData,data.frame' score(x) <- value
x |
A |
... |
Additional arguments. |
value |
A data frame containing scores for each feature and each method. |
The accessor function regurns a data frame containing scores for each feature and each method.
Charlotte Soneson
data(cobradata_example) head(score(cobradata_example))
data(cobradata_example) head(score(cobradata_example))
splv
slotAccessor and replacement functions for the splv
slot in a
COBRAPerformance
or COBRAPlot
object.
splv(x, ...) splv(x, ...) <- value ## S4 method for signature 'COBRAPerformance' splv(x) ## S4 replacement method for signature 'COBRAPerformance,character' splv(x) <- value ## S4 replacement method for signature 'COBRAPlot,character' splv(x) <- value
splv(x, ...) splv(x, ...) <- value ## S4 method for signature 'COBRAPerformance' splv(x) ## S4 replacement method for signature 'COBRAPerformance,character' splv(x) <- value ## S4 replacement method for signature 'COBRAPlot,character' splv(x) <- value
x |
A |
... |
Additional arguments. |
value |
A character string giving the name of a feature annotation to use for stratification. |
The accessor function returns a character string giving the name of a feature annotation to use for stratification.
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrtpr", splv = "expr_cat") splv(cobraperf)
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrtpr", splv = "expr_cat") splv(cobraperf)
Accessor function to extract the stratification levels that are represented
in a COBRAPerformance
or COBRAPlot
object.
stratiflevels(x, ...) ## S4 method for signature 'COBRAPerformance' stratiflevels(x)
stratiflevels(x, ...) ## S4 method for signature 'COBRAPerformance' stratiflevels(x)
x |
A |
... |
Additional arguments |
A character vector of all stratification levels represented in the object
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrtpr", splv = "expr_cat", maxsplit = 4) stratiflevels(cobraperf)
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "fdrtpr", splv = "expr_cat", maxsplit = 4) stratiflevels(cobraperf)
sval
slotAccessor and replacement functions for the sval
slot in a
COBRAData
object.
sval(x, ...) sval(x, ...) <- value ## S4 method for signature 'COBRAData' sval(x) ## S4 replacement method for signature 'COBRAData,data.frame' sval(x) <- value
sval(x, ...) sval(x, ...) <- value ## S4 method for signature 'COBRAData' sval(x) ## S4 replacement method for signature 'COBRAData,data.frame' sval(x) <- value
x |
A |
... |
Additional arguments. |
value |
A data frame containing s-values for each feature and each method. If the object does not have an s-value slot (older versions of the class did not have this slot), an empty data frame is returned for simplicity. |
The accessor function returns a data frame containing s-values for each feature and each method.
Charlotte Soneson
data(cobradata_example) head(sval(cobradata_example))
data(cobradata_example) head(sval(cobradata_example))
tpr
slotAccessor and replacement functions for the tpr
slot in a
COBRAPerformance
or COBRAPlot
object.
tpr(x, ...) tpr(x, ...) <- value ## S4 method for signature 'COBRAPerformance' tpr(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' tpr(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' tpr(x) <- value
tpr(x, ...) tpr(x, ...) <- value ## S4 method for signature 'COBRAPerformance' tpr(x) ## S4 replacement method for signature 'COBRAPerformance,data.frame' tpr(x) <- value ## S4 replacement method for signature 'COBRAPlot,data.frame' tpr(x) <- value
x |
A |
... |
Additional arguments. |
value |
A data frame giving information about the observed TPR for each method and each stratification level, at various adjusted p-value thresholds. |
The accessor function returns a data frame giving information about the observed TPR for each method and each stratification level, at various adjusted p-value thresholds.
Charlotte Soneson
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "tpr") head(tpr(cobraperf))
data(cobradata_example) cobraperf <- calculate_performance(cobradata_example, binary_truth = "status", aspects = "tpr") head(tpr(cobraperf))
truth
slotAccessor and replacement functions for the truth
slot in a
COBRAData
object.
truth(x, ...) truth(x, ...) <- value ## S4 method for signature 'COBRAData' truth(x) ## S4 replacement method for signature 'COBRAData,data.frame' truth(x) <- value
truth(x, ...) truth(x, ...) <- value ## S4 method for signature 'COBRAData' truth(x) ## S4 replacement method for signature 'COBRAData,data.frame' truth(x) <- value
x |
A |
... |
Additional arguments. |
value |
A data frame containing true assignments and/or scores for features, together with other feature annotations to use for stratification of performance calculations. |
The accessor function returns a data frame containing true assignments and/or scores for features, together with other feature annotations to use for stratification of performance calculations.
Charlotte Soneson
data(cobradata_example) head(truth(cobradata_example))
data(cobradata_example) head(truth(cobradata_example))
COBRAData
object to the current version of the class
formatUpdate a COBRAData
object generated by a previous version of the
package to the latest version.
update_cobradata(object, quiet = FALSE)
update_cobradata(object, quiet = FALSE)
object |
A |
quiet |
Set to TRUE to disable messages listing the modifications that are applied to the object |
An updated COBRAData
object
Charlotte Soneson
## Generate COBRAData object set.seed(123) pval <- data.frame(m1 = runif(100), m2 = runif(100), row.names = paste0("F", 1:100)) truth <- data.frame(status = round(runif(100)), row.names = paste0("F", 1:100)) cobradata <- COBRAData(pval = pval, truth = truth) ## Update object if needed cobradata <- update_cobradata(cobradata)
## Generate COBRAData object set.seed(123) pval <- data.frame(m1 = runif(100), m2 = runif(100), row.names = paste0("F", 1:100)) truth <- data.frame(status = round(runif(100)), row.names = paste0("F", 1:100)) cobradata <- COBRAData(pval = pval, truth = truth) ## Update object if needed cobradata <- update_cobradata(cobradata)
COBRAPerformance
or COBRAPlot
object to the current
version of the class formatUpdate a COBRAPerformance
or COBRAPlot
object generated by a
previous version of the package to the latest version.
update_cobraperformance(object, quiet = FALSE)
update_cobraperformance(object, quiet = FALSE)
object |
A |
quiet |
Set to TRUE to disable messages listing the modifications that are applied to the object |
An updated COBRAPerformance
or COBRAPlot
object
Charlotte Soneson
cobradata <- cobradata_example_sval cobraperf <- calculate_performance(cobradata, binary_truth = "status", aspects = "fpr") cobraperf <- update_cobraperformance(cobraperf)
cobradata <- cobradata_example_sval cobraperf <- calculate_performance(cobradata, binary_truth = "status", aspects = "fpr") cobraperf <- update_cobraperformance(cobraperf)