genes_to_granges: Convert geneids into GRanges

Description Usage Arguments Value See Also Examples

View source: R/04_bed_to_granges.R

Description

Convert geneids into GRanges

Usage

1
2
3
genes_to_granges(geneids, txdb, complement = TRUE, plot = TRUE, verbose = TRUE)

genefile_to_granges(file, txdb, complement = TRUE, plot = TRUE)

Arguments

geneids

Gene identifier vector

txdb

TxDb-class or EnsDb-class

complement

TRUE (default) or FALSE: add complementary strand?

plot

TRUE (default) or FALSE

verbose

TRUE (default) or FALSE

file

Gene identifier file (one per row)

Value

GRanges-class

See Also

char_to_granges, bed_to_granges

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# Entrez
#-------
    genefile <- system.file('extdata/SRF.entrez', package='multicrispr')
    geneids  <- as.character(read.table(genefile)[[1]])
    txdb     <- getFromNamespace('TxDb.Mmusculus.UCSC.mm10.knownGene',
                             'TxDb.Mmusculus.UCSC.mm10.knownGene')
    (gr <- genes_to_granges(geneids, txdb))
    (gr <- genefile_to_granges(genefile, txdb))

# Ensembl
#--------
    # txdb <- AnnotationHub::AnnotationHub()[["AH75036"]]
    # genefile <- system.file('extdata/SRF.ensembl', package='multicrispr')
    # geneids <- as.character(read.table(genefile)[[1]])
    # (gr <- genes_to_granges(geneids, txdb))
    # (gr <- genefile_to_granges(genefile, txdb))

multicrispr documentation built on Nov. 8, 2020, 5:10 p.m.