genes_to_granges {multicrispr} | R Documentation

## Convert geneids into GRanges

### Description

Convert geneids into GRanges

### Usage

    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

    # 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))

[Package multicrispr version 1.4.3 Index]