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 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321
|
\name{EnsDb-class}
\Rdversion{1.1}
\docType{class}
\alias{EnsDb-class}
\alias{dbconn}
\alias{dbconn,EnsDb-method}
\alias{ensemblVersion}
\alias{ensemblVersion,EnsDb-method}
\alias{listColumns}
\alias{listColumns,EnsDb-method}
\alias{metadata}
\alias{metadata,EnsDb-method}
\alias{seqinfo}
\alias{seqinfo,EnsDb-method}
\alias{seqlevels}
\alias{seqlevels,EnsDb-method}
\alias{organism}
\alias{organism,EnsDb-method}
\alias{show}
\alias{show,EnsDb-method}
\alias{listGenebiotypes}
\alias{listGenebiotypes,EnsDb-method}
\alias{listTxbiotypes}
\alias{listTxbiotypes,EnsDb-method}
\alias{listTables}
\alias{listTables,EnsDb-method}
\alias{updateEnsDb}
\alias{updateEnsDb,EnsDb-method}
\alias{returnFilterColumns}
\alias{returnFilterColumns,EnsDb-method}
\alias{returnFilterColumns<-}
\alias{returnFilterColumns<-,EnsDb-method}
\title{Basic usage of an Ensembl based annotation database}
\description{
The \code{EnsDb} class provides access to an Ensembl-based annotation
package. This help page describes functions to get some basic
informations from such an object.
}
\section{Objects from the Class}{
A connection to the respective annotation database is created upon
loading of an annotation package created with the
\code{\link{makeEnsembldbPackage}} function. In addition, the
\code{\link{EnsDb}} constructor specifying the SQLite database file can be
called to generate an instance of the object (see
\code{\link{makeEnsemblSQLiteFromTables}} for an example).
}
\usage{
\S4method{dbconn}{EnsDb}(x)
\S4method{ensemblVersion}{EnsDb}(x)
\S4method{listColumns}{EnsDb}(x, table, skip.keys=TRUE, ...)
\S4method{listGenebiotypes}{EnsDb}(x, ...)
\S4method{listTxbiotypes}{EnsDb}(x, ...)
\S4method{listTables}{EnsDb}(x, ...)
\S4method{metadata}{EnsDb}(x, ...)
\S4method{organism}{EnsDb}(object)
\S4method{returnFilterColumns}{EnsDb}(x)
\S4method{returnFilterColumns}{EnsDb}(x)
\S4method{returnFilterColumns}{EnsDb}(x) <- value
\S4method{seqinfo}{EnsDb}(x)
\S4method{seqlevels}{EnsDb}(x)
\S4method{updateEnsDb}{EnsDb}(x, ...)
}
\arguments{
(in alphabetic order)
\item{...}{Additional arguments.
Not used.
}
\item{object}{
For \code{organism}: an \code{EnsDb} instance.
}
\item{skip.keys}{
for \code{listColumns}: whether primary and foreign keys (not
being e.g. \code{"gene_id"} or alike) should be returned or not. By
default these will not be returned.
}
\item{table}{
For \code{listColumns}: optionally specify the table name(s) for
which the columns should be returned.
}
\item{value}{
For \code{returnFilterColumns}: a logical of length one specifying
whether columns that are used for eventual filters should also be
returned.
}
\item{x}{
An \code{EnsDb} instance.
}
}
\section{Slots}{
\describe{
\item{ensdb}{
Object of class \code{"DBIConnection"}: the
connection to the database.
}
\item{tables}{
Named list of database table columns with the names being the
database table names. The tables are ordered by their degree,
i.e. the number of other tables they can be joined with.
}
\item{.properties}{
Internal list storing user-defined properties. Should not be
directly accessed.
}
}
}
\section{Methods and Functions}{
\describe{
\item{dbconn}{
Returns the connection to the internal SQL database.
}
\item{ensemblVersion}{
Returns the Ensembl version on which the package was built.
}
\item{listColumns}{
Lists all columns of all tables in the database, or, if
\code{table} is specified, of the respective table.
}
\item{listGenebiotypes}{
Lists all gene biotypes defined in the database.
}
\item{listTxbiotypes}{
Lists all transcript biotypes defined in the database.
}
\item{listTables}{
Returns a named list of database table columns (names of the
list being the database table names).
}
\item{metadata}{
Returns a \code{data.frame} with the metadata information from the
database, i.e. informations about the Ensembl version or Genome
build the database was build upon.
}
\item{organism}{
Returns the organism name (e.g. \code{"homo_sapiens"}).
}
\item{returnFilterColumns, returnFilterColumns<-}{
Get or set the option which results in columns that are used for
eventually specified filters to be added as result columns. The
default value is \code{TRUE} (i.e. filter columns are returned).
}
\item{seqinfo}{
Returns the sequence/chromosome information from the database.
}
\item{seqlevels}{
Returns the chromosome/sequence names that are available in the
database.
}
\item{show}{
Displays some informations from the database.
}
\item{updateEnsDb}{
Updates the \code{EnsDb} object to the most recent implementation.
}
}
}
\value{
\describe{
\item{For \code{connection}}{
The SQL connection to the RSQLite database.
}
\item{For \code{EnsDb}}{
An \code{EnsDb} instance.
}
\item{For \code{lengthOf}}{
A named integer vector with the length of the genes or transcripts.
}
\item{For \code{listColumns}}{
A character vector with the column names.
}
\item{For \code{listGenebiotypes}}{
A character vector with the biotypes of the genes in the database.
}
\item{For \code{listTxbiotypes}}{
A character vector with the biotypes of the transcripts in the database.
}
\item{For \code{listTables}}{
A list with the names corresponding to the database table names
and the elements being the attribute (column) names of the table.
}
\item{For \code{metadata}}{
A \code{data.frame}.
}
\item{For \code{organism}}{
A character string.
}
\item{For \code{returnFilterColumns}}{
A logical of length 1.
}
\item{For \code{seqinfo}}{
A \code{Seqinfo} class.
}
\item{For \code{updateEnsDb}}{
A \code{EnsDb} object.
}
}
}
\note{
While a column named \code{"tx_name"} is listed by the
\code{listTables} and \code{listColumns} method, no such column is
present in the database. Transcript names returned by the methods are
actually the transcript IDs. This \emph{virtual} column was only
introduced to be compliant with \code{TxDb} objects (which provide
transcript names).
}
\author{
Johannes Rainer
}
\seealso{
\code{\link{EnsDb}},
\code{\link{makeEnsembldbPackage}},
\code{\link{exonsBy}}, \code{\link{genes}},
\code{\link{transcripts}},
\code{\link{makeEnsemblSQLiteFromTables}}
\code{\link{addFilter}} for globally adding filters to an \code{EnsDb}
object.
}
\examples{
library(EnsDb.Hsapiens.v86)
## Display some information:
EnsDb.Hsapiens.v86
## Show the tables along with its columns
listTables(EnsDb.Hsapiens.v86)
## For what species is this database?
organism(EnsDb.Hsapiens.v86)
## What Ensembl version if the database based on?
ensemblVersion(EnsDb.Hsapiens.v86)
## Get some more information from the database
metadata(EnsDb.Hsapiens.v86)
## Get all the sequence names.
seqlevels(EnsDb.Hsapiens.v86)
## List all available gene biotypes from the database:
listGenebiotypes(EnsDb.Hsapiens.v86)
## List all available transcript biotypes:
listTxbiotypes(EnsDb.Hsapiens.v86)
## Update the EnsDb; this is in most instances not necessary at all.
updateEnsDb(EnsDb.Hsapiens.v86)
###### returnFilterColumns
returnFilterColumns(EnsDb.Hsapiens.v86)
## Get protein coding genes on chromosome X, specifying to return
## only columns gene_name as additional column.
genes(EnsDb.Hsapiens.v86, filter=list(SeqNameFilter("X"),
GeneBiotypeFilter("protein_coding")),
columns=c("gene_name"))
## By default we get also the gene_biotype column as the data was filtered
## on this column.
## This can be changed using the returnFilterColumns option
returnFilterColumns(EnsDb.Hsapiens.v86) <- FALSE
genes(EnsDb.Hsapiens.v86, filter=list(SeqNameFilter("X"),
GeneBiotypeFilter("protein_coding")),
columns=c("gene_name"))
}
\keyword{classes}
|