findPeakGene: Find peak genes

Description Usage Arguments Details Value Examples

View source: R/process.R

Description

Find peak genes (spatially upregulated genes) in a SummarizedExperiment object.

Usage

1
2
3
4
5
6
7
8
findPeakGene(
  object,
  threshold = 1,
  length = 4,
  matrix = "scaled",
  nperm = 1e+05,
  method = "BH"
)

Arguments

object

A SummarizedExperiment object.

threshold

Integer, only scaled read counts bigger than threshold are recognized as part of the peak.

length

Integer, scaled read counts bigger than threshold in minimum length of consecutive sections are recognized as a peak.

matrix

Character, must be one of "count", "normalized", or "scaled".

nperm

Integer, number of random permutations to calculate p values. Set it to 0 if you are not interested in p values.

method

Character, the method to adjust p values for multiple comparisons, must be one of "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none".

Details

Peak genes are selected based on scaled read counts. As scaled read counts are Z scores, suggested threshold are [1,3]. Smaller threshold and length makes the function detect more peak genes, and vice versa. P values are calculated by approximate permutation tests. For a given threshold and length, the scaled read counts of each gene is randomly permutated for nperm times. The p value is defined as the ratio of permutations containing peaks. In order to speed up permutation process, genes whose expression exceeds threshold in same number of sections have same p values. To be specific, only one of these genes will be used to calculate a p value by permutation, and other genes are assigned this p value.

Value

A data.frame with peak genes as rows. It has following columns:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data(zh.data)
zh <- createTomo(zh.data)
peak_genes <- findPeakGene(zh)
head(peak_genes)

# Increase threshold so that less peak genes will be found.
peak_genes <- findPeakGene(zh, threshold=1.5)

# Increase peak length so that less peak genes will be found.
peak_genes <- findPeakGene(zh, length=5)

# Set nperm to 0 so that p values will not be calculated. This will save running time.
peak_genes <- findPeakGene(zh, nperm=0)

tomoda documentation built on Nov. 8, 2020, 8:10 p.m.