This function could be called to plot segmentation output, together with the input signal and optional annotation. By default resulting image will be printed to file.
The plot method for class biomvRCNS-class also calls this method. See the vignette for a more complete example.
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/biomvRGviz.Rd_%03d_medium.png", width=480, height=480)
> ### Name: biomvRGviz
> ### Title: Plot segmentation result using Gviz
> ### Aliases: biomvRGviz
>
> ### ** Examples
>
> data(coriell)
> 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 inital sojourn, not utilizing positional information
> 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]))))
> sample<-colnames(coriell)[5]
> runout<-hsmmRun(matrix(values(xgr)[,sample]), sample, xgr, soj, emis=list(type='norm', mu=quantile(unlist(x[,sample]), c(0.25, 0.75)), var=rep(var(unlist(x[,sample])), J)))
[ hsmmRun ] seq 'chr1' column 'Coriell.13330' iteration: 1
> biomvRGviz(exprgr=xgr, seggr=runout$res, tofile=FALSE)
[[1]]
[[1]][[1]]
DataTrack ' '
| genome: NA
| active chromosome: chr1
| positions: 142
| samples:2
| strand: *
[[1]][[2]]
AnnotationTrack 'Coriell.13330'
| genome: NA
| active chromosome: chr1
| annotation features: 3
[[1]][[3]]
Genome axis 'Axis'
5->3 label is set
3->5 label is set
littleTicks label is set
$`1`
[1] "#FF0000FF"
$`2`
[1] "#00FFFFFF"
$main
[1] "chr1:0-241000@Coriell.05296&Coriell.13330"
$min.distance
[1] 0
$min.width
[1] 0
>
>
>
>
>
>
> dev.off()
null device
1
>