## ---------------------------------------------------------------------
## 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).
Run the code above in your browser using DataLab