plot.minPtest: Plot method for "minPtest" object

Description Usage Arguments Details Value Note Author(s) See Also Examples

View source: R/plot.minPtest.R

Description

plot method for an object of class 'minPtest'. Plots allowing to get an impression of important genes or/and SNPs.

Usage

1
2
3
4
5
## S3 method for class 'minPtest'
plot(x, type=c("gene" ,"SNP" ,"both"), level=0.05, lambda=1, gene.name=FALSE,
     sigPch=pch, nonsigPch=pch, pch=20,
     sigLty=lty, nonsigLty=lty, lty=1,
     sigCol=col, nonsigCol=col, col=NULL, xlab, ...)

Arguments

x

an object of class minPtest.

type

by default, permutation-based p-values for each gene are plotted ("gene"). "SNP": marginal p-values for each SNP are plotted. "both": marginal p-values for each SNP and the transformed permutation-based p-values for each gene are displayed in a combined plot, see Details.

level

a numeric threshold that specifies which genes or/and SNPs are highlighted in the plot. I.e. not depending on the used type argument, the genes or/and SNPs with adjusted permutation-based p-values or/and marginal p-value, respectively, which are smaller than or equal to that threshold are by default highlighted in red. Default is 0.05.

lambda

only useful for type="both". A numeric value to scale the y-axis for the permutation-based p-values of the genes (indicated at the right hand side). Default is 1.

gene.name

only useful for type="SNP" and type="both". A logical value, if TRUE, the gene names are shown at the x-axis. Default is FALSE.

sigPch

Type of plotting for significant permutation-based p-values (type="gene") or for significant marginal p-values (type="SNP" and type="both") (if neither sigPch nor pch set: points)

nonsigPch

Type of plotting for non significant permutation-based p-values (type="gene") or non significant marginal p-values (type="SNP" and type="both") (if neither nonsigPch nor pch set: points)

pch

Set type of plotting for both sigPch and nonsigPch (but can be overwritten by sigPch and nonsigPch if set)

sigLty

only used for type="both". Type of plotting for significant permutation-based p-values (if neither sigLty nor lty set: solid lines)

nonsigLty

only used for type="both". Type of plotting for non significant permutation-based p-values (if neither nonsigLty nor lty set: solid lines)

lty

only used for type="both". Set type of plotting for both sigLty and nonsigLty (but can be overwritten by sigLty and nonsigLty if set)

sigCol

Color for significant genes or/and significant SNPs (if neither sigCol nor col set: red)

nonsigCol

Color for non significant genes or/and non significant SNPs (if neither nonsigCol nor col set: black)

col

Set color for both sigCol and nonsigCol (but can be overwritten by sigCol and nonsigCol if set)

xlab

xlab (Default: Gene if type="both") and SNP if type=SNP or type="both", respectively

...

Further arguments for the plot function.

Details

The function plots either (-log_{10}) transformed permutation-based p-values for each gene or (-log_{10}) transformed marginal p-values for each SNP in a basic scatterplot. The y-axis is (-log_{10}) transformed to obtain a disposition as a Manhattan plot for the points of the marginal p-values of the SNPs. Furthermore, an alternative given by the function is to display the marginal p-values for each SNP and the transformed permutation-based p-values for each gene in a combined plot. The (-log_{10}) transformed marginal p-values for each SNP are plotted as points. In addition, horizontal lines of (-lambda*log_{10}) transformed permutation-based p-values of each gene, covering all SNPs located on that gene, are plotted. The composed plot is indicated by two separated y-axes ((-log_{10}(psnp)) at left hand side and (-lambda*log_{10}(minp)) at the right hand side). After correction for multiple hypothesis testing depending on the level and the argument adj.method in the minPtest function, but not depending on the used type of plot, significant genes and SNPs are by default highlighted in red, i.e. each permutation-based p-value or/and marginal p-value smaller than or equal to the level, respectively, is highlighted in red.

Value

No value returned

Note

The default for gene.name=FALSE, used for type="SNP" and type="both", should kept for performance reasons, if a large number of genes are included in the fit. For type="both" no ylim should be specified as the plot is indicated by two separate y-axes.

Author(s)

Stefanie Hieke hieke@imbi.uni-freiburg.de

See Also

minPtest, generateSNPs

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
## Continuing the example from minPtest and generateSNPs:
# generate a data set consisting of 100 subjects and 200 SNPs on 5 genes.

SNP <- c(6,26,54,135,156,186)
BETA <- c(0.9,0.7,1.5,0.5,0.6,0.8)
SNPtoBETA <- matrix(c(SNP,BETA),ncol=2,nrow=6)
colnames(SNPtoBETA) <- c("SNP.item","SNP.beta")

set.seed(191)
sim1 <- generateSNPs(n=100,gene.no=5,block.no=4,block.size=10,p.same=0.9,
	             p.different=0.75,p.minor=c(0.1,0.4,0.1,0.4),
                     n.sample=80,SNPtoBETA=SNPtoBETA)


# Cochran Armitage Trend Test without covariates and default permutations.
# Example: Run R sequential

### Seed
set.seed(10)
seed1 <- sample(1:1e7,size=1000)
###
minPtest.object <- minPtest(y=sim1$y, x=sim1$x, SNPtoGene=sim1$SNPtoGene,
	                    seed=seed1)
### Combined plot for permutation-based p-values and marginal p-values.
plot(minPtest.object,type="both",lambda=0.5,gene.name=TRUE)

## Combined plot for permutation-based p-values and marginal
## p-values. Plot permutation-based p-values and significant marginal
## p-values as blue dotted lines and blue points
## plot(minPtest.object,type="both",lambda=0.5,
##      gene.name=TRUE,sigCol="blue",sigLty=2)

minPtest documentation built on May 29, 2017, 1:06 p.m.