tests/test02-Prior.R

library(DeepCNV)

flat <- setCNVPrior(alpha=1, beta=1, pAbnormal=1/3)
summary(flat)
plot(flat)

prior <- setCNVPrior(alpha=1.2, beta=4.8, pAbnormal=0.6)
summary(prior)
plot(prior)

cnPrior(prior)

prior <- setCNVPrior(1.2, 4.8, pGain=0.7, pLoss=0.1)
summary(prior)

# test some nonsensical inputs
try( setCNVPrior(1, 1, pAbnormal = -1) )
try( setCNVPrior(1, 1, pAbnormal = 2) )
try( setCNVPrior(1, 1, pGain=0.6, pLoss=0.6) )
try( setCNVPrior(1:3, 1, pAbnormal = 0.5) )
try( setCNVPrior(1, 1, pAbnormal = c(0.1, 0.2)) )

# this may surprise the user; should add a warning
prior <- setCNVPrior(1.2, 4.8, pAbnormal=0.4, pGain=0.7, pLoss=0.1)
summary(prior)

Try the DeepCNV package in your browser

Any scripts or data that you put into this service are public.

DeepCNV documentation built on May 2, 2019, 5:23 p.m.