1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
context('parsing functions')
library(tidyverse)
library(stringr)
example <- readVcf(.testfile("vcf4.2.example.sv.vcf"), "")
simple <- readVcf(.testfile("simple.vcf"), "")
breakend <- readVcf(.testfile("breakend.vcf"), "")
test_that("bedpe2breakpointgr creates unique ids", {
gr <- pairs2breakpointgr(import(.testfile("unnamed.bedpe")))
expect_equal(c("1", "3", "2", "4"), as.character(seqnames(gr)))
expect_equal(c(19356, 1300148+1, 19427, 1302837+1), start(gr))
expect_equal(c(19356, 1300151, 19427, 1302840), end(gr))
expect_equal(c("+", "+", "-", "+"), as.character(strand(gr)))
expect_equal(c(1, 41, 1, 41), gr$QUAL)
expect_equal(c("bedpe1_1", "bedpe2_1", "bedpe1_2", "bedpe2_2"), names(gr))
})
# unpaired breakend
test_that("partner fails if missing mate", {
expect_error(partner(breakpointRanges(breakend)[1,]))
})
|