tests/testthat/test_annotateRepeats.R

setwd(file.path(getwd(), "testdata"))

context("Test that annotateRepeats() function works correctly")
test_that("annotateRepeats() generates the correct data structure", {

    gtf <- formatGTF(pathToGTF = "gencodeVM16.gtf")
    # Retrieve back-spliced junctions coordinates
    backSplicedJunctions <- getBackSplicedJunctions(gtf)
    mergedBSJunctions <- mergeBSJunctions(backSplicedJunctions, gtf)

    # Retrieve the genomic features of the circRNAs
    annotatedBSJs <- annotateBSJs(mergedBSJunctions[1, ], gtf)

    if (!requireNamespace("BSgenome.Mmusculus.UCSC.mm10", quietly = TRUE))
        install.packages("BSgenome.Mmusculus.UCSC.mm10")

    # Get BSgenome object
    genome <- BSgenome::getBSgenome("BSgenome.Mmusculus.UCSC.mm10")

    # Retrieve sequences type = "ie"
    targets <-
        getSeqsFromGRs(
            annotatedBSJs,
            genome,
            lIntron = 500,
            lExon = 10,
            type = "ie"

        )

    # Retrieve overlapping repeats
    repeats <-
        annotateRepeats(
            targets,
            annotationHubID  = "AH6075",
            complementary = TRUE
        )

    expect_is(repeats, "list")
    expect_equal(length(repeats), 2)


})

Try the circRNAprofiler package in your browser

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

circRNAprofiler documentation built on Oct. 31, 2019, 3:23 a.m.