generate_bootstrap_plots_for_transcriptome: Generate bootstrap plots

Description Usage Arguments Value Examples

View source: R/generate_bootstrap_plots_for_transcriptome.r

Description

generate_bootstrap_plots_for_transcriptome takes a genelist and a single cell type transcriptome dataset and generates plots which show how the expression of the genes in the list compares to those in randomly generated gene lists

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
generate_bootstrap_plots_for_transcriptome(
  sct_data,
  tt,
  thresh = 250,
  annotLevel = 1,
  reps,
  full_results = NA,
  listFileName = "",
  showGNameThresh = 25,
  ttSpecies = "mouse",
  sctSpecies = "mouse",
  sortBy = "t",
  onlySignif = TRUE,
  savePath = tempdir()
)

Arguments

sct_data

List generated using generate_celltype_data

tt

Differential expression table. Can be output of limma::topTable function. Minimum requirement is that one column stores a metric of increased/decreased expression (i.e. log fold change, t-statistic for differential expression etc) and another contains either HGNC or MGI symbols.

thresh

The number of up- and down- regulated genes to be included in each analysis. Dafault=250

annotLevel

an integer indicating which level of the annotation to analyse. Default = 1.

reps

Number of random gene lists to generate (default=100 but should be over 10000 for publication quality results)

full_results

The full output of bootstrap_enrichment_test for the same genelist

listFileName

String used as the root for files saved using this function

showGNameThresh

Integer. If a gene has over X percent of it's expression proportion in a celltype, then list the gene name

ttSpecies

Either 'mouse' or 'human' depending on which species the differential expression table was generated from

sctSpecies

Either 'mouse' or 'human' depending on which species the single cell data was generated from

sortBy

Column name of metric in tt which should be used to sort up- from down- regulated genes. Default="t"

onlySignif

Should plots only be generated for cells which have significant changes?

savePath

Directory where the BootstrapPlots folder should be saved, default is a temp directory

Value

Saves a set of pdf files containing graphs and returns the file where they are saved. These will be saved with the filename adjusted using the value of listFileName. The files are saved into the 'BootstrapPlot' folder. Files start with one of the following:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
library(ewceData)
# Load the single cell data
ctd <- ctd()

# Set the parameters for the analysis
# Use 3 bootstrap lists for speed, for publishable analysis use >10000
reps <- 3
annotLevel <- 1 # <- Use cell level annotations (i.e. Interneurons)
# Use 5 up/down regulated genes (thresh) for speed, default is 250
thresh = 5

# Load the top table
tt_alzh <- tt_alzh()

tt_results <- ewce_expression_data(
    sct_data = ctd, tt = tt_alzh, annotLevel = 1,thresh = thresh,
    reps = reps, ttSpecies = "human", sctSpecies = "mouse"
)

# Bootstrap significance test, no control for transcript length or GC content
full_results <- generate_bootstrap_plots_for_transcriptome(
    sct_data = ctd, tt = tt_alzh, thresh = thresh, annotLevel = 1,
    full_results = tt_results, listFileName = "examples", reps = reps,
    ttSpecies = "human", sctSpecies = "mouse", savePath=tempdir()
)

NathanSkene/EWCE documentation built on June 19, 2021, 5:40 a.m.