Learn R Programming

metaseqR (version 1.12.2)

fisher.method.perm: Derive a p-value for a summary statistic of p-values by permutation

Description

Given a set of p-values and a summary statistic S: $$S = -2 \sum \log p,$$ a p-value for this statistic can be derived by randomly generating summary statistics [Rhodes,2002]. Therefore, a p-value is randomly sampled from each contributing study and a random statistic is calculated. The fraction of random statistics greater or equal to S then gives the p-value.

Usage

fisher.method.perm(pvals, p.corr = c("bonferroni", "BH", "none"), 
  zero.sub = 1e-05, B = 10000, mc.cores = NULL, blinker = 1000)

Arguments

pvals
A matrix or data.frame containing the p-values from the single tests
p.corr
Method for correcting the summary p-values. BH: Benjamini-Hochberg (default); Bonferroni's method or no ('none') correction are currently supported.
zero.sub
Replacement for p-values of 0
B
Number of random statistics
mc.cores
Number of cores used for calculating the permutations. If not NULL the multicore package is used for parallelization with the given number of cores.
blinker
An indicator that prints "=" after each blinker rows of pvals in order to follow the progress.

Value

  • This method returns a data.frame containing the following columns
  • SThe statistic
  • num.pThe number of p-values used to calculate S
  • p.valueThe overall p-value
  • p.adjThe adjusted p-value

Details

At the moment this function only supports situations were all passed p-values are not NA. We plan on extending this functionality in upcoming versions. For large data sets and/or large B we strongly recommend using the mc.cores option as the calculation will otherwise be computationally demanding. This will call the mclapply function from the multicore package, which you will have to install in that case.

By default a blinker (a small string "=") is shown after each 1000 rows that were computed. This function allows you to assess the progress of the analysis. If you don't want to see the blinker set it to NA.

As log(0) results in Inf we replace p-values of 0 by default with a small float. If you want to keep them as 0 you have to provide 0 as a parameter in zero.sub.

Note that only p-values between 0 and 1 are allowed to be passed to this method.

References

Rhodes, D. R., (2002). Meta-analysis of microarrays: interstudy alidation of gene expression profiles reveals pathway dysregulation in prostate cancer. Cancer research, 62(15), 4427-33.

See Also

fisher.sum, fisher.method

Examples

Run this code
set.seed(123)
  pp <- matrix(c(runif(20),c(0.001,0.02,0.03,0.001)), ncol=4)
  fisher.method.perm(pp, B=10, blinker=1)
  fisher.method.perm(pp, B=10000, mc.cores=3, blinker=1) #use multicore

Run the code above in your browser using DataLab