I wish to plot a transcript with the UTRs as thinner boxes. BiomartGeneRegionTrack does this automatically:
transcriptID <- "ENST00000398958" # ---------- USING MART mart <- biomaRt::useMart( biomart = "ENSEMBL_MART_ENSEMBL", dataset = "hsapiens_gene_ensembl", host = "dec2013.archive.ensembl.org") # Create transcript track biomartTrack <- Gviz::BiomartGeneRegionTrack( filters = list( ensembl_transcript_id = transcriptID), biomart = mart) # Plots with UTRs as thinner boxes Gviz::plotTracks(biomartTrack)
But as I cannot connect to the internet for each plot I create, I need to use a TxDb from a local file:
transcriptID <- "ENST00000398958" # ---------- USING TXDB txdbhg19 <- AnnotationDbi::loadDb(file = "Biomart_Ensembl_HS_dec2013.archive.ensembl.org.sqlite") # The sqlite was created like this: # txdbhg19 <- GenomicFeatures::makeTxDbFromBiomart( # biomart = "ENSEMBL_MART_ENSEMBL", # dataset = "hsapiens_gene_ensembl", # host = "dec2013.archive.ensembl.org") # AnnotationDbi::saveDb(txdbhg19, file="Biomart_Ensembl_HS_dec2013.archive.ensembl.org.sqlite") # See what data can be retrieved columns(txdbhg19) # [1] "CDSCHROM" "CDSEND" "CDSID" "CDSNAME" "CDSSTART" "CDSSTRAND" "EXONCHROM" "EXONEND" "EXONID" "EXONNAME" # [11] "EXONRANK" "EXONSTART" "EXONSTRAND" "GENEID" "TXCHROM" "TXEND" "TXID" "TXNAME" "TXSTART" "TXSTRAND" # [21] "TXTYPE" # Which of these columns will help me? # Get all exon information allExons <- GenomicFeatures::exons( txdbhg19, filter = list(tx_name = transcriptID), columns = list()) # I wish to create a GeneRegionTrack that has the same feature values as the BiomartGeneRegionTrack above has: Gviz::feature(biomartTrack) # [1] "utr5" "utr5" "utr5" "utr5" "protein_coding" "protein_coding" "protein_coding" # [8] "protein_coding" "protein_coding" "protein_coding" "protein_coding" "protein_coding" "protein_coding" "utr3" # But I'm not sure how to accomplish this.
Can anyone help me create the same plot using the TxDb?
Thank you for answering! Could you point me to the relevant parts in the Gviz source code? For my purposes I don't want to use the TxDb object directly, but create a track from a GRanges object.
Sorry, just don't have the time to dig into it right now, but maybe start your search through the source code by looking for "thinBoxFeature", "utr", etc ...