#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 and trait information
batches <- factor(A112$cohort)
sample <- factor(A112$subject)
trait <- ifelse( A112$cohort == '58C', 0, 1)
#Fit the CNV with a three component model
fit.pca <- CNVtest.binary(signal = pca.signal, sample = sample, batch = batches,
disease.status = trait, ncomp = 3, n.H0=3, n.H1=3,
model.disease = "~ cn")
cnv.plot(fit.pca[['posterior.H0']], batch = '58C', breaks = 30)
Run the code above in your browser using DataLab