findPeakGene | R Documentation |
Find peak genes (spatially upregulated genes) in a SummarizedExperiment
object.
findPeakGene( object, threshold = 1, length = 4, matrix = "scaled", nperm = 1e+05, method = "BH" )
object |
A |
threshold |
Integer, only scaled read counts bigger than |
length |
Integer, scaled read counts bigger than |
matrix |
Character, must be one of |
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 |
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.
A data.frame with peak genes as rows. It has following columns:
gene
: Character, peak gene names.
start
: Numeric, the start index of peak.
end
: Numeric, the end index of peak.
center
: Numeric, the middle index of peak. If the length of the peak is even, center
is defined as the left-middle index.
p
: Numeric, p values.
p.adj
: Numeric, adjusted p values.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.