biomvRhsmm(x, maxk=NULL, maxbp=NULL, J=3, xPos=NULL, xRange=NULL, usePos='start', emis.type='norm', com.emis=FALSE, xAnno=NULL, soj.type='gamma', q.alpha=0.05, r.var=0.75, useMC=TRUE, cMethod='F-B', maxit=1, maxgap=Inf, tol=1e-06, grp=NULL, cluster.m=NULL, avg.m='median', prior.m='cluster', trim=0, na.rm=TRUE)
GRanges
object with input stored in the meta DataFrame
, assume ordered.
xPos
/ xRange
x
row
IRanges
/GRanges
object, same length as x
rows
TxDb
/ GRanges
/ GRangesList
/ list
object used in sojournAnno
to infer parameters for the sojourn distribution
seq(from=q.alpha, to=1-q.alpha, length.out=J)
mclapply
should be used to speed up the calculation, use options(mc.cores=n)
to set number of parallel processes
TRUE
if NA
value should be ignored
biomvRCNS-class
object:
x
:"GRanges"
, with range information either from real positional data or just indices, with input data matrix stored in the meta columns.
Additional meta columns for the estimated states and associated probabilities for each sample or group will also be appended following the input data matrix.res
:"GRanges"
, each range represent one continuous segment identified, with sample name slot 'SAMPLE', estimated state slot 'STATE' and segment mean slot 'MEAN' stored in the meta columns param
:"list"
, list of all parameters used in the model run, plus the re-estimated emission and sojourn parameters. seqnames
in x
or in xRange
if available, or assuming all data from the same region.
A second layer of stratification is introduced by the argument grp
, which could be used to reflect experimental design.
The assumption is that profiles from the same group could be considered homogeneous, thus processed together if emis.type
is compatible (currently only with 'mvnorm').
Argument for the sojourn density will be initialized as flat prior or estimated from other data before calling the work horse function hsmmRun
.
Then for each batch run results will be combined and eventually a biomvRCNS-class
object will be returned.
See the vignette for more details and examples.
biomvRseg
data(coriell)
xgr<-GRanges(seqnames=paste('chr', coriell[,2], sep=''), IRanges(start=coriell[,3], width=1, names=coriell[,1]))
values(xgr)<-DataFrame(coriell[,4:5], row.names=NULL)
xgr<-sort(xgr)
reshsmm<-biomvRhsmm(x=xgr, maxbp=4E4, J=3, soj.type='gamma', emis.type='norm', grp=c(1,2))
## access model parameters
reshsmm@param$soj.par
reshsmm@param$emis.par
## states assigned and associated probabilities
mcols(reshsmm@x)[,-(1:2)]
Run the code above in your browser using DataLab