tests/testthat/test-rev_comp.R

test_that("rev_comp works for DNAStringSet", {
  # Create a DNAStringSet
  dna <- Biostrings::DNAStringSet(c("ACGT", "TGCA"))
  # Reverse complement
  dna_rev <- rev_comp(dna)
  # Check the result
  expect_equal(as.character(dna_rev), as.character(dna))
})

test_that("rev_comp works for character vector of sequences", {
  # Create a DNAStringSet
  dna <- c("ACGT", "TGCA")
  # Reverse complement
  dna_rev <- rev_comp(dna)
  # Check the result
  expect_equal(as.character(dna_rev), dna)
})

Try the cubar package in your browser

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

cubar documentation built on April 3, 2025, 8:58 p.m.