Learn R Programming

MatrixEQTL (version 1.6.2)

plot.MatrixEQTL: Plotting histogram or Q-Q plot of all p-values

Description

This method plots a histogram or Q-Q plot of p-values for all tests performed by Matrix_eQTL_engine.

Usage

## S3 method for class 'MatrixEQTL':
plot(x, cex = 0.5, pch = 19, ymin = NULL, ...)

Arguments

x
An "MatrixEQTL" object produced by Matrix eQTL main function Matrix_eQTL_engine.
cex
A numerical value giving the amount by which plotting text and symbols should be magnified relative to the default.
pch
Plotting "character", i.e., symbol to use. See points.
ymin
Set the top of the range of the vertical axis.
...
further graphical parameters to lines and points.

Value

  • The method does not return any value.

Details

The plot type (histogram vs. Q-Q plot) is defined by the pvalue.hist parameter in the call of Matrix_eQTL_engine function.

References

The software website: http://www.bios.unc.edu/research/genomic_software/Matrix_eQTL/

See Also

Matrix_eQTL_main

Examples

Run this code
# Number of samples
n = 100; 
# Number of variables
ngs = 2000;
# Common signal in all variables
pop = 0.2*rnorm(n);

# data matrices
snps.mat = matrix(rnorm(n*ngs), ncol = ngs) + pop;
gene.mat = matrix(rnorm(n*ngs), ncol = ngs) + pop + snps.mat*((1:ngs)/ngs)^9/2;

# data objects for Matrix eQTL engine
snps1 = SlicedData$new( t( snps.mat ) );
gene1 = SlicedData$new( t( gene.mat ) );
cvrt1 = SlicedData$new( );
rm(snps.mat, gene.mat)

# Slice data in blocks of 500 variables
snps1$ResliceCombined(500);
gene1$ResliceCombined(500);

# name of temporary output file
filename = tempfile();

# Perform analysis recording information for 
# a histogram
meh = Matrix_eQTL_engine(
    snps = snps1, 
    gene = gene1, 
    cvrt = cvrt1, 
    output_file_name = filename, 
    pvOutputThreshold = 1e-100, 
    useModel = modelLINEAR, 
    errorCovariance = numeric(), 
    verbose = TRUE,
    pvalue.hist = 100);
unlink( filename );
plot(meh, col="grey")

# Perform analysis recording information for 
# a Q-Q plot
meq = Matrix_eQTL_engine(
    snps = snps1, 
    gene = gene1, 
    cvrt = cvrt1, 
    output_file_name = filename,
    pvOutputThreshold = 1e-6, 
    useModel = modelLINEAR, 
    errorCovariance = numeric(), 
    verbose = TRUE,
    pvalue.hist = "qqplot");
unlink( filename );
plot(meq)

Run the code above in your browser using DataLab