biovizBase (version 1.20.0)

crunch: Fetching GRanges from various data source

Description

Fetching Granges from various data source, currently supported objects are TxDb, EnsDb, GAlignments and BamFile.

Usage

"crunch"(obj, which, columns = c("tx_id", "tx_name","gene_id"), type = c("all", "reduce"), truncate.gaps = FALSE, truncate.fun = NULL, ratio = 0.0025) "crunch"(obj, which, columns = c("tx_id", "gene_name","gene_id"), type = c("all", "reduce"), truncate.gaps = FALSE, truncate.fun = NULL, ratio = 0.0025) "crunch"(obj, which, truncate.gaps = FALSE, truncate.fun = NULL, ratio = 0.0025) "crunch"(obj, which, ..., type = c("gapped.pair", "raw", "all"), truncate.gaps = FALSE, truncate.fun = NULL, ratio = 0.0025)

Arguments

obj
supported objects are TxDb, GAlignments and BamFile.
which
GRanges object. For TxDb object, could aslo be a list. For EnsDb, it can also be a single filter object extending BasicFilter-class or a list of such objects.
columns
columns to include in the output.
type
default 'all' is to show the full model, 'reduce' is to show a single model.
truncate.gaps
logical value, default FALSE. Whether to truncate gaps or not.
truncate.fun
shrinkage function.
ratio
numeric value, shrinking ratio.
...
arguments passed to function readGAlignments.

Value

GRanges object.

Examples

Run this code
library(biovizBase)
library(TxDb.Hsapiens.UCSC.hg19.knownGene)
data(genesymbol, package = "biovizBase")
txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene
obj <- txdb
temp <- crunch(txdb, which = genesymbol["BRCA1"], type = "all")
temp <- crunch(txdb, which = genesymbol["BRCA1"], type = "reduce")

## Fetching data from a EnsDb object.
library(EnsDb.Hsapiens.v75)
edb <- EnsDb.Hsapiens.v75
gr <- genesymbol["BRCA1"]
seqlevels(gr) <- sub(seqlevels(gr), pattern="chr", replacement="")
temp <- crunch(edb, which=gr)

## Alternatively, use the GenenameFilter from the ensembldb package:
temp <- crunch(edb, which=GenenameFilter("BRCA1"))

Run the code above in your browser using DataCamp Workspace