calcPvalues: Calculate p-values

Description Usage Arguments Value See Also Examples

Description

Compares the distribution of all beta values corresponding to one batch with the distribution of all beta values corresponding to all other batches and retuns a p-value which defines if the distributions are the same or not. Standard two sided Kolmogorov-Smirnov test is used to calculate the (adjusted) p-values.

Usage

1
calcPvalues(data, samples, parallel=TRUE, cores=4, adjusted=TRUE, method="fdr")

Arguments

data

any matrix filled with beta values, column names have to be sample_ids corresponding to the ids listed in "samples", row names have to be gene names.

samples

data frame with two columns, the first column has to contain the sample numbers, the second column has to contain the corresponding batch number. Colnames have to be named as "sample_id" and "batch_id".

parallel

should the calculation be done in parallel mode? snowfall package is needed to run the function in parallel mode.

cores

if running in parallel mode, define the number of cores used for the calculation. snowfall package is needed to run the function in parallel mode.

adjusted

should the p-values be adjusted or not, see "method" for available adjustment methods.

method

adjustment method for p-value adjustment (if TRUE), default method is "false discovery rate adjustment", for other available methods see the description of the used standard R package p.adjust.

Value

a matrix containing p-values for all genes in all batches, the column names define the batch numbers, row names are the same gene names as contained in the input matrix.

See Also

snowfall ks.test p.adjust correctBatchEffect

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Shortly running example. For a more realistic example that takes
## some more time, run the same procedure with the full BEclearData
## dataset.

## Calculate fdr-adjusted p-values in non-parallel mode
data(BEclearData)
ex.data <- ex.data[31:90,7:26]
ex.samples <- ex.samples[7:26,]
pvals <- calcPvalues(data=ex.data, samples=ex.samples, parallel=FALSE,
    adjusted=TRUE, method="fdr")


Search within the BEclear package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.