save_sestats: Save SE contrast stats output

save_sestatsR Documentation

Save SE contrast stats output

Description

Save SE contrast stats output

Usage

save_sestats(
  sestats,
  file = NULL,
  assay_names = NULL,
  contrast_names = NULL,
  cutoff_names = NULL,
  type = c("xlsx", "list"),
  data_content = c("data", "hits"),
  max_nchar_sheetname = 31,
  review_output = TRUE,
  sheet_prefix = NULL,
  use_assay_suffix = TRUE,
  width_factor = 1,
  max_rows = NULL,
  colorSub = NULL,
  rename_contrasts = TRUE,
  se = NULL,
  rowData_colnames = NULL,
  row_type = "gene_name",
  hitRule = c(-1, 0, 1),
  hitFormat = "#,##0",
  freezePaneColumn = 2,
  verbose = FALSE,
  ...
)

Arguments

sestats

list object output from se_contrast_stats()

file

character string indicating the filename to save. When file is NULL, output is returned as a list, equivalent to type="list".

assay_names

character string indicating which assay names to save, stored in dimnames(sestats$hit_array)$Signal. When NULL then all assay names are saved.

contrast_names

character string indicating which contrasts to save, stored in dimnames(sestats$hit_array)$Contrasts. The default NULL will save all contrasts.

type

character string indicating the type of file to save.

  • "xlsx" - saves an Excel xlsx file using jamba::writeOpenxlsx(). Each worksheet is renamed so the string length does not exceed max_nchar_sheetname, whose default is 31 characters.

  • "list" - returns a list of data.frame objects, equivalent to the data to be stored in an output file. This option will not save data to file.

data_content

character string describing the data content to include:

  • ⁠"contrasts","hits"⁠ - include worksheets per contrast_names, then assemble one "hit sheet" across all contrasts. One hit sheet is created for each value in assay_names.

  • "contrasts" - (default) include worksheets per contrast_names

  • "hits" - include only one "hit sheet" per value in assay_names.

max_nchar_sheetname

integer number of characters allowed in Microsoft Excel worksheet names, default 31 characters.

review_output

logical indicating whether a summary of output should be returned as a data.frame without exporting data. This summary will indicate all worksheets to be saved, in addition to the sheetName for each worksheet.

sheet_prefix

character string with optional character prefix to use when creating worksheet names.

use_assay_suffix

logical indicating whether to include assay_names as suffix when forming sheet names, when there is more than one unique assay name to be saved. This step will attempt to abbreviate assay_names by taking up to 4 characters from each word in the assay name, where each word is delimited by "[-.:_ ]+". Otherwise, sheet names are forced to be unique by taking a substring of the contrast name of up to max_nchar_sheetname, passing any duplicate strings to jamba::makeNames() with suffix "_v" followed by an integer number.

width_factor

numeric used to adjust relative column widths in the output Excel worksheets.

colorSub

character vector of colors, optional, used to define categorical background colors for text string fields in Excel. The names(colorSub) are matched to character strings to assign colors.

hitRule, hitFormat, freezePaneColumn

arguments passed to jamba::writeOpenxlsx().

verbose

logical indicating whether to print verbose output.

...

additional arguments are passed to jamba::writeOpenxlsx()

Details

This function is intended as a convenient method to export a series of statistical tables into organized, formatted Excel worksheets.


jmw86069/jamses documentation built on May 31, 2024, 1:36 p.m.