Last data update: 2014.03.03
R: Integrate structural variations predicted by different...
methodsMerge R Documentation
Integrate structural variations predicted by different methods
Description
Integrate predictions of different tools to provide more reliable
structural variations.
Usage
methodsMerge(..., others=NULL,
overLapPerDel = 0.8, overLapPerDup = 0.8, overLapPerInv = 0.8,
numMethodsSupDel = 2, numMethodsSupDup = 2, numMethodsSupInv = 2)
Arguments
...
results of different SVs predictions read in to R by intansv.
others
a data frame of structural variations predicted by other tools.
overLapPerDel
Deletions predicted by different methods that have reciprocal coordinate overlap larger than this threshold would be clustered together
overLapPerDup
Duplications predicted by different methods that have reciprocal coordinate overlap larger than this threshold would be clustered together
overLapPerInv
Inversions predicted by different methods that have reciprocal coordinate overlap larger than this threshold would be clustered together
numMethodsSupDel
Deletion clusters supportted by no more than this
threshold of read support would be discarded
numMethodsSupDup
Duplication clusters supportted by no more than this
threshold of read support would be discarded
numMethodsSupInv
Inversion clusters supportted by no more than this
threshold of read support would be discarded
Details
A structural variation (deletion, duplication, inversion et al.) may
be reported by different tools. However, the boundaries of this structural
variation predicted by different tools don't always agree with each other.
Predictions of different methods with reciprocal overlap more than 80
percent were merged. Structural varions supported by only one method were
discarded.
Value
A list with the following components:
del
the integrated deletions of different methods.
dup
the integrated duplications of different methods.
inv
the integrated inversions of different methods.
Author(s)
Wen Yao
Examples
breakdancer <- readBreakDancer(system.file("extdata/ZS97.breakdancer.sv",
package="intansv"))
str(breakdancer)
cnvnator <- readCnvnator(system.file("extdata/cnvnator",package="intansv"))
str(cnvnator)
svseq <- readSvseq(system.file("extdata/svseq2",package="intansv"))
str(svseq)
delly <- readDelly(system.file("extdata/delly",package="intansv"))
str(delly)
pindel <- readPindel(system.file("extdata/pindel",package="intansv"))
str(pindel)
sv_all_methods <- methodsMerge(breakdancer,pindel,cnvnator,delly,svseq)
str(sv_all_methods)
sv_all_methods.1 <- methodsMerge(breakdancer,pindel,cnvnator,delly,svseq,
overLapPerDel=0.7)
str(sv_all_methods.1)
sv_all_methods.2 <- methodsMerge(breakdancer,pindel,cnvnator,delly,svseq,
overLapPerDel=0.8, numMethodsSupDel=3)
str(sv_all_methods.2)
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(intansv)
Loading required package: plyr
Loading required package: ggbio
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: ggplot2
Need specific help about ggbio? try mailing
the maintainer or visit http://tengfei.github.com/ggbio/
Attaching package: 'ggbio'
The following objects are masked from 'package:ggplot2':
geom_bar, geom_rect, geom_segment, ggsave, stat_bin, stat_identity,
xlim
Loading required package: GenomicRanges
Loading required package: S4Vectors
Loading required package: stats4
Attaching package: 'S4Vectors'
The following object is masked from 'package:plyr':
rename
The following objects are masked from 'package:base':
colMeans, colSums, expand.grid, rowMeans, rowSums
Loading required package: IRanges
Attaching package: 'IRanges'
The following object is masked from 'package:plyr':
desc
Loading required package: GenomeInfoDb
Warning message:
replacing previous import 'ggplot2::Position' by 'BiocGenerics::Position' when loading 'ggbio'
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/intansv/methodsMerge.Rd_%03d_medium.png", width=480, height=480)
> ### Name: methodsMerge
> ### Title: Integrate structural variations predicted by different methods
> ### Aliases: methodsMerge
>
> ### ** Examples
>
> breakdancer <- readBreakDancer(system.file("extdata/ZS97.breakdancer.sv",
+ package="intansv"))
> str(breakdancer)
List of 2
$ del:'data.frame': 1007 obs. of 4 variables:
..$ chromosome: chr [1:1007] "chr05" "chr05" "chr05" "chr05" ...
..$ pos1 : num [1:1007] 65586 86442 120288 153694 201845 ...
..$ pos2 : num [1:1007] 65938 87430 127670 153801 201959 ...
..$ size : num [1:1007] 353 988 7382 107 114 ...
$ inv:'data.frame': 17 obs. of 4 variables:
..$ chromosome: chr [1:17] "chr05" "chr05" "chr05" "chr05" ...
..$ pos1 : num [1:17] 1291574 6942451 12014581 15092428 18770962 ...
..$ pos2 : num [1:17] 1291678 6944637 12015915 15157500 18771414 ...
..$ size : num [1:17] 105 2186 1334 65072 452 ...
- attr(*, "method")= chr "BreakDancer"
>
> cnvnator <- readCnvnator(system.file("extdata/cnvnator",package="intansv"))
> str(cnvnator)
List of 2
$ del:'data.frame': 369 obs. of 4 variables:
..$ chromosome: chr [1:369] "chr05" "chr05" "chr05" "chr05" ...
..$ pos1 : num [1:369] 104101 230401 348301 1089301 1524301 ...
..$ pos2 : num [1:369] 110700 248400 350100 1103100 1529700 ...
..$ size : num [1:369] 6599 17999 1799 13799 5399 ...
$ dup:'data.frame': 113 obs. of 4 variables:
..$ chromosome: chr [1:113] "chr05" "chr05" "chr05" "chr05" ...
..$ pos1 : num [1:113] 405001 973201 1346401 5036101 6419101 ...
..$ pos2 : num [1:113] 408900 977700 1359000 5055600 6423300 ...
..$ size : num [1:113] 3899 4499 12599 19499 4199 ...
- attr(*, "method")= chr "CNVnator"
>
> svseq <- readSvseq(system.file("extdata/svseq2",package="intansv"))
> str(svseq)
List of 1
$ del:'data.frame': 135 obs. of 4 variables:
..$ chromosome: chr [1:135] "chr10" "chr10" "chr10" "chr10" ...
..$ pos1 : num [1:135] 84242 93888 288998 316662 337456 ...
..$ pos2 : num [1:135] 87392 94156 289244 318112 337668 ...
..$ size : num [1:135] 3150 268 246 1450 212 ...
- attr(*, "method")= chr "SVseq2"
>
> delly <- readDelly(system.file("extdata/delly",package="intansv"))
> str(delly)
List of 3
$ del:'data.frame': 1208 obs. of 4 variables:
..$ chromosome: chr [1:1208] "chr05" "chr05" "chr05" "chr05" ...
..$ pos1 : int [1:1208] 65580 86457 153671 172303 201850 208219 226809 230526 276053 276807 ...
..$ pos2 : num [1:1208] 65949 87419 153829 172439 201959 ...
..$ size : num [1:1208] 369 962 158 136 109 358 104 128 129 143 ...
$ dup:'data.frame': 29 obs. of 4 variables:
..$ chromosome: chr [1:29] "chr05" "chr05" "chr05" "chr05" ...
..$ pos1 : int [1:29] 120788 910613 1133978 1614997 5696565 5757285 14472343 17377712 21630340 22551409 ...
..$ pos2 : num [1:29] 128008 911328 1136610 1616026 5699335 ...
..$ size : num [1:29] 7220 715 2632 1029 2770 ...
$ inv:'data.frame': 23 obs. of 4 variables:
..$ chromosome: chr [1:23] "chr05" "chr05" "chr05" "chr05" ...
..$ pos1 : int [1:23] 5550226 6942367 8700896 10402721 11062213 12014418 13291663 15092334 18737134 18770845 ...
..$ pos2 : num [1:23] 5550352 6944731 8702504 10402842 11631416 ...
..$ size : num [1:23] 126 2364 1608 121 569203 ...
- attr(*, "method")= chr "DELLY"
>
> pindel <- readPindel(system.file("extdata/pindel",package="intansv"))
> str(pindel)
List of 3
$ del:'data.frame': 677 obs. of 4 variables:
..$ chromosome: chr [1:677] "chr05" "chr05" "chr05" "chr05" ...
..$ pos1 : num [1:677] 76477 86438 120431 334346 366428 ...
..$ pos2 : num [1:677] 76913 87419 127842 334613 367941 ...
..$ size : num [1:677] 435 980 7410 266 1512 ...
$ inv:'data.frame': 52 obs. of 4 variables:
..$ chromosome: chr [1:52] "chr05" "chr05" "chr05" "chr05" ...
..$ pos1 : num [1:52] 777580 1385804 2580617 3062624 6298321 ...
..$ pos2 : num [1:52] 777810 1390029 2583765 3062746 6311292 ...
..$ size : num [1:52] 229 4224 3147 121 12970 ...
$ dup:'data.frame': 68 obs. of 4 variables:
..$ chromosome: chr [1:68] "chr05" "chr05" "chr05" "chr05" ...
..$ pos1 : num [1:68] 97139 120110 910586 957199 1018140 ...
..$ pos2 : num [1:68] 97308 127734 911325 957324 1018273 ...
..$ size : num [1:68] 168 7623 738 124 132 ...
- attr(*, "method")= chr "Pindel"
>
> sv_all_methods <- methodsMerge(breakdancer,pindel,cnvnator,delly,svseq)
> str(sv_all_methods)
List of 3
$ del:'data.frame': 947 obs. of 8 variables:
..$ chromosome : chr [1:947] "chr05" "chr05" "chr05" "chr05" ...
..$ pos1 : num [1:947] 65583 86446 120360 201848 208218 ...
..$ pos2 : num [1:947] 65944 87423 127756 201959 208574 ...
..$ BreakDancer: chr [1:947] "Y" "Y" "Y" "Y" ...
..$ Pindel : chr [1:947] "N" "Y" "Y" "N" ...
..$ CNVnator : chr [1:947] "N" "N" "N" "N" ...
..$ DELLY : chr [1:947] "Y" "Y" "N" "Y" ...
..$ SVseq2 : chr [1:947] "N" "N" "N" "N" ...
$ dup:'data.frame': 11 obs. of 8 variables:
..$ chromosome : chr [1:11] "chr05" "chr05" "chr05" "chr05" ...
..$ pos1 : num [1:11] 120449 910600 1614997 5696556 5757284 ...
..$ pos2 : num [1:11] 127871 911326 1616026 5699328 5758092 ...
..$ BreakDancer: chr [1:11] "N" "N" "N" "N" ...
..$ Pindel : chr [1:11] "Y" "Y" "Y" "Y" ...
..$ CNVnator : chr [1:11] "N" "N" "N" "N" ...
..$ DELLY : chr [1:11] "Y" "Y" "Y" "Y" ...
..$ SVseq2 : chr [1:11] "N" "N" "N" "N" ...
$ inv:'data.frame': 12 obs. of 8 variables:
..$ chromosome : chr [1:12] "chr05" "chr05" "chr05" "chr05" ...
..$ pos1 : num [1:12] 6942409 12014500 15090018 29431740 2152662 ...
..$ pos2 : num [1:12] 6944684 12015915 15158197 29432418 2240864 ...
..$ BreakDancer: chr [1:12] "Y" "Y" "Y" "N" ...
..$ Pindel : chr [1:12] "N" "N" "Y" "Y" ...
..$ CNVnator : chr [1:12] "N" "N" "N" "N" ...
..$ DELLY : chr [1:12] "Y" "Y" "Y" "Y" ...
..$ SVseq2 : chr [1:12] "N" "N" "N" "N" ...
>
> sv_all_methods.1 <- methodsMerge(breakdancer,pindel,cnvnator,delly,svseq,
+ overLapPerDel=0.7)
> str(sv_all_methods.1)
List of 3
$ del:'data.frame': 996 obs. of 8 variables:
..$ chromosome : chr [1:996] "chr05" "chr05" "chr05" "chr05" ...
..$ pos1 : num [1:996] 65583 86446 120360 201848 208218 ...
..$ pos2 : num [1:996] 65944 87423 127756 201959 208574 ...
..$ BreakDancer: chr [1:996] "Y" "Y" "Y" "Y" ...
..$ Pindel : chr [1:996] "N" "Y" "Y" "N" ...
..$ CNVnator : chr [1:996] "N" "N" "N" "N" ...
..$ DELLY : chr [1:996] "Y" "Y" "N" "Y" ...
..$ SVseq2 : chr [1:996] "N" "N" "N" "N" ...
$ dup:'data.frame': 11 obs. of 8 variables:
..$ chromosome : chr [1:11] "chr05" "chr05" "chr05" "chr05" ...
..$ pos1 : num [1:11] 120449 910600 1614997 5696556 5757284 ...
..$ pos2 : num [1:11] 127871 911326 1616026 5699328 5758092 ...
..$ BreakDancer: chr [1:11] "N" "N" "N" "N" ...
..$ Pindel : chr [1:11] "Y" "Y" "Y" "Y" ...
..$ CNVnator : chr [1:11] "N" "N" "N" "N" ...
..$ DELLY : chr [1:11] "Y" "Y" "Y" "Y" ...
..$ SVseq2 : chr [1:11] "N" "N" "N" "N" ...
$ inv:'data.frame': 12 obs. of 8 variables:
..$ chromosome : chr [1:12] "chr05" "chr05" "chr05" "chr05" ...
..$ pos1 : num [1:12] 6942409 12014500 15090018 29431740 2152662 ...
..$ pos2 : num [1:12] 6944684 12015915 15158197 29432418 2240864 ...
..$ BreakDancer: chr [1:12] "Y" "Y" "Y" "N" ...
..$ Pindel : chr [1:12] "N" "N" "Y" "Y" ...
..$ CNVnator : chr [1:12] "N" "N" "N" "N" ...
..$ DELLY : chr [1:12] "Y" "Y" "Y" "Y" ...
..$ SVseq2 : chr [1:12] "N" "N" "N" "N" ...
>
> sv_all_methods.2 <- methodsMerge(breakdancer,pindel,cnvnator,delly,svseq,
+ overLapPerDel=0.8, numMethodsSupDel=3)
> str(sv_all_methods.2)
List of 3
$ del:'data.frame': 519 obs. of 8 variables:
..$ chromosome : chr [1:519] "chr05" "chr05" "chr05" "chr05" ...
..$ pos1 : num [1:519] 86446 334348 348383 366429 379194 ...
..$ pos2 : num [1:519] 87423 334626 350108 367945 404515 ...
..$ BreakDancer: chr [1:519] "Y" "Y" "Y" "Y" ...
..$ Pindel : chr [1:519] "Y" "Y" "N" "Y" ...
..$ CNVnator : chr [1:519] "N" "N" "Y" "N" ...
..$ DELLY : chr [1:519] "Y" "Y" "Y" "Y" ...
..$ SVseq2 : chr [1:519] "N" "N" "N" "N" ...
$ dup:'data.frame': 11 obs. of 8 variables:
..$ chromosome : chr [1:11] "chr05" "chr05" "chr05" "chr05" ...
..$ pos1 : num [1:11] 120449 910600 1614997 5696556 5757284 ...
..$ pos2 : num [1:11] 127871 911326 1616026 5699328 5758092 ...
..$ BreakDancer: chr [1:11] "N" "N" "N" "N" ...
..$ Pindel : chr [1:11] "Y" "Y" "Y" "Y" ...
..$ CNVnator : chr [1:11] "N" "N" "N" "N" ...
..$ DELLY : chr [1:11] "Y" "Y" "Y" "Y" ...
..$ SVseq2 : chr [1:11] "N" "N" "N" "N" ...
$ inv:'data.frame': 12 obs. of 8 variables:
..$ chromosome : chr [1:12] "chr05" "chr05" "chr05" "chr05" ...
..$ pos1 : num [1:12] 6942409 12014500 15090018 29431740 2152662 ...
..$ pos2 : num [1:12] 6944684 12015915 15158197 29432418 2240864 ...
..$ BreakDancer: chr [1:12] "Y" "Y" "Y" "N" ...
..$ Pindel : chr [1:12] "N" "N" "Y" "Y" ...
..$ CNVnator : chr [1:12] "N" "N" "N" "N" ...
..$ DELLY : chr [1:12] "Y" "Y" "Y" "Y" ...
..$ SVseq2 : chr [1:12] "N" "N" "N" "N" ...
>
>
>
>
>
> dev.off()
null device
1
>