plotNull: Plot the empirically estimated null distribution and...

Description Usage Arguments Value Author(s) Examples

View source: R/plot.R

Description

This function takes the results from function generateNull() and plots the density curves of permuted scores for the provided samples via sampleNames parameter. It can plot null distribution(s) for a single sample or multiple samples.

Usage

1
2
3
4
5
6
7
8
9
plotNull(
  permuteResult,
  scoredf,
  pvals,
  sampleNames = NULL,
  cutoff = 0.01,
  textSize = 2,
  labelSize = 5
)

Arguments

permuteResult

A matrix, null distributions for each sample generated using the generateNull() function

scoredf

A dataframe, singscores generated using the simpleScore() function

pvals

A vector, estimated p-values using the getPvals() function permuteResult,scoredf and pvals are the results for the same samples.

sampleNames

A character vector, sample IDs for which null distributions will be plotted

cutoff

numeric, the cutoff value for determining significance

textSize

numeric, size of axes labels, axes values and title

labelSize

numeric, size of label texts

Value

a ggplot object

Author(s)

Ruqian Lyu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
ranked <- rankGenes(toy_expr_se)
scoredf <- simpleScore(ranked, upSet = toy_gs_up, downSet = toy_gs_dn)
# find out what backends can be registered on your machine
BiocParallel::registered()
# the first one is the default backend, and it can be changed explicitly.
permuteResult = generateNull(upSet = toy_gs_up, downSet = toy_gs_dn, ranked,
B =10, seed = 1,useBPPARAM = NULL)
# call the permutation function to generate the empirical scores
#for B times.
pvals <- getPvals(permuteResult,scoredf)
# plot for all samples
plotNull(permuteResult,scoredf,pvals,sampleNames = names(pvals))
#plot for the first sample
plotNull(permuteResult,scoredf,pvals,sampleNames = names(pvals)[1])

singscore documentation built on April 29, 2020, 5:18 a.m.