tests/testthat/test-search_phmmer.R

test_that("non protein sequences fails", {
  search_phmmer("12333333dshjdkasdb") %>%
    expect_error(paste0("`seq` must be a protein sequence.\n",
                        "Characters not belonging to the AA standar ",
                        "alphabet were found."))
  search_phmmer(12333333) %>%
    expect_error(paste0("`seq` must be a protein sequence.\n",
                        "Characters not belonging to the AA standar ",
                        "alphabet were found."))
  search_phmmer(environment()) %>%
    expect_error()

})

testthat::skip_if_offline()
testthat::skip_on_ci()
test_that("it works with example", {
  seq <- "MGPSENDPNLFVALYDFVASGDNTLSITKGEKLRVLGYNHNG"
  search_phmmer(seq) %>%
    expect_error(NA)
  search_phmmer(c(seq, seq), db = c("swissprot", "pdb", "ensembl")) %>%
    expect_error(NA)
})

test_that("it download fasta & alignment", {
  seq <- "MGPSENDPNLFVALYDFVASGDNTLSITKGEKLRVLGYNHNG"
  search_phmmer(seq, dbs="swissprot",
                fullseqfasta = TRUE,verbose=TRUE, timeout=90,
                alignment = TRUE) %>%
    expect_error(NA)

})
currocam/taxa2hmmer documentation built on April 10, 2022, 11:02 a.m.