gencode_txdb: Create a Gencode TxDb object

View source: R/gencode_txdb.R

gencode_txdbR Documentation

Create a Gencode TxDb object

Description

This function builds a transcript database (TxDb) object which you can then use to build a Gencode GenomicState object. This function will download the data from Gencode, import it into R, process it and build the TxDb object.

Usage

gencode_txdb(
  version = "31",
  genome = c("hg38", "hg19"),
  chrs = paste0("chr", c(seq_len(22), "X", "Y", "M"))
)

gencode_source_url(version = "31", genome = c("hg38", "hg19"))

Arguments

version

A character(1) with the Gencode version number.

genome

A character(1) with the human genome version number. Valid options are 'hg38' or 'hg19'.

chrs

A character() vector with the chromosome (contig) names to keep.

Value

A GenomicFeatures::TxDb object.

A character(1) with the URL for the GTF Gencode file of interest.

Author(s)

Leonardo Collado-Torres

References

Based on code for the brainflowprobes package at: https://github.com/LieberInstitute/brainflowprobes/blob/devel/data-raw/create_sysdata.R

See Also

gencode_annotated_genes() gencode_genomic_state()

Examples


## Start from scratch if you want:
## Not run: 
txdb_v31_hg19_chr21 <- gencode_txdb("31", "hg19", chrs = "chr21")

## End(Not run)

## or read in the txdb object for hg19 chr21 from this package
txdb_v31_hg19_chr21 <- AnnotationDbi::loadDb(
    system.file("extdata", "txdb_v31_hg19_chr21.sqlite",
        package = "GenomicState"
    )
)

## Explore the result
txdb_v31_hg19_chr21

## Locate the GTF file for Gencode version 31 for hg19
gencode_source_url(version = "31", genome = "hg19")

LieberInstitute/GenomicState documentation built on Dec. 13, 2024, 11:19 p.m.