File: test_summarizeVariants-methods.R

package info (click to toggle)
r-bioc-variantannotation 1.10.5-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 2,172 kB
  • ctags: 109
  • sloc: ansic: 1,088; sh: 4; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 636 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
grl <- GRangesList(
    A=GRanges("20", IRanges(14370, 17331)),
    B=GRanges("20", IRanges(17330, width=1)),
    C=GRanges("20", IRanges(1110696, width=1)), 
    D=GRanges("20", IRanges(1110696, width=2)))

test_summarizeOverlaps_ <- function()
{
    fl <- system.file("extdata", "ex2.vcf", package="VariantAnnotation")
    vcf <- readVcf(fl, "hg19")
    sv <- summarizeVariants(grl, vcf, findOverlaps)
    checkIdentical(ncol(vcf), ncol(sv))
    checkIdentical(length(grl), nrow(sv))

    target <- matrix(c(0, 0, 1, 1, 2, 1, 1, 1, 1, 0, 1, 1), ncol=3)
    current <- unname(assays(sv)$counts)
    checkIdentical(current, target) 
}