Skip to contents

Beautifying the aspect and looks of a DE results table

Usage

de_table_painter(
  res_de,
  rounding_digits = NULL,
  signif_digits = NULL,
  up_DE_color = "darkred",
  down_DE_color = "navyblue",
  logfc_column = "log2FoldChange",
  basemean_column = "baseMean",
  lfcse_column = "lfcSE",
  stat_column = "stat",
  pvalue_column = "pvalue",
  padj_column = "padj"
)

Arguments

res_de

An object containing the results of the Differential Expression analysis workflow (e.g. DESeq2, edgeR or limma). Currently, this can be a DESeqResults object created using the DESeq2 framework. Or a data frame obtained from such an object through deresult_to_df()

rounding_digits

Numeric value, specifying the number of digits to round the numeric values of the DE table (except the p-values)

signif_digits

Numeric value, specifying the number of significant digits to display for the p-values in the DE table

up_DE_color

Character string, specifying the color to use for coloring the bar of upregulated genes.

down_DE_color

Character string, specifying the color to use for coloring the bar of downregulated genes.

logfc_column

Character string, defining the name of the column in which to find the log2 fold change.

basemean_column

Character string, defining the name of the column in which to find the average expression value.

lfcse_column

Character string, defining the name of the column in which to find the standard error of the log2 fold change.

stat_column

Character string, defining the name of the column in which to find the values of the test statistic.

pvalue_column

Character string, defining the name of the column in which to find the unadjusted p-values.

padj_column

Character string, defining the name of the column in which to find the adjusted p-values.

Value

A datatable object, ready to be rendered as a widget inside an analysis Rmarkdown report.

Details

Feeding on the classical results of DE workflows, this function formats and tries to prettify the representation of the key values in it.

Examples

data(res_de_macrophage, package = "mosdef")
de_table_painter(res_macrophage_IFNg_vs_naive,
                 rounding_digits = 3,
                 signif_digits = 5)
#> Warning: Direct call of 'as.data.frame.numeric()' is deprecated.  Use 'as.data.frame.vector()' or 'as.data.frame()' instead
#> Warning: Direct call of 'as.data.frame.numeric()' is deprecated.  Use 'as.data.frame.vector()' or 'as.data.frame()' instead
#> Warning: Direct call of 'as.data.frame.numeric()' is deprecated.  Use 'as.data.frame.vector()' or 'as.data.frame()' instead
#> Warning: Direct call of 'as.data.frame.numeric()' is deprecated.  Use 'as.data.frame.vector()' or 'as.data.frame()' instead
#> Warning: Direct call of 'as.data.frame.numeric()' is deprecated.  Use 'as.data.frame.vector()' or 'as.data.frame()' instead
#> Warning: Direct call of 'as.data.frame.numeric()' is deprecated.  Use 'as.data.frame.vector()' or 'as.data.frame()' instead
#> Warning: Direct call of 'as.data.frame.numeric()' is deprecated.  Use 'as.data.frame.vector()' or 'as.data.frame()' instead
#> Warning: Direct call of 'as.data.frame.numeric()' is deprecated.  Use 'as.data.frame.vector()' or 'as.data.frame()' instead
#> Warning: Direct call of 'as.data.frame.numeric()' is deprecated.  Use 'as.data.frame.vector()' or 'as.data.frame()' instead
#> Warning: Direct call of 'as.data.frame.numeric()' is deprecated.  Use 'as.data.frame.vector()' or 'as.data.frame()' instead
#> Warning: Direct call of 'as.data.frame.numeric()' is deprecated.  Use 'as.data.frame.vector()' or 'as.data.frame()' instead
#> Warning: Direct call of 'as.data.frame.numeric()' is deprecated.  Use 'as.data.frame.vector()' or 'as.data.frame()' instead
## It is also possible to pass the "buttonified" table, res_df_small <- deresult_to_df(res_macrophage_IFNg_vs_naive)[1:100, ] #> Warning: Direct call of 'as.data.frame.numeric()' is deprecated. Use 'as.data.frame.vector()' or 'as.data.frame()' instead #> Warning: Direct call of 'as.data.frame.numeric()' is deprecated. Use 'as.data.frame.vector()' or 'as.data.frame()' instead #> Warning: Direct call of 'as.data.frame.numeric()' is deprecated. Use 'as.data.frame.vector()' or 'as.data.frame()' instead #> Warning: Direct call of 'as.data.frame.numeric()' is deprecated. Use 'as.data.frame.vector()' or 'as.data.frame()' instead #> Warning: Direct call of 'as.data.frame.numeric()' is deprecated. Use 'as.data.frame.vector()' or 'as.data.frame()' instead #> Warning: Direct call of 'as.data.frame.numeric()' is deprecated. Use 'as.data.frame.vector()' or 'as.data.frame()' instead buttonified_df <- buttonifier(res_df_small, create_buttons_to = c("NCBI", "HPA"), ens_col = "id", ens_species = "Homo_sapiens", output_format = "DF" ) de_table_painter(buttonified_df, rounding_digits = 3, signif_digits = 5)