Description Usage Arguments Details Value Author(s) References See Also Examples
The SplicingGraphs class is a container for storing splicing graphs together with the gene model that they are based on.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | ## Constructor:
SplicingGraphs(x, grouping=NULL, min.ntx=2, max.ntx=NA, check.introns=TRUE)
## SplicingGraphs basic API:
## S4 method for signature 'SplicingGraphs'
length(x)
## S4 method for signature 'SplicingGraphs'
names(x)
## S4 method for signature 'SplicingGraphs'
seqnames(x)
## S4 method for signature 'SplicingGraphs'
strand(x)
## S4 method for signature 'SplicingGraphs,ANY,ANY'
x[i, j, ... , drop=TRUE]
## S4 method for signature 'SplicingGraphs,ANY,ANY'
x[[i, j, ...]]
## S4 method for signature 'SplicingGraphs'
elementNROWS(x)
## S4 method for signature 'SplicingGraphs'
unlist(x, recursive=TRUE, use.names=TRUE)
## S4 method for signature 'SplicingGraphs'
seqinfo(x)
|
x |
For For the methods in the SplicingGraphs basic API: A SplicingGraphs object. |
grouping |
An optional object that represents the grouping by gene of the top-level
elements (i.e. the transcripts) in |
min.ntx, max.ntx |
Single integers (or |
check.introns |
If |
i, j, ..., drop |
A SplicingGraphs object is a list-like object and therefore it can be
subsetted like a list. When subsetting with |
recursive, use.names |
A SplicingGraphs object is a list-like object and therefore it can be
unlisted with |
The Splicing graph theory only applies to genes that have all the exons
of all their transcripts on the same chromosome and strand. In particular,
in its current form, the splicing graph theory cannot describe
trans-splicing events. The SplicingGraphs
constructor will reject
genes that do not satisfy this.
The first argument of the SplicingGraphs
constructor, x
,
can be either a GRangesList object or a
TxDb object.
When x
is a GRangesList object, it must
contain the exons of one or more genes grouped by transcripts. More
precisely, each top-level element in x
must contain the genomic
ranges of the exons for a particular transcript. Typically x
will be obtained from a TxDb object
txdb
with exonsBy(txdb, by="tx",
use.names=TRUE)
.
grouping
is an optional argument that is only supported
when x
is a GRangesList object.
It represents the grouping by gene of the top-level elements (i.e. the
transcripts) in GRangesList object x
.
It can be either:
Missing (i.e. NULL
). In that case, all the transcripts in
x
are considered to belong to the same gene and the
SplicingGraphs object returned by SplicingGraphs
will be
unnamed.
A list of integer or character vectors, or an
IntegerList, or a CharacterList
object, of length the number of genes to process, and where
grouping[[i]]
is a vector of valid subscripts in
x
pointing to all the transcripts of the i-th gene.
A factor, character vector, or integer vector, of the same length
as x
and 1 level per gene.
A named GRangesList object containing
transcripts grouped by genes i.e. each top-level element in
grouping
contains the genomic ranges of the transcripts
for a particular gene. In that case, the grouping is inferred from
the tx_id (or alternatively tx_name) metadata column of
unlist(grouping)
and all the values in that column must
be in names(x)
.
If x
was obtained with
exonsBy(txdb, by="tx", use.names=TRUE)
,
then the GRangesList object used for grouping
would typically be obtained with
transcriptsBy(txdb, by="gene")
.
A data.frame or DataFrame with 2 character vector
columns: a gene_id column (factor, character vector, or integer
vector), and a tx_id (or alternatively tx_name) column. In that
case, x
must be named and all the values in the tx_id
(or tx_name) column must be in names(x)
.
For SplicingGraphs
: a SplicingGraphs object with 1 element per gene.
For length
: the number of genes in x
, which is also the number
of splicing graphs in x
.
For names
: the gene ids. Note that the names on a SplicingGraphs
object are always unique and cannot be modified.
For seqnames
: a named factor of the length of x
containing
the name of the chromosome for each gene.
For strand
: a named factor of the length of x
containing
the strand for each gene.
For elementNROWS
: the number of transcripts per gene.
For seqinfo
: the seqinfo of the GRangesList
or TxDb object that was used to construct
the SplicingGraphs object.
H. Pagès
Heber, S., Alekseyev, M., Sze, S., Tang, H., and Pevzner, P. A. Splicing graphs and EST assembly problem Bioinformatics Date: Jul 2002 Vol: 18 Pages: S181-S188
Sammeth, M. (2009) Complete Alternative Splicing Events Are Bubbles in Splicing Graphs J. Comput. Biol. Date: Aug 2009 Vol: 16 Pages: 1117-1140
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.
Other topics related to this man page and documented in other packages:
The exonsBy
and
transcriptsBy
functions, and
the TxDb class, defined in the
GenomicFeatures package.
The GRangesList class defined in the GenomicRanges package.
The IntegerList and CharacterList classes defined in the IRanges package.
The DataFrame class defined in the S4Vectors package.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | ## ---------------------------------------------------------------------
## 1. Load a toy gene model as a TxDb object
## ---------------------------------------------------------------------
library(GenomicFeatures)
suppressWarnings(
toy_genes_txdb <- makeTxDbFromGFF(toy_genes_gff())
)
## ---------------------------------------------------------------------
## 2. Compute all the splicing graphs (1 graph per gene) and return them
## in a SplicingGraphs object
## ---------------------------------------------------------------------
## Extract the exons grouped by transcript:
ex_by_tx <- exonsBy(toy_genes_txdb, by="tx", use.names=TRUE)
## Extract the transcripts grouped by gene:
tx_by_gn <- transcriptsBy(toy_genes_txdb, by="gene")
sg <- SplicingGraphs(ex_by_tx, tx_by_gn)
sg
## Alternatively 'sg' can be constructed directly from the TxDb
## object:
sg2 <- SplicingGraphs(toy_genes_txdb) # same as 'sg'
sg2
## Note that because SplicingGraphs objects have a slot that is an
## environment (for caching the bubbles), they cannot be compared with
## 'identical()' (will always return FALSE). 'all.equal()' should be
## used instead:
stopifnot(isTRUE(all.equal(sg2, sg)))
## 'sg' has 1 element per gene and 'names(sg)' gives the gene ids:
length(sg)
names(sg)
## ---------------------------------------------------------------------
## 3. Basic manipulation of a SplicingGraphs object
## ---------------------------------------------------------------------
## Basic accessors:
seqnames(sg)
strand(sg)
seqinfo(sg)
## Number of transcripts per gene:
elementNROWS(sg)
## The transcripts of a given gene can be extracted with [[. The result
## is an *unnamed* GRangesList object containing the exons grouped by
## transcript:
sg[["geneD"]]
## See '?plotTranscripts' for how to plot those transcripts.
## The transcripts of all the genes can be extracted with unlist(). The
## result is a *named* GRangesList object containing the exons grouped
## by transcript. The names on the object are the gene ids:
ex_by_tx <- unlist(sg)
ex_by_tx
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.