This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Subsetting txdb object by "tx_name"

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

exonInfo only

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.

exonInfo with txdb

So I was hoping to get help doing one of two things:

  1. "correct" my exonInfo GRanges object to include the lines separating introns. I've tried plotting exonInfo as a GeneRegionTrack and it changes the arrows to blocks.
  2. Subset the above txdb object using the isoform ids from exonInfo. I've looked into it and select() doesn't return a GRanges object and I can't seem to subset the results from transcripts()
granges r gviz

0 answers

No answers yet.

Log in to answer this question.