# prepare
library(minfiData)
data(MsetEx)
d <- CNV.load(MsetEx)
anno <- CNV.create_anno()
# create object
x <- CNV.fit(query = d['GroupB_1'], ref = d[c('GroupA_1', 'GroupA_2', 'GroupA_3')], anno)
# modify object
x <- CNV.bin(x)
x <- CNV.detail(x)
x <- CNV.segment(x)
# general information
x
show(x)
# coefficients of linear regression
coef(x)
# show or replace sample name
names(x)
names(x) <- 'Sample 1'
# output plots
CNV.genomeplot(x)
CNV.genomeplot(x, chr = 'chr6')
#CNV.detailplot(x, name = 'MYCN')
#CNV.detailplot_wrap(x)
CNV.write(x, what = 'segments')
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(conumee)
Loading required package: minfi
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: Biobase
Welcome to Bioconductor
Vignettes contain introductory material; view with
'browseVignettes()'. To cite Bioconductor, see
'citation("Biobase")', and for packages 'citation("pkgname")'.
Loading required package: lattice
Loading required package: GenomicRanges
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: IRanges
Loading required package: GenomeInfoDb
Loading required package: SummarizedExperiment
Loading required package: Biostrings
Loading required package: XVector
Loading required package: bumphunter
Loading required package: foreach
Loading required package: iterators
Loading required package: locfit
locfit 1.5-9.1 2013-03-22
Setting options('download.file.method.GEOquery'='auto')
Setting options('GEOquery.inmemory.gpl'=FALSE)
Loading required package: IlluminaHumanMethylation450kmanifest
Loading required package: IlluminaHumanMethylation450kanno.ilmn12.hg19
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/conumee/CNV.analysis-class.Rd_%03d_medium.png", width=480, height=480)
> ### Name: CNV.analysis-class
> ### Title: CNV.analysis class
> ### Aliases: CNV.analysis-class coef,CNV.analysis-method
> ### names,CNV.analysis-method names<-,CNV.analysis-method
> ### show,CNV.analysis-method
>
> ### ** Examples
>
> # prepare
> library(minfiData)
> data(MsetEx)
> d <- CNV.load(MsetEx)
> anno <- CNV.create_anno()
using genome annotations from UCSC
getting 450k annotations
- 470870 probes used
creating bins
- 53918 bins created
merging bins
- 15833 bins remaining
>
> # create object
> x <- CNV.fit(query = d['GroupB_1'], ref = d[c('GroupA_1', 'GroupA_2', 'GroupA_3')], anno)
>
> # modify object
> x <- CNV.bin(x)
> x <- CNV.detail(x)
no detail regions provided, define using CNV.create_anno
> x <- CNV.segment(x)
>
> # general information
> x
CNV analysis object
created : Wed Jul 6 13:59:35 2016
@name : GroupB_1
@anno : 22 chromosomes, 470870 probes, 15833 bins
@fit : available (noise: 0.237)
@bin : available (shift: -0.016)
@detail : unavailable, run CNV.detail
@seg : available (48 segments)
> show(x)
CNV analysis object
created : Wed Jul 6 13:59:35 2016
@name : GroupB_1
@anno : 22 chromosomes, 470870 probes, 15833 bins
@fit : available (noise: 0.237)
@bin : available (shift: -0.016)
@detail : unavailable, run CNV.detail
@seg : available (48 segments)
>
> # coefficients of linear regression
> coef(x)
(Intercept) X.GroupA_1 X.GroupA_2 X.GroupA_3
-2.34456162 0.88820679 0.08472329 -0.02813503
>
> # show or replace sample name
> names(x)
[1] "GroupB_1"
> names(x) <- 'Sample 1'
>
> # output plots
> CNV.genomeplot(x)
> CNV.genomeplot(x, chr = 'chr6')
> #CNV.detailplot(x, name = 'MYCN')
> #CNV.detailplot_wrap(x)
> CNV.write(x, what = 'segments')
ID chrom loc.start loc.end num.mark bstat pval seg.mean
1 Sample 1 chr1 635684 249195311 1593 NA NA -0.122
2 Sample 1 chr10 105000 135462374 840 NA NA -0.058
3 Sample 1 chr11 130000 48550000 319 7.851693 4.823678e-13 0.042
4 Sample 1 chr11 48975000 56675000 15 12.294071 1.649339e-32 -0.091
5 Sample 1 chr11 56975000 81250000 268 29.745363 9.783071e-192 0.057
6 Sample 1 chr11 82500000 134873258 312 NA NA 0.199
7 Sample 1 chr12 172870 54975000 351 11.507897 2.178154e-28 0.011
8 Sample 1 chr12 55175000 56075000 5 8.018864 1.507192e-13 -0.178
9 Sample 1 chr12 56125000 133770948 492 NA NA -0.064
10 Sample 1 chr13 19110000 19525000 3 5.415424 4.913394e-06 0.119
11 Sample 1 chr13 19725000 114025000 415 9.565066 1.824189e-19 0.348
12 Sample 1 chr13 114075000 115079939 13 NA NA 0.151
13 Sample 1 chr14 19325000 107119770 528 NA NA -0.197
14 Sample 1 chr15 20225000 102410696 571 NA NA -0.189
15 Sample 1 chr16 105000 90222377 624 NA NA 0.114
16 Sample 1 chr17 25000 3875000 59 16.221715 8.901516e-57 -0.015
17 Sample 1 chr17 3925000 38850000 317 7.820936 6.065279e-13 -0.160
18 Sample 1 chr17 38925000 39400000 8 16.150879 3.079978e-56 -0.345
19 Sample 1 chr17 39475000 81122605 430 NA NA -0.053
20 Sample 1 chr18 80000 21125000 81 21.391647 3.413057e-99 -0.031
21 Sample 1 chr18 21375000 77983624 162 NA NA -0.364
22 Sample 1 chr19 180000 59084492 711 NA NA 0.050
23 Sample 1 chr2 130000 243026238 1282 NA NA -0.027
24 Sample 1 chr20 155000 8725000 65 13.487427 3.902028e-39 0.154
25 Sample 1 chr20 9475000 62907760 294 NA NA 0.297
26 Sample 1 chr21 10848948 31025000 27 5.747398 2.031374e-07 -0.073
27 Sample 1 chr21 31525000 32125000 5 8.799096 1.101514e-16 -0.269
28 Sample 1 chr21 32575000 48084948 125 NA NA -0.032
29 Sample 1 chr22 16373925 51222283 300 NA NA -0.122
30 Sample 1 chr3 155000 60150000 362 18.594996 1.060849e-74 0.056
31 Sample 1 chr3 60850000 73675000 64 18.946425 1.813659e-77 0.215
32 Sample 1 chr3 74175000 197831215 552 NA NA 0.035
33 Sample 1 chr4 55000 10475000 136 14.363704 2.842430e-44 -0.125
34 Sample 1 chr4 10925000 190972138 606 NA NA -0.253
35 Sample 1 chr5 55000 162925000 709 15.310711 2.214461e-50 -0.046
36 Sample 1 chr5 163475000 167325000 6 10.853541 1.884955e-25 -0.284
37 Sample 1 chr5 167575000 180777630 134 NA NA -0.038
38 Sample 1 chr6 155000 170952534 988 NA NA 0.024
39 Sample 1 chr7 55000 159039332 952 NA NA 0.064
40 Sample 1 chr8 105000 146277011 726 NA NA -0.133
41 Sample 1 chr9 130000 8300000 20 10.897739 7.644010e-26 0.204
42 Sample 1 chr9 10800000 68326090 60 16.752606 3.851767e-61 0.044
43 Sample 1 chr9 71067734 79450000 17 10.918159 2.924101e-26 -0.235
44 Sample 1 chr9 79625000 90250000 19 14.633854 7.577804e-47 0.014
45 Sample 1 chr9 90475000 97450000 30 12.522876 2.179260e-34 0.225
46 Sample 1 chr9 97650000 99925000 14 6.558129 2.436444e-09 0.074
47 Sample 1 chr9 100150000 123625000 60 15.832035 3.243051e-54 0.217
48 Sample 1 chr9 123675000 141076716 163 NA NA 0.083
seg.median
1 -0.114
2 -0.051
3 0.048
4 -0.081
5 0.061
6 0.203
7 0.014
8 -0.198
9 -0.049
10 0.099
11 0.351
12 0.141
13 -0.182
14 -0.177
15 0.113
16 -0.011
17 -0.145
18 -0.354
19 -0.033
20 -0.038
21 -0.365
22 0.059
23 -0.018
24 0.146
25 0.300
26 -0.079
27 -0.219
28 -0.028
29 -0.117
30 0.065
31 0.215
32 0.042
33 -0.116
34 -0.249
35 -0.040
36 -0.291
37 -0.029
38 0.031
39 0.067
40 -0.124
41 0.183
42 0.051
43 -0.232
44 0.014
45 0.230
46 0.071
47 0.227
48 0.079
>
>
>
>
>
> dev.off()
null device
1
>