tests/testthat/test_localPosAAFreq.R

context("Just testing localPoSpkAAF functionality")

test_that("Check whether localPoSpkaaF works properly(Vector)",{
  localspeFreq<-as.vector(LocalPoSpKAAF(seqs="AAMAMCI",k=2))
  expected<-c(1/2,1/3,1/4,2/5,1/6,1/7)
  expect_equal(localspeFreq,expected)
})

test_that("Check whether localPoSpkaaF works properly(Matrix)",{
  localspeFreq<-LocalPoSpKAAF(seqs=c("AAMAMCI","AMMMAMM"),k=2)
  expected<-rbind(c(1/2,1/3,1/4,2/5,1/6,1/7),c(1/2,1/3,2/4,1/5,2/6,3/7))
  dimnames(localspeFreq)<-NULL
  dimnames(expected)<-NULL
  expect_equal(localspeFreq,expected)
})

test_that("Check localPoSpkaaF for sequences with different length",{
  expect_error(LocalPoSpKAAF(seqs=c("AAMAMCI","AMM"),k=2))
})

Try the ftrCOOL package in your browser

Any scripts or data that you put into this service are public.

ftrCOOL documentation built on Nov. 30, 2021, 1:07 a.m.