Learn R Programming

CNVtools (version 1.66.0)

qt.plot: Makes signal vs trait plots and posterior probabilty distributions

Description

Makes signal vs trait and formatted density plots from the data frame returned by CNVtest.qt

Usage

qt.plot(DataFrame.list, main='', hist.or.dens='histogram')

Arguments

DataFrame.list
The output obtained from the CNVtools fitting algorithm CNVtest.qt
main
Potential title for the graph
hist.or.dens
Either 'histogram' or 'density' to plot the data as an histogram or using a kernel density estimator

Examples

Run this code
	#Load data for CNV for two control cohorts 
	data(A112)
	raw.signal <- as.matrix(A112[, -c(1,2)])
	dimnames(raw.signal)[[1]] <- A112$subject

	#Extract CNV signal using principal components
	pca.signal <- apply.pca(raw.signal)

	#Extract batch, sample
	sample <- factor(A112$subject)
	batches <- rep("ALL",length(sample))

	#Create a fake quantitative trait
	trait <- rnorm(length(sample),mean=9.0,sd=1.0)

	#Fit the CNV with a three component model
	fit.pca <- CNVtest.qt(signal = pca.signal, sample = sample, batch = batches, 
		   	      qt = trait, ncomp = 3, n.H0=3, n.H1=3,
			      model.qt = "~ cn")
			  
	qt.plot(fit.pca)	  

Run the code above in your browser using DataLab