RSNPset P-value Summary Function

Share:

Description

Summary function to sort and display p-values resulting from rsnpset.pvalue().

Usage

1
2
3
## S3 method for class 'RSNPset.pvalue'
summary(object, sort="p", decreasing=FALSE, 
        nrows=10, dropcols=c(""), verbose=FALSE, ...) 

Arguments

object

Result from rsnpset.pvalue(), an "RSNPset.pvalue" S3 class object. Required.

sort

Character string indicating column by which to sort results. If not one of c("W", "rank", "m", "p", "pB", "PB", "Q", "QB") results will be sorted by the row names (i.e. the names of the SNP sets) instead. Default is "p".

decreasing

Boolean indicating if the sort column should be arranged in decreasing order. Default is FALSE.

nrows

Integer indicating number of rows to display. Default is 10.

dropcols

Character vector corresponding names of columns of to be suppressed from the summary. Default is none.

verbose

Boolean indicating if additional information about the p-value calculations should be reported. Default is FALSE.

...

Additional arguments affecting the summary produced.

Details

As a typical GWAS study may span thousands of SNPs and SNP sets, this function allows for the succinct reporting of p-values for the most significant results. For more information about the different columns reported, see the documentation for rsnpset.pvalue(). If verbose=TRUE, a note will be printed with the total number of SNP sets and replications used in the calculations, as well as the value of the pval.transform argument from rsnpset.pvalue().

Value

A data.frame object subset from object, the result of rsnpset.pvalue(). Rows are selected based on the sort, decreasing, and nrows arguments, and columns are selected based on the dropcols argument.

See Also

The function rsnpset.pvalue provides a description of the different p-values computed, as well as the other columns in the results.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
n <- 200    # Number of patients
m <- 1000   # Number of SNPs

set.seed(123)
G <- matrix(rnorm(n*m), n, m)   # Normalized SNP expression levels
rsids <- paste0("rs", 1:m)      # SNP rsIDs 
colnames(G) <- rsids
 
K <- 15                         # Number of SNP sets
genes <- paste0("XYZ", 1:K)     # Gene names 
gsets <- lapply(sample(3:50, size=K, replace=TRUE), sample, x=rsids)
names(gsets) <- genes

# Survival outcome
time <- rexp(n, 1/10)           # Survival time
event <- rbinom(n, 1, 0.9)      # Event indicator

## Not run: 
# Optional parallel backend
library(doParallel)
registerDoParallel(cores=8) 
## End(Not run)

# B >= 1000 is typically recommended
res <- rsnpset(Y=time, delta=event, G=G, snp.sets=gsets, score="cox", 
               
               B=50, r.method="permutation", ret.rank=TRUE)
pvals <- rsnpset.pvalue(res, pval.transform=TRUE)

summary(pvals)

summary(pvals, sort="W", decreasing=TRUE, nrows=5, dropcols=c("p","rank"), verbose=TRUE)