scatterplot {CpGassoc} | R Documentation |
Plot beta values of individual CpG sites against the independent variable.
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. Only available if return.data was set to T.
Usage
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,
user.indep=NULL,main.title=NULL, ...)
Arguments
x |
Object of class |
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 |
eps.size |
Vector indicating the size of .eps file (if creating one). Corresponds to horizontal and height. |
popup.pdf |
|
beta.values |
If the object has been renamed (i.e. |
user.indep |
Default |
main.title |
Main title to be put on the graph. If |
... |
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: <barfieldrichard8@gmail.com>
See Also
cpg.assoc
plot.cpg
manhattan
cpg.perm
plot.cpg.perm
Examples
#Load the data:
data(samplecpg,samplepheno,package="CpGassoc")
test<-cpg.assoc(samplecpg,samplepheno$weight,large.data=FALSE,return.data=TRUE)
##Using rank, will plot the top three sites in order of significance:
scatterplot(test,c(1:3),user.indep=sampleoheno$weight)
##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,return.data=TRUE)
scatterplot(test2,c(2),beta.values=samplecpg[1:200,],
user.indep=sampleoheno$weight)