Learn R Programming

refGenome (version 1.7.7)

getGenePositions: Extract subsets of refGenome by gene-name.

Description

The function searches in the given data for unique gene_id values. For each item, values like gene_id, seqid and strand are extracted. Optionally (when present) also gene_name and gene_biotype are extracted. The function assignes unique id values which are ordered by gene_id values (not genetic positions). Owing to this, id values equal as.numeric(gene_id).

Usage

getGenePositions(object,by,force=FALSE,...)

Arguments

object

ensemblGenome, ucscGenome or ensemblJunctions. Object from which gene positions are extracted.

by

Character. Determines criterion by which genes are discerned. Accepted values: "gene_id" and "gene_name". For Ensembl genomes the default is 'gene_id' and for USCC genomes the default is 'gene_name'.

force

Logical. When FALSE, gene positions will only be calculated when a position table is not present in local environment. The function then returns a copy.

...

Unused.

Value

data.frame

Details

The function stores a copy of the result in the internal environment (genes table). Upon subsequent calls the values only are re-calculated when force=TRUE is given. Otherwise the function returns a copy of the contained table. Present genes tables will be automatically saved and restored by saveGenome and load.X functions.

Examples

Run this code
# NOT RUN {
##-------------------------------------##
## A) Ensembl genome:
##-------------------------------------##
ensfile <- system.file("extdata",
                        "hs.ensembl.62.small.RData", package="refGenome")
ens <- loadGenome(ensfile)
gp <- getGenePositions(ens)

##-------------------------------------##
## B) Ensembl junctions:
##-------------------------------------##
junc <- getSpliceTable(ens)
genes <- getGenePositions(junc)

##-------------------------------------##
# C) Ucsc genome:
##-------------------------------------##
ucfile <- system.file("extdata", "hs.ucsc.small.RData", package="refGenome")
uc <- loadGenome(ucfile)
junc <- getSpliceTable(uc)
gp <- getGenePositions(junc)
# }

Run the code above in your browser using DataLab