tests/testthat/test-tabToSNVcatalogue.R

context("testing conversion from dataframe of SNV to SNV catalogue")

test_that("test tabToSNVcatalogue() to convert a tab file with SNV into an SNV catalogue.", {
  
  testSNVdf <- read.table(file = "test_hrdetect_1/test_hrdetect_1.snv.simple.txt",
                          sep = "\t",header = TRUE,check.names = FALSE,stringsAsFactors = FALSE)
  
  expected_cat <- read.table(file="test.snv.tab",sep = "\t",header = TRUE,stringsAsFactors = FALSE)
  
  res_cat <- tabToSNVcatalogue(testSNVdf,genome.v = "hg19")
  
  expect_equal(res_cat$catalogue,expected_cat)
  
  #expect_error(res <- HRDetect_pipeline(data_matrix))
  #write.table(res_cat$catalogue,file="test.snv.tab",sep = "\t",col.names = TRUE,row.names = TRUE,quote = FALSE)
  
})
pdiakumis/hrdetect documentation built on May 17, 2020, 5:30 p.m.