cpg {CpGassoc}R Documentation

Methods for object of class "cpg"

Description

Methods and extra functions for class "cpg". plot.cpg creates a QQ plot based on the association p-values or t-statistics from the function cpg.assoc.

Usage


  ## S3 method for class 'cpg'
plot(x, save.plot = NULL, file.type = "pdf", popup.pdf = FALSE, 
                     tplot = FALSE, classic = TRUE,main.title = NULL, eps.size = c(5, 5),
                     gc.p.val = FALSE, gcdisplay = FALSE, ...)

  ## S3 method for class 'cpg'
summary(object,...)

  ## S3 method for class 'cpg'
print(x,...)

  ## S3 method for class 'cpg'
sort(x,decreasing,...)

Arguments

x

Output of class "cpg" from cpg.assoc or cpg.work.

save.plot

Name of the file for the plot to be saved to. If not specified, plot will not be saved.

file.type

Type of file to be saved. Can either be "pdf" or "eps". Selecting file.type="eps" will result in publication quality editable postscript files that can be opened by Adobe Illustrator or Photoshop.

popup.pdf

TRUE or FALSE. If creating a pdf file, this indicates if the plot should appear in a popup window as well. If running in a cluster-like environment, best to leave FALSE.

tplot

Logical. If TRUE, t-statistics will be plotted vs. their expected quantiles. If FALSE (default), -log(p) will be plotted. (Note: if class(x$indep)=='factor' this option will be ignored.)

classic

Logical. If TRUE, a classic qq-plot will be generated, with all p-values plotted against predicted values (including significant). If FALSE Holm-significant CpG sites will not be used to compute expected quantiles and will be plotted separately.

main.title

Main title to be put on the graph. If NULL one based on the analysis will be used.

eps.size

Vector indicating the size of .eps file (if creating one). Correponds to the options horizontal and height in the postscript function.

gc.p.val

Logical. If true, plot will use the genomic control adjusted p-values.

gcdisplay

Logical.If true, plot will display the genomic control value in the legend.

object

Output of class "cpg" from cpg.assoc or cpg.work.

decreasing

logical. Should the sort be increasing or decreasing? Not available for partial sorting.

...

Arguments to be passed to methods, such as graphical parameters.

Value

sort.cpg returns an item of class "cpg" that is sorted by p-value. summary.cpg creates a qq-plot based on the data, and scatterplots or boxplots for the top sites.

Note

Plots with empirical confidence intervals based on permutation tests can be obtained from cpg.perm. See plot.cpg.perm for more info.

Author(s)

Barfield, R.; Kilaru,V.; Conneely, K.
Maintainer: R. Barfield: <rbarfield01@fas.harvard.edu>

See Also

cpg.perm cpg.assoc scatterplot manhattan plot.cpg.perm

Examples

##Using the results from the example given in cpg.assoc.
###NOTE: If you are dealing with large data, do not specify large.data=FALSE. 
###The default option is true.
##This will involve partitioning up the data and performing more gc() to clear up space
##QQ Plot:
data(samplecpg,samplepheno,package="CpGassoc")
test<-cpg.assoc(samplecpg,samplepheno$weight,large.data=FALSE)
plot(test)
##t-statistic plot:
plot(test,tplot=TRUE)


#Getting our plot:
plot(test,classic=FALSE)


##Now an example of sort
head(sort(test)$results)

##Summary
summary(test)

[Package CpGassoc version 2.60 Index]