Entering edit mode
23 months ago
Trivas
★
1.7k
I've been working on improving the default data visualization of a package by extracting a GRanges object and plotting it using the GViz package. But I can't seem to plot specific isoforms with lines/arrows connecting exons. exonInfo
contains the data extracted from a larger R object.
> exonInfo
GRanges object with 640 ranges and 2 metadata columns:
seqnames ranges strand | isoform_id gene_id
<Rle> <IRanges> <Rle> | <character> <character>
[1] 1 150195168-150195239 + | ENSMUST00000191228 ENSMUSG00000006007.15
[2] 1 150195168-150195251 + | ENSMUST00000165062 ENSMUSG00000006007.15
[3] 1 150195177-150195251 + | ENSMUST00000186572 ENSMUSG00000006007.15
[4] 1 150195180-150195251 + | ENSMUST00000185698 ENSMUSG00000006007.15
[5] 1 150204067-150204151 + | ENSMUST00000165062 ENSMUSG00000006007.15
... ... ... ... . ... ...
[636] 18 76435150-76435287 + | ENSMUST00000168423 ENSMUSG00000024563.17
[637] 18 76435454-76435598 + | ENSMUST00000025453 ENSMUSG00000024563.17
[638] 18 76435454-76435598 + | ENSMUST00000168423 ENSMUSG00000024563.17
[639] 18 76437678-76438365 + | ENSMUST00000025453 ENSMUSG00000024563.17
[640] 18 76437678-76444034 + | ENSMUST00000168423 ENSMUSG00000024563.17
-------
seqinfo: 39 sequences from an unspecified genome; no seqlengths
When I plot it as an AnnotationTrack with GViz, I get something that looks like this
I was a little confused why the introns aren't represented by lines/arrows like when I plot my exonInfo
GRanges object alongside my txdb
as a GeneRegionTrack.
So I was hoping to get help doing one of two things:
- "correct" my
exonInfo
GRanges object to include the lines separating introns. I've tried plottingexonInfo
as a GeneRegionTrack and it changes the arrows to blocks. - Subset the above
txdb
object using the isoform ids fromexonInfo
. I've looked into it andselect()
doesn't return a GRanges object and I can't seem to subset the results fromtranscripts()