Create a list for GeneTonic from the single required components.

GeneTonicList(dds, res_de, res_enrich, annotation_obj)

GeneTonic_list(dds, res_de, res_enrich, annotation_obj)

Arguments

dds

A DESeqDataSet object, normally obtained after running your data through the DESeq2 framework.

res_de

A DESeqResults object. As for the dds parameter, this is also commonly used in the DESeq2 framework.

res_enrich

A data.frame object, storing the result of the functional enrichment analysis. Required columns for enjoying the full functionality of GeneTonic() include:

  • a gene set identifier (e.g. GeneOntology id, gs_id) and its term description (gs_description)

  • a numeric value for the significance of the enrichment (gs_pvalue)

  • a column named gs_genes containing a comma separated vector of the gene names associated to the term, one for each term

  • the number of genes in the geneset of interest detected as differentially expressed (gs_de_count), or in the background set of genes (gs_bg_count) See shake_topGOtableResult() or shake_enrichResult() for examples of such formatting helpers

annotation_obj

A data.frame object, containing two columns, gene_id with a set of unambiguous identifiers (e.g. ENSEMBL ids) and gene_name, containing e.g. HGNC-based gene symbols. This object can be constructed via the org.eg.XX.db packages, e.g. with convenience functions such as mosdef::get_annotation_orgdb().

Value

A GeneTonic-list object, containing in its named slots the arguments specified above: dds, res_de, res_enrich, and annotation_obj - the names of the list are specified following the requirements for using it as single input to GeneTonic()

Details

Having this dedicated function saves the pain of remembering which names the components of the list should have. For backwards compatibility, the GeneTonic_list function is still provided as a synonim, and will likely be deprecated in the upcoming release cycles.

Author

Federico Marini

Examples

library("macrophage")
library("DESeq2")
library("org.Hs.eg.db")
library("AnnotationDbi")

# dds object
data("gse", package = "macrophage")
dds_macrophage <- DESeqDataSet(gse, design = ~ line + condition)
#> using counts and average transcript lengths from tximeta
rownames(dds_macrophage) <- substr(rownames(dds_macrophage), 1, 15)
dds_macrophage <- estimateSizeFactors(dds_macrophage)
#> using 'avgTxLength' from assays(dds), correcting for library size

# annotation object
anno_df <- data.frame(
  gene_id = rownames(dds_macrophage),
  gene_name = mapIds(org.Hs.eg.db,
    keys = rownames(dds_macrophage),
    column = "SYMBOL",
    keytype = "ENSEMBL"
  ),
  stringsAsFactors = FALSE,
  row.names = rownames(dds_macrophage)
)
#> 'select()' returned 1:many mapping between keys and columns


# res object
data(res_de_macrophage, package = "GeneTonic")
res_de <- res_macrophage_IFNg_vs_naive

# res_enrich object
data(res_enrich_macrophage, package = "GeneTonic")
res_enrich <- shake_topGOtableResult(topgoDE_macrophage_IFNg_vs_naive)
#> Found 500 gene sets in `topGOtableResult` object.
#> Converting for usage in GeneTonic...
res_enrich <- get_aggrscores(res_enrich, res_de, anno_df)

gtl_macrophage <- GeneTonicList(
  dds = dds_macrophage,
  res_de = res_de,
  res_enrich = res_enrich,
  annotation_obj = anno_df
)
#> ---------------------------------
#> ----- GeneTonicList object ------
#> ---------------------------------
#> 
#> ----- dds object -----
#> Providing an expression object (as DESeqDataset) of 58294 features over 24 samples
#> 
#> ----- res_de object -----
#> Providing a DE result object (as DESeqResults), 17806 features tested, 928 found as DE
#> Upregulated:     599
#> Downregulated:   329
#> 
#> ----- res_enrich object -----
#> Providing an enrichment result object, 500 reported
#> 
#> ----- annotation_obj object -----
#> Providing an annotation object of 58294 features with information on 2 identifier types

# now everything is in place to launch the app
if (interactive()) {
  GeneTonic(gtl = gtl_macrophage)
}