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

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