scatterplot: Plot beta values of individual CpG sites against the...

Description Usage Arguments Details Author(s) See Also Examples

View source: R/scatterplot.R

Description

Plot beta values of individual CpG sites against the independent variable. Can create scatterplots and boxplots. If scatterplots the intercept will be adjusted for any covariates that were included in the model.

Usage

1
2
scatterplot(x, cpg.rank = NULL, cpg.name = NULL, save.plot = NULL, file.type="pdf", 
eps.size = c(5, 5), popup.pdf = FALSE, beta.values = NULL,main.title=NULL, ...)

Arguments

x

Object of class "cpg" or "cpg.perm".

cpg.rank

A vector listing the rank of sites to be plotted. The rank is based on the ordered p-values.

cpg.name

A character vector containing the names of CpG sites to be plotted against the phenotype of interest. This option is ignored if cpg.rank is specified.

save.plot

Prefix of the filename for the plot(s) to be saved to. If specified, plot filenames will be created by appending this prefix to either cpg.rank or cpg.name. 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.

eps.size

Vector indicating the size of .eps file (if creating one). Correponds to horrizontal and height.

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.

beta.values

If the object has been renamed (i.e. x$info$betainfo is no longer in ls(.GlobalEnv)) then specify the new object here.

main.title

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

...

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

Details

An unlimited number of CpG sites can be selected for plotting by specifying either cpg.rank or cpg.name, as shown in the Examples below. Note that only one of these options is needed; if both are entered, cpg.rank will be used.

Author(s)

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

See Also

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#Load the data:
data(samplecpg,samplepheno,package="CpGassoc")
###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
test<-cpg.assoc(samplecpg,samplepheno$weight,large.data=FALSE)
##Using rank, will plot the top three sites in order of significance:
scatterplot(test,c(1:3))
##Using name, specify three sites:
scatterplot(test,cpg.name=c("CpG1182","CpG1000","CpG42"))

##Plotting something that is categorical in nature:
test2<-cpg.assoc(samplecpg[1:200,],factor(samplepheno$Disease),large.data=FALSE)
scatterplot(test2,c(2),beta.values=samplecpg[1:200,])

Example output

Loading required package: nlme
Press enter to continue

Press enter to continue

Press enter to continue

All 3 sites plotted
Press enter to continue

Press enter to continue

Press enter to continue

All 3 sites plotted
Press enter to continue

All 1 sites plotted

CpGassoc documentation built on May 1, 2019, 8:24 p.m.