sestats_to_dfs: Extract stats as data.frame from SEStats results

sestats_to_dfsR Documentation

Extract stats as data.frame from SEStats results

Description

Extract stat as data.frame from SEStats results

Usage

sestats_to_dfs(
  sestats,
  assay_names,
  contrast_names = NULL,
  data_content = c("contrasts", "hits"),
  hits_use_lfc = FALSE,
  rename_contrasts = TRUE,
  se = NULL,
  rowData_colnames = NULL,
  row_type = "gene_name",
  verbose = FALSE,
  ...
)

Arguments

sestats

list object output from se_contrast_stats()

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.

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.

hits_use_lfc

logical default FALSE, indicating whether values in "hits" columns should use the log2 fold change.

  • FALSE (default) assigns c(-1, 0, 1) to indicate directionality after applying stat thresholds.

  • TRUE assigns the actual log2 fold change only for hits as defined by the stat thresholds.

rename_contrasts

logical indicating whetheer to apply contrasts2comp() to shorten long contrast names. Currently this option only applies to the list element names, not the column headers.

se

SummarizedExperiment, default NULL, used when rowData_colnames is defined.

rowData_colnames

character, default NULL, with optional colnames used only when se is also provided. When defined, it provides additional annotations for each row as defined by rowData(se).

row_type

character with custom column name to use for the primary row identifier. The default "probes" is often not accurate, though this may not be problematic in practice. When defined, the first column is renamed to row_type.

verbose

logical indicating whether to print verbose output.

...

additional arguments are passed to save_sestats().

Details

The purpose is to output data.frame or list of data.frame from SEStats results. This function is essentially a wrapper to save_sestats() with type="list".

Value

list of data.frame based upon data_content:

  • data_content="contrasts" will return list with one data.frame for each contrast, and each assay_name. Each list element is named by the contrast name.

  • data_content="hits" will return list with one data.frame for each assay_name, including one column for each contrast. Each list element is named by "hits" plus the assay_name, for example "hits quantile_counts".

  • data_content=c("contrasts", "hits") will return list which includes both the options above.

See Also

Other jamses stats: ebayes2dfs(), format_hits(), handle_na_values(), hit_array_to_list(), process_sestats_to_hitim(), run_limma_replicate(), save_sestats(), se_contrast_stats(), sestats_to_df(), voom_jam()


jmw86069/jamses documentation built on Nov. 4, 2024, 9:25 p.m.