rsgedgesByGene-methods {SplicingGraphs} | R Documentation

## Extract the reduced edges and their ranges from a SplicingGraphs object

### Description

`rsgedgesByGene` and `rsgedgesByTranscript` are analog to `sgedgesByGene` and `sgedgesByTranscript`, but operate on the reduced splicing graphs, that is, the graphs in SplicingGraphs object `x` are reduced before the edges and their ranges are extracted. The reduced graphs are obtained by removing the uninformative nodes from it. See Details section below.

`rsgedges` extracts the edges of the reduced splicing graph of a given gene from a SplicingGraphs object.

`rsgraph` extracts the reduced splicing graph for a given gene from a SplicingGraphs object, and returns it as a plottable graph-like object.

### Usage

    rsgedgesByGene(x, with.hits.mcols=FALSE, keep.dup.edges=FALSE)

    rsgedgesByTranscript(x, with.hits.mcols=FALSE)

    rsgedges(x)

    rsgraph(x, tx_id.as.edge.label=FALSE, as.igraph=FALSE)

    ## Related utility:
    uninformativeSSids(x)

### Arguments

`x` | A SplicingGraphs object. Must be of length 1 for `rsgedges`, `rsgraph`, and `uninformativeSSids`.
`with.hits.mcols` | Whether or not to include the hits metadata columns in the returned object. See `?countReads` for more information.
`keep.dup.edges` | Not supported yet.
`tx_id.as.edge.label` | Whether or not to use the transcript ids as edge labels.
`as.igraph` | TODO

### Details

TODO: Explain graph reduction.

### Value

For `rsgedgesByGene`: A GRangesList object named with the gene ids and where the reduced splicing graph edges are grouped by gene.

TODO: Explain values returned by the other function.

### Author(s)

H. Pagès

### See Also

This man page is part of the SplicingGraphs package. Please see `?`SplicingGraphs-package`` for an overview of the package and for an index of its man pages.

### Examples

    ## ---------------------------------------------------------------------
    ## 1. Make SplicingGraphs object 'sg' from toy gene model (see
    ##    '?SplicingGraphs')
    ## ---------------------------------------------------------------------
    example(SplicingGraphs)
    sg

    ## 'sg' has 1 element per gene and 'names(sg)' gives the gene ids.
    names(sg)

    ## ---------------------------------------------------------------------
    ## 2. rsgedgesByGene()
    ## ---------------------------------------------------------------------
    edges_by_gene <- rsgedgesByGene(sg)
    edges_by_gene
    ## 'edges_by_gene' has the length and names of 'sg', that is, the names
    ## on it are the gene ids and are guaranteed to be unique.

    ## Extract the reduced edges and their ranges for a given gene:
    edges_by_gene[["geneA"]]
    ## Note that edge with global reduced edge id "geneA:1,2,4,5" is a mixed
    ## edge obtained by combining together edges "geneA:1,2" (exon),
    ## "geneA:2,4" (intron), and "geneA:4,5" (exon), during the graph
    ## reduction.

    stopifnot(identical(edges_by_gene["geneB"], rsgedgesByGene(sg["geneB"])))

    ## ---------------------------------------------------------------------
    ## 3. sgedgesByTranscript()
    ## ---------------------------------------------------------------------
    #edges_by_tx <- rsgedgesByTranscript(sg)  # not ready yet!
    #edges_by_tx

    ## ---------------------------------------------------------------------
    ## 4. rsgedges(), rsgraph(), uninformativeSSids()
    ## ---------------------------------------------------------------------
    plot(sgraph(sg["geneB"]))
    uninformativeSSids(sg["geneB"])

    plot(rsgraph(sg["geneB"]))
    rsgedges(sg["geneB"])

    ## ---------------------------------------------------------------------
    ## 5. Sanity checks
    ## ---------------------------------------------------------------------
    ## TODO: Do the same kind of sanity checks that are done for sgedges()
    ## vs sgedgesByGene() vs sgedgesByTranscript() (in man page for sgedges).

[Package SplicingGraphs version 1.22.2 Index]