data(coriell)
# select only chr1
x<-coriell[coriell[,2]==1,]
xgr<-GRanges(seqnames=paste('chr', x[,2], sep=''), IRanges(start=x[,3], width=1, names=x[,1]))
values(xgr)<-DataFrame(x[,4:5], row.names=NULL)
xgr<-xgr[order(xgr)]
J<-2 ; maxk<-50
# a uniform initial sojourn, not utilizing positional information, just the index
soj<-list(J=J, maxk=maxk, type='gamma', d=cbind(dunif(1:maxk, 1, maxk), dunif(1:maxk, 1, maxk)))
soj$D <- sapply(1:J, function(j) rev(cumsum(rev(soj$d[1:maxk,j]))))
# run 1 sample only, Coriell.13330
sample<-colnames(coriell)[5]
runout<-hsmmRun(matrix(values(xgr)[,sample]), sample, xgr, soj, emis=list(type='norm', mu=range(x[,4:5]), var=rep(var(unlist(x[,4:5])), J)))
Run the code above in your browser using DataLab