Make a Tx2Gene object

makeTx2GeneFromEnsembl(
  organism,
  genomeBuild = NULL,
  release = NULL,
  ignoreVersion = TRUE
)

makeTx2GeneFromEnsDb(object, ignoreVersion = TRUE)

makeTx2GeneFromGFF(file, ignoreVersion = TRUE)

Arguments

organism

character(1). Full Latin organism name (e.g. "Homo sapiens").

genomeBuild

character(1). Ensembl genome build assembly name (e.g. "GRCh38"). If set NULL, defaults to the most recent build available. Note: don't pass in UCSC build IDs (e.g. "hg38").

release

integer(1). Ensembl release version (e.g. 90). We recommend setting this value if possible, for improved reproducibility. When left unset, the latest release available via AnnotationHub/ensembldb is used. Note that the latest version available can vary, depending on the versions of AnnotationHub and ensembldb in use.

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.

object

Object.

file

character(1). File path.

Value

Tx2Gene.

Note

Updated 2021-03-10.

GFF/GTF file

Remote URLs and compressed files are supported.

Examples

## makeTx2GeneFromEnsembl ==== x <- makeTx2GeneFromEnsembl(organism = "Homo sapiens")
#> → Making `GRanges` from Ensembl.
#> → Getting `EnsDb` from AnnotationHub 2.22.0 (2020-10-27).
#> AH89426: Ensembl 103 EnsDb for Homo sapiens.
#> → Making `GRanges` from `EnsDb`.
#> Organism: Homo sapiens
#> Genome build: GRCh38
#> Release: 103
#> Level: transcripts
#> → Defining names by `txId` column in `mcols`.
print(x)
#> Tx2Gene with 257222 rows and 2 columns #> txId geneId #> <character> <character> #> ENST00000000233 ENST00000000233 ENSG00000004059 #> ENST00000000412 ENST00000000412 ENSG00000003056 #> ENST00000000442 ENST00000000442 ENSG00000173153 #> ENST00000001008 ENST00000001008 ENSG00000004478 #> ENST00000001146 ENST00000001146 ENSG00000003137 #> ... ... ... #> LRG_998t1 LRG_998t1 LRG_998 #> LRG_998t2 LRG_998t2 LRG_998 #> LRG_999t1 LRG_999t1 LRG_999 #> LRG_999t2 LRG_999t2 LRG_999 #> LRG_99t1 LRG_99t1 LRG_99
## makeTx2GeneFromEnsDb ==== if ("EnsDb.Hsapiens.v75" %in% rownames(installed.packages())) { x <- makeTx2GeneFromEnsDb("EnsDb.Hsapiens.v75") print(x) }
#> → Making `GRanges` from `EnsDb`.
#> Organism: Homo sapiens
#> Genome build: GRCh37
#> Release: 75
#> Level: transcripts
#> → Defining names by `txId` column in `mcols`.
#> Tx2Gene with 215647 rows and 2 columns #> txId geneId #> <character> <character> #> ENST00000000233 ENST00000000233 ENSG00000004059 #> ENST00000000412 ENST00000000412 ENSG00000003056 #> ENST00000000442 ENST00000000442 ENSG00000173153 #> ENST00000001008 ENST00000001008 ENSG00000004478 #> ENST00000001146 ENST00000001146 ENSG00000003137 #> ... ... ... #> LRG_94t1 LRG_94t1 LRG_94 #> LRG_96t1 LRG_96t1 LRG_96 #> LRG_97t1 LRG_97t1 LRG_97 #> LRG_98t1 LRG_98t1 LRG_98 #> LRG_99t1 LRG_99t1 LRG_99
## makeTx2GeneFromGFF ==== file <- pasteURL( "ftp.ensembl.org", "pub", "release-102", "gtf", "homo_sapiens", "Homo_sapiens.GRCh38.102.gtf.gz", protocol = "ftp" ) x <- makeTx2GeneFromGFF(file = file, ignoreVersion = FALSE)
#> → Making `GRanges` from GFF file (Homo_sapiens.GRCh38.102.gtf.gz).
#> → Getting GFF metadata for Homo_sapiens.GRCh38.102.gtf.gz.
#> → Importing 104a6592d9a95_Homo_sapiens.GRCh38.102.gtf.gz at /opt/koopa/opt/r/cache/AcidGenomes using rtracklayer::`import()`.
#> → Defining names by `txId` column in `mcols`.
print(x)
#> Tx2Gene with 232024 rows and 2 columns #> txId geneId #> <character> <character> #> ENST00000000233.10 ENST00000000233.10 ENSG00000004059.11 #> ENST00000000412.8 ENST00000000412.8 ENSG00000003056.8 #> ENST00000000442.11 ENST00000000442.11 ENSG00000173153.17 #> ENST00000001008.6 ENST00000001008.6 ENSG00000004478.8 #> ENST00000001146.6 ENST00000001146.6 ENSG00000003137.8 #> ... ... ... #> ENST00000679345.1 ENST00000679345.1 ENSG00000148334.16 #> ENST00000679346.1 ENST00000679346.1 ENSG00000182481.10 #> ENST00000679347.1 ENST00000679347.1 ENSG00000174080.12 #> ENST00000679348.1 ENST00000679348.1 ENSG00000115053.17 #> ENST00000679349.1 ENST00000679349.1 ENSG00000099284.15