annotate MatrixEQTL/man/plot.MatrixEQTL.Rd @ 0:cd4c8e4a4b5b draft

Uploaded
author jasonxu
date Fri, 12 Mar 2021 08:12:46 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
1 \name{plot.MatrixEQTL}
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
2 \alias{plot.MatrixEQTL}
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
3 \title{Plot histogram or QQ-plot of all p-values
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
4 }
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
5 \description{
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
6 This method plots a histogram or QQ-plot of p-values
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
7 for all tests performed by \code{\link{Matrix_eQTL_engine}}.
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
8 }
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
9 \usage{
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
10 \method{plot}{MatrixEQTL}(x, cex = 0.5, pch = 19, xlim = NULL, ylim = NULL,...)
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
11 }
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
12 \arguments{
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
13 \item{x}{
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
14 An object returned by \code{\link{Matrix_eQTL_engine}}.
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
15 }
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
16 \item{cex}{
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
17 A numerical value giving the amount by which plotting text and symbols should be magnified relative to the default.
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
18 }
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
19 \item{pch}{
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
20 Plotting "character", i.e., symbol to use. See \code{\link[graphics]{points}}.
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
21 }
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
22 \item{xlim}{
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
23 Set the range of the horisontal axis.
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
24 }
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
25 \item{ylim}{
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
26 Set the range of the vertical axis.
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
27 }
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
28 \item{\dots}{
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
29 further graphical parameters passed to \code{\link[graphics]{lines}} and \code{\link[graphics]{points}}.
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
30 }
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
31 }
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
32 \details{
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
33 The plot type (histogram vs. QQ-plot) is determined by the \code{pvalue.hist} parameter in the call of \code{\link{Matrix_eQTL_engine}} function.
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
34 }
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
35 \value{
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
36 The method does not return any value.
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
37 }
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
38 \references{
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
39 The package website: \url{http://www.bios.unc.edu/research/genomic_software/Matrix_eQTL/}
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
40 }
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
41 \seealso{
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
42 See \code{\link{Matrix_eQTL_engine}} for reference and sample code.
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
43 }
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
44 \note{
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
45 The sample code below produces figures like these:
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
46
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
47 Histogram: \figure{histogram.png}
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
48
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
49 QQ-plot: \figure{QQplot.png}
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
50 }
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
51 \author{
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
52 Andrey Shabalin \email{ashabalin@vcu.edu}
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
53 }
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
54 \examples{
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
55 library(MatrixEQTL)
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
56
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
57 # Number of samples
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
58 n = 100;
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
59
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
60 # Number of variables
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
61 ngs = 2000;
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
62
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
63 # Common signal in all variables
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
64 pop = 0.2*rnorm(n);
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
65
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
66 # data matrices
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
67 snps.mat = matrix(rnorm(n*ngs), ncol = ngs) + pop;
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
68 gene.mat = matrix(rnorm(n*ngs), ncol = ngs) + pop + snps.mat*((1:ngs)/ngs)^9/2;
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
69
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
70 # data objects for Matrix eQTL engine
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
71 snps1 = SlicedData$new( t( snps.mat ) );
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
72 gene1 = SlicedData$new( t( gene.mat ) );
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
73 cvrt1 = SlicedData$new( );
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
74 rm(snps.mat, gene.mat)
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
75
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
76 # Slice data in blocks of 500 variables
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
77 snps1$ResliceCombined(500);
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
78 gene1$ResliceCombined(500);
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
79
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
80 # Produce no output files
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
81 filename = NULL; # tempfile()
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
82
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
83 # Perform analysis recording information for a histogram
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
84 meh = Matrix_eQTL_engine(
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
85 snps = snps1,
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
86 gene = gene1,
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
87 cvrt = cvrt1,
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
88 output_file_name = filename,
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
89 pvOutputThreshold = 1e-100,
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
90 useModel = modelLINEAR,
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
91 errorCovariance = numeric(),
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
92 verbose = TRUE,
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
93 pvalue.hist = 100);
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
94
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
95 plot(meh, col="grey")
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
96
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
97 # Perform analysis recording information for a QQ-plot
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
98 meq = Matrix_eQTL_engine(
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
99 snps = snps1,
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
100 gene = gene1,
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
101 cvrt = cvrt1,
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
102 output_file_name = filename,
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
103 pvOutputThreshold = 1e-6,
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
104 useModel = modelLINEAR,
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
105 errorCovariance = numeric(),
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
106 verbose = TRUE,
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
107 pvalue.hist = "qqplot");
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
108
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
109 plot(meq)
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
110 }
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
111 \keyword{ QQ-plot }
cd4c8e4a4b5b Uploaded
jasonxu
parents:
diff changeset
112 \keyword{ histogram }