Builds a transcript-to-gene table from a GENCODE transcriptome FASTA
file (parsing the |-separated headers) or from a GFF3/GTF annotation
(through prepare_isoformic_annotation()). Parsing is done by DuckDB,
so a full GENCODE FASTA (about 250,000 headers, gzip-compressed) takes a
couple of seconds.
Usage
make_tx_to_gene(
file_path,
file_type = c("auto", "fasta", "gff", "gtf"),
output_path = NULL
)Arguments
- file_path
Path to a FASTA (
.fa,.fasta,.fna, optionally.gz), GFF3 or GTF file, or to an annotation directory.- file_type
"auto"(default) detects the format from the file extension; otherwise one of"fasta","gff","gtf".- output_path
Passed to
prepare_isoformic_annotation()for GFF3/GTF inputs.
Value
A tibble with columns transcript_id, gene_id,
havana_gene_id, havana_transcript_id, transcript_name,
gene_name, tx_length and transcript_type. The Havana columns are
NA for GFF3/GTF inputs and annotation directories.
Details
With an IsoformicExperiment object, use tx_to_gene() or tx_annot(),
which read the same information from the annotation directory.
Examples
gff <- system.file("extdata", "example.gff3.gz", package = "isoformic")
tx2gene <- make_tx_to_gene(gff, output_path = tempdir())
#> ℹ Parsing example.gff3.gz (GFF) into /tmp/RtmpM3Y6Dd/example_gff3.
head(tx2gene)
#> # A tibble: 6 × 8
#> transcript_id gene_id havana_gene_id havana_transcript_id transcript_name
#> <chr> <chr> <chr> <chr> <chr>
#> 1 ENST00000909997.2 ENSG000… NA NA FLT1-211
#> 2 ENST00000909998.2 ENSG000… NA NA FLT1-212
#> 3 ENST00000909999.2 ENSG000… NA NA FLT1-213
#> 4 ENST00000910000.2 ENSG000… NA NA FLT1-214
#> 5 ENST00001131755.1 ENSG000… NA NA FLT1-217
#> 6 ENST00000282397.9 ENSG000… NA NA FLT1-201
#> # ℹ 3 more variables: gene_name <chr>, tx_length <int>, transcript_type <chr>
