suppressPackageStartupMessages({ library(GenomicFeatures) library(TxDb.Hsapiens.UCSC.hg19.knownGene) }) expose_all <- function (package) { attachname <- paste0(package, "_all") while (attachname %in% search()) detach(attachname, character.only = TRUE) pkgns <- loadNamespace(package) attach(pkgns, name = attachname) invisible(pkgns) } suppressMessages(expose_all("TnT"))
data <- RangeTrackData(range = IRanges::IRanges(1:4, 5:8), tooltip = data.frame(start = 1:4, width = 5)) compileTrackData(data) compileTrackData(data, full = TRUE)
gpos <- GRanges("chr12", IRanges(seq(1, 10, 3), width = 1)) mcols(gpos) <- as.data.frame(gpos) pt <- PosTrackData(gpos) compileTrackData(pt) compileTrackData(pt, full = TRUE) pt <- PosValTrackData(gpos, val = start(gpos)) compileTrackData(pt) compileTrackData(pt, full = TRUE)
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene::TxDb.Hsapiens.UCSC.hg19.knownGene gene <- genes(txdb, columns = c("gene_id", "tx_id")) GeneTrackData(gene[1:4]) ir <- IRanges(1:3, width = 10) GeneTrackData(ir, labels = paste("gene", 1:3))
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene::TxDb.Hsapiens.UCSC.hg19.knownGene gr <- genes(txdb) ft <- FeatureTrack(gr) #compileTrack(ft) TnTBoard(ft, GRanges("chr12", IRanges(100000,400000)))
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene::TxDb.Hsapiens.UCSC.hg19.knownGene GeneTrackDataFromTxDb(txdb, c("chrX", "chrY"))
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene::TxDb.Hsapiens.UCSC.hg19.knownGene grl <- exonsBy(txdb)[1:3] a <- TxTrackDataFromGRangesList(grl) a[1]$key # When one of the GRanges is empty grl$`1` <- grl$`1`[numeric(0)] b <- TxTrackDataFromGRangesList(grl) b[1]$key compileTrackData(b)
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene::TxDb.Hsapiens.UCSC.hg19.knownGene seqlevels(txdb) <- "chrY" exby <- exonsBy(txdb) seqlevels(txdb) <- seqlevels0(txdb) names(exby) <- paste("tx", names(exby)) gft <- GroupFeatureTrack(exby) TnTBoard(gft, view.range = GRanges("chrY", IRanges(1000, 400000)))
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene::TxDb.Hsapiens.UCSC.hg19.knownGene tdata <- TxTrackDataFromTxDb(txdb, "chrUn_gl000221") compileTrackData(tdata)
bt <- BlockTrack(GRanges("chr12", IRanges(1:5 * 100, width = 10), label = paste("range", 1:5))) trackData(bt) tooltip(bt) testthat::expect_error( tooltip(bt) <- c(1:5) ) tooltip(bt) <- data.frame(start = 1:5 * 100) bt compileTrack(bt) TnTBoard(list(bt), view.range = range(trackData(bt)))
sessionInfo()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.