tests/testthat/test_go.R

test_that("GO term/id printing", {
    expect_identical(goIdToTerm("GO:0000001"),
                     c('GO:0000001' = "mitochondrion inheritance"))
    expect_identical(goIdToTerm("GO:0000001", names = FALSE),
                     "mitochondrion inheritance")
    expect_identical(goIdToTerm(c("GO:0000001", "GO:0000002", "notvalid")),
                     c('GO:0000001' = "mitochondrion inheritance",
                       'GO:0000002' = "mitochondrial genome maintenance",
                       notvalid = NA))
    expect_identical(goTermToId("mitochondrion inheritance"),
                     c('mitochondrion inheritance' = "GO:0000001"))
    expect_identical(goTermToId("mitochondrion inheritance", names = FALSE),
                     "GO:0000001")
    expect_identical(goTermToId(c("mitochondrion inheritance", "notvalid")),
                     c('mitochondrion inheritance' = "GO:0000001", notvalid = NA))
    expect_identical(prettyGoTermId("mitochondrion inheritance"),
                     "mitochondrion inheritance (GO:0000001)")
    expect_identical(prettyGoTermId("GO:0000001"),
                     "mitochondrion inheritance (GO:0000001)")
    expect_identical(flipGoTermId("mitochondrion inheritance"),
                     c('mitochondrion inheritance' = "GO:0000001"))
    expect_identical(flipGoTermId("GO:0000001", names = FALSE),
                     "mitochondrion inheritance")
})

test_that("GO evidence codes", {
    expect_null(showGOEvidenceCodes())
    expect_length(getGOEvidenceCodes(), 22)
    expect_identical(getGOEvidenceCodes(),
                     c("EXP", "IDA", "IPI", "IMP", "IGI", "IEP",
                       "ISS", "ISO", "ISA", "ISM", "IGC", "IBA",
                       "IBD", "IKR", "IRD", "RCA", "TAS", "NAS", "IC",
                       "ND", "IEA", "NR"))    
})

Try the pRoloc package in your browser

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

pRoloc documentation built on Nov. 8, 2020, 6:26 p.m.