input data matrix, or a GRanges object with input stored in the meta DataFrame
maxk
maximum length of a segment
maxbp
maximum length of a segment in bp, given positional information specified in xPos / xRange / or x
maxseg
maximum number of segment the function will try
xPos
a vector of positions for each x row
xRange
a IRanges/GRanges object, same length as x rows
usePos
character value to indicate whether the 'start', 'end' or 'mid' point position should be used
family
family of x distribution, only the following types are supported: 'norm', 'nbinom', 'pois'
penalty
penalty method used for determining the optimal number of segment using likelihood, possible values are 'none','AIC','AICc','BIC','SIC','HQIC', 'mBIC'
twoStep
TRUE if a second stage merging will be performed after the initial group segmentation
segDisp
TRUE if a segment-wise estimation of dispersion parameter rather than using a overall estimation
useMC
TRUE if mclapply should be used to speed up the calculation for nbinom dispersion estimation
useSum
TRUE if using grand sum across sample / x columns, like in the tilingArray solution
comVar
TRUE if assuming common variance across samples (x columns)
maxgap
max distance between neighbouring feature to consider a split
tol
tolerance level of the likelihood change to determining the termination of the EM run
grp
vector of group assignment for each sample, with a length the same as columns in the data matrix, samples within each group would be processed simultaneously if a multivariate emission distribution is available
cluster.m
clustering method for prior grouping, possible values are 'ward','single','complete','average','mcquitty','median','centroid'
avg.m
method to calculate average value for each segment, 'median' or 'mean' possibly trimmed
trim
the fraction (0 to 0.5) of observations to be trimmed from each end of x before the mean is computed. Values of trim outside that range are taken as the nearest endpoint.
na.rm
TRUE if NA value should be ignored
Details
A homogeneous segmentation algorithm, using dynamic programming like in tilingArray; however capable of handling count data from sequencing.
Value
A biomvRCNS-class object:
x:
Object of class "GRanges", with range information either from real positional data or just indices, with input data matrix stored in the meta columns.
res:
Object of class "GRanges" , each range represent one continuous segment identified, with sample name slot 'SAMPLE' and segment mean slot 'MEAN' stored in the meta columns
param:
Object of class "list", list of all parameters used in the model run.
References
Piegorsch, W. W. (1990). Maximum likelihood estimation for the negative binomial dispersion parameter. Biometrics, 863-867.
Picard,F. et al. (2005) A statistical approach for array CGH data analysis. BMC Bioinformatics, 6, 27.
Huber,W. et al. (2006) Transcript mapping with high density oligonucleotide tiling arrays. Bioinformatics, 22, 1963-1970. .
Zhang, N. R. and Siegmund, D. O. (2007). A Modified Bayes Information Criterion with Applications to the Analysis of Comparative Genomic Hybridization Data. Biometrics 63 22-32.
Robinson MD and Smyth GK (2008). Small-sample estimation of negative binomial dispersion, with applications to SAGE data. Biostatistics, 9, 321-332
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/biomvRseg.Rd_%03d_medium.png", width=480, height=480)
> ### Name: biomvRseg
> ### Title: Homogeneous segmentation of multi-sample genomic data
> ### Aliases: biomvRseg
>
> ### ** Examples
>
> 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<-xgr[order(xgr)]
> resseg<-biomvRseg(x=xgr, maxbp=4E4, maxseg=10, family='norm', grp=c(1,2))
Processing sequence chr1
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr1 complete.
Processing sequence chr2
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr2 complete.
Processing sequence chr3
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr3 complete.
Processing sequence chr4
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr4 complete.
Processing sequence chr5
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr5 complete.
Processing sequence chr6
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr6 complete.
Processing sequence chr7
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr7 complete.
Processing sequence chr8
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr8 complete.
Processing sequence chr9
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr9 complete.
Processing sequence chr10
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr10 complete.
Processing sequence chr11
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr11 complete.
Processing sequence chr12
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr12 complete.
Processing sequence chr13
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr13 complete.
Processing sequence chr14
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr14 complete.
Processing sequence chr15
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr15 complete.
Processing sequence chr16
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr16 complete.
Processing sequence chr17
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr17 complete.
Processing sequence chr18
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr18 complete.
Processing sequence chr19
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr19 complete.
Processing sequence chr20
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr20 complete.
Processing sequence chr21
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr21 complete.
Processing sequence chr22
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr22 complete.
Processing sequence chr23
...
Step 1 building segmentation model for group 1 ...
Step 1 building segmentation model for group 1 complete.
No need to run step 2 merging, processing complete for column 1 from group 1.
Building segmentation model for group 1 complete.
Step 1 building segmentation model for group 2 ...
Step 1 building segmentation model for group 2 complete.
No need to run step 2 merging, processing complete for column 2 from group 2.
Building segmentation model for group 2 complete.
Processing sequence chr23 complete.
>
>
>
>
>
> dev.off()
null device
1
>