Last data update: 2014.03.03
|
R: Simulate exemplary segmentation data.
simSegData | R Documentation |
Simulate exemplary segmentation data.
Description
Simulate exemplary segmentation data.
Usage
simSegData(nseg=10, J=3, soj, emis, seed=1234, toPlot=FALSE)
Arguments
nseg |
size of initial segments pool
|
J |
states number
|
soj |
a list object containing sojourn settings
|
emis |
a list object containing emission settings
|
seed |
seed for simulation
|
toPlot |
whether to output a pdf image of the simulated series
|
Value
a list object containing the simulated data and the segment info
E |
a numeric vector of the simulated data serie
|
L |
a vector of the length for each continuous segment
|
S |
a vector of state assignment for each segment
|
pdf |
the name of the output pdf file if any
|
Examples
soj<-list(type='pois', lambda=c(200, 100, 10))
emis<-list(type='pois', lambda=1:3)
simSegData(soj=soj, emis=emis)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(biomvRCNS)
Loading required package: IRanges
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: 'BiocGenerics'
The following objects are masked from 'package:parallel':
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from 'package:stats':
IQR, mad, xtabs
The following objects are masked from 'package:base':
Filter, Find, Map, Position, Reduce, anyDuplicated, append,
as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
rbind, rownames, sapply, setdiff, sort, table, tapply, union,
unique, unsplit
Loading required package: S4Vectors
Loading required package: stats4
Attaching package: 'S4Vectors'
The following objects are masked from 'package:base':
colMeans, colSums, expand.grid, rowMeans, rowSums
Loading required package: GenomicRanges
Loading required package: GenomeInfoDb
Loading required package: Gviz
Loading required package: grid
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/biomvRCNS/simSegData.Rd_%03d_medium.png", width=480, height=480)
> ### Name: simSegData
> ### Title: Simulate exemplary segmentation data.
> ### Aliases: simSegData
>
> ### ** Examples
>
> soj<-list(type='pois', lambda=c(200, 100, 10))
> emis<-list(type='pois', lambda=1:3)
> simSegData(soj=soj, emis=emis)
$L
[1] 87 10 205 7 105 191
$E
[1] 4 2 4 3 2 2 4 2 1 1 0 4 2 4 2 0 0 2 0 3 2 3 3 3 3 1 2 0 1 2 2 0 3 3 0 3 1
[38] 0 4 3 1 2 1 1 3 2 1 4 3 4 0 0 4 1 1 2 1 2 2 1 2 0 2 1 1 0 2 2 2 1 5 2 5 1
[75] 1 1 2 1 2 4 2 3 4 2 2 0 2 1 4 4 1 2 2 1 1 5 4 1 2 2 3 0 2 1 1 2 0 1 1 2 0
[112] 0 3 0 0 1 0 0 1 2 1 3 0 1 1 3 1 1 2 2 2 1 4 1 2 1 1 0 0 2 5 3 2 1 0 1 1 0
[149] 1 2 1 1 0 0 1 1 1 1 0 0 0 3 1 3 1 1 1 0 1 1 1 1 0 0 2 1 2 0 1 2 2 0 1 0 1
[186] 0 1 1 1 2 2 0 1 2 2 2 0 2 0 3 3 1 0 2 1 0 1 0 2 0 0 3 1 2 0 0 1 0 0 1 1 2
[223] 0 4 1 1 2 1 1 1 3 0 2 1 2 2 3 2 0 0 2 0 2 3 1 0 1 2 0 4 1 2 0 2 2 1 0 0 1
[260] 2 0 1 1 1 0 1 1 2 2 0 1 0 0 0 0 3 3 1 3 2 0 1 0 1 1 1 1 0 0 0 0 1 1 1 2 0
[297] 1 1 0 2 0 0 0 2 1 3 1 1 1 1 3 1 5 0 0 2 6 4 0 0 0 3 1 2 2 1 0 3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