### R code from vignette source 'vignettes/ggbio/inst/doc/txdb.Rnw' ################################################### ### code chunk number 1: loading-txdb ################################################### library(TxDb.Hsapiens.UCSC.hg19.knownGene) txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene ## suppose you already know the region you want to visualize ## or for human genome, you can try following commented code ## data(genesymbol, package = "biovizBase") ## genesymbol["ALDOA"] aldoa.gr <- GRanges("chr16", IRanges(30064491, 30081734)) aldoa.gr ################################################### ### code chunk number 2: txdb-full ################################################### library(ggbio) p1 <- autoplot(txdb, which = aldoa.gr) print(p1) ################################################### ### code chunk number 3: txdb-full-aes ################################################### library(ggbio) p1 <- autoplot(txdb, which = aldoa.gr, fill = "brown", color = "brown") print(p1) ################################################### ### code chunk number 4: txdb-reduce ################################################### p2 <- autoplot(txdb, which = aldoa.gr, stat = "reduce") print(p2) ################################################### ### code chunk number 5: tracks ################################################### tracks(full = p1, reduced = p2, heights = c(4,1)) + theme_alignment(grid=FALSE, border = FALSE) ################################################### ### code chunk number 6: change-intron-geom ################################################### autoplot(txdb, which = aldoa.gr, gap.geom = "chevron") ################################################### ### code chunk number 7: change-intron-geom-arrow ################################################### library(grid) autoplot(txdb, which = aldoa.gr, arrow.rate = 0.001, length = unit(0.35, "cm")) ################################################### ### code chunk number 8: parsing-expression ################################################### p <- autoplot(txdb, which = aldoa.gr, names.expr = "gene_id:::tx_name") p ################################################### ### code chunk number 9: change-unit ################################################### p + scale_x_sequnit("kb") ################################################### ### code chunk number 10: stat_gene (eval = FALSE) ################################################### ## p1 <- ggplot() + stat_gene(txdb, which = aldoa.gr) ################################################### ### code chunk number 11: session-info ################################################### sessionInfo()