Randomly permutes a subset of data, and calculates projected PCA scores for these 'random' genes. Then compares the PCA scores for the 'random' genes with the observed PCA scores to determine statistical signifance. End result is a p-value for each gene's association with each principal component.
JackStraw(object, num.pc = 20, num.replicate = 100, prop.freq = 0.01,
do.print = FALSE)
Seurat object
Number of PCs to compute significance for
Number of replicate samplings to perform
Proportion of the data to randomly permute for each replicate
Print the number of replicates that have been processed.
Returns a Seurat object where object@jackStraw.empP represents p-values for each gene in the PCA analysis. If ProjectPCA is subsequently run, object@jackStraw.empP.full then represents p-values for all genes.
Inspired by Chung et al, Bioinformatics (2014)