Make GRanges from TxDb object

makeGRangesFromTxDb(
  object,
  level = c("transcripts", "genes", "exons", "cds"),
  ignoreVersion = TRUE,
  synonyms = FALSE
)

Arguments

object

Object.

level

character(1). Return as genes or transcripts.

ignoreVersion

logical(1). Ignore identifier (e.g. transcript, gene) versions. When applicable, the identifier containing version numbers will be stored in txIdVersion and geneIdVersion, and the variants without versions will be stored in txId, txIdNoVersion, geneId, and geneIdNoVersion.

synonyms

logical(1). Include gene synonyms. Queries the Ensembl web server, and is CPU intensive.

Value

GRanges.

Note

Updated 2021-03-10.

Examples

file <- pasteURL( "ftp.ensembl.org", "pub", "release-102", "gtf", "homo_sapiens", "Homo_sapiens.GRCh38.102.gtf.gz", protocol = "ftp" ) txdb <- AcidGenomes::makeTxDbFromGFF(file)
#> → Making `TxDb` from ftp://ftp.ensembl.org/pub/release-102/gtf/homo_sapiens/Homo_sapiens.GRCh38.102.gtf.gz with GenomicFeatures::`makeTxDbFromGFF()`.
#> → Getting GFF metadata for Homo_sapiens.GRCh38.102.gtf.gz.
#> Import genomic features from the file as a GRanges object ...
#> OK
#> Prepare the 'metadata' data frame ...
#> OK
#> Make the TxDb object ...
#> OK
gr <- makeGRangesFromTxDb(object = txdb, ignoreVersion = FALSE)
#> → Defining names by `txId` column in `mcols`.
print(gr)
#> EnsemblTranscripts object with 232024 ranges and 11 metadata columns: #> seqnames ranges strand | broadClass geneId #> <Rle> <IRanges> <Rle> | <Rle> <Rle> #> ENST00000616830 KI270744.1 51009-51114 - | other ENSG00000278625 #> ENST00000619317 GL000220.1 105287-105376 + | other ENSG00000276197 #> ENST00000611446 GL000220.1 112025-112177 + | other ENSG00000274917 #> ENST00000614535 GL000220.1 149259-149348 + | other ENSG00000273937 #> ENST00000619779 GL000220.1 155997-156149 + | other ENSG00000273730 #> ... ... ... ... . ... ... #> ENST00000387409 MT 5826-5891 - | mito ENSG00000210144 #> ENST00000387416 MT 7446-7514 - | mito ENSG00000210151 #> ENST00000361681 MT 14149-14673 - | mito ENSG00000198695 #> ENST00000387459 MT 14674-14742 - | mito ENSG00000210194 #> ENST00000387461 MT 15956-16023 - | mito ENSG00000210196 #> geneName txBiotype txChrom txEnd txId #> <Rle> <Rle> <Rle> <Rle> <Rle> #> ENST00000616830 ENSG00000278625 transcript KI270744.1 51114 ENST00000616830 #> ENST00000619317 ENSG00000276197 transcript GL000220.1 105376 ENST00000619317 #> ENST00000611446 ENSG00000274917 transcript GL000220.1 112177 ENST00000611446 #> ENST00000614535 ENSG00000273937 transcript GL000220.1 149348 ENST00000614535 #> ENST00000619779 ENSG00000273730 transcript GL000220.1 156149 ENST00000619779 #> ... ... ... ... ... ... #> ENST00000387409 ENSG00000210144 transcript MT 5891 ENST00000387409 #> ENST00000387416 ENSG00000210151 transcript MT 7514 ENST00000387416 #> ENST00000361681 ENSG00000198695 transcript MT 14673 ENST00000361681 #> ENST00000387459 ENSG00000210194 transcript MT 14742 ENST00000387459 #> ENST00000387461 ENSG00000210196 transcript MT 16023 ENST00000387461 #> txName txNumber txStart txStrand #> <Rle> <Rle> <Rle> <Rle> #> ENST00000616830 ENST00000616830 1 51009 - #> ENST00000619317 ENST00000619317 2 105287 + #> ENST00000611446 ENST00000611446 3 112025 + #> ENST00000614535 ENST00000614535 4 149259 + #> ENST00000619779 ENST00000619779 5 155997 + #> ... ... ... ... ... #> ENST00000387409 ENST00000387409 232020 5826 - #> ENST00000387416 ENST00000387416 232021 7446 - #> ENST00000361681 ENST00000361681 232022 14149 - #> ENST00000387459 ENST00000387459 232023 14674 - #> ENST00000387461 ENST00000387461 232024 15956 - #> ------- #> seqinfo: 944 sequences (1 circular) from GRCh38.p13 genome