context("DNA related tests")
test_that("dna reference objects correctly throws error when object has no sequences.", {
blank <- HybridCheck:::HCseq$new()
expect_is(blank, "HCseq")
expect_false(blank$hasDNA())
expect_error(blank$enforceDNA())
expect_error(blank$numberOfSequences())
expect_error(blank$getFullBp())
expect_error(blank$getInformativeBp())
expect_error(blank$numberOfSequences())
expect_error(blank$getFullLength())
expect_error(blank$getInformativeLength())
expect_error(blank$getSequenceNames())
expect_error(blank$textSummary())
expect_error(blank$htmlSummary())
expect_error(blank$show())
expect_error(blank$pullTriplet(c("Seq1", "Seq2", "Seq3")))
})
test_that("dna reference objects correctly load and return information about sequences loaded in.", {
data(MySequences)
tenSeqs <- HybridCheck:::HCseq$new(MySequences)
expect_is(tenSeqs, "HCseq")
expect_true(tenSeqs$hasDNA())
expect_is(tenSeqs$numberOfSequences(), "integer")
expect_equal(tenSeqs$numberOfSequences(), 10)
expect_is(tenSeqs$getFullLength(), "integer")
expect_equal(tenSeqs$getFullLength(), 400000)
expect_is(tenSeqs$getFullBp(), "integer")
expect_equal(tenSeqs$getFullBp(), 1:400000)
expect_is(tenSeqs$getInformativeBp(), "integer")
expect_less_than(tenSeqs$getInformativeLength(), tenSeqs$getFullLength())
seqnames <- tenSeqs$getSequenceNames()
expect_is(seqnames, "character")
expect_equal(length(seqnames), tenSeqs$numberOfSequences())
expect_is(tenSeqs$textSummary(), "character")
expect_is(tenSeqs$htmlSummary(), "character")
triplet <- tenSeqs$pullTriplet(c("Seq1", "Seq2", "Seq3"))
expect_is(triplet, "DNAStringSet")
expect_equal(length(triplet), 3)
expect_equal(names(triplet), c("Seq1", "Seq2", "Seq3"))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.