This function is used to extract all exons and their positions in the genome from an input gtf file.

cast_gtf_to_genes(filename, feature = "exon", att_of_interest = "gene_id", ...)

Arguments

filename

path to the gtf file

feature

the feature type name to filter the feature (3rd) column of the gtf/gff file; default is exon

att_of_interest

the attribute to extract from the last column of the gtf/gff file; default in gene_id

...

arguments passed on to other methods

Value

A tibble of the ids, gene names, chromosomes, start and end positions of each exon found in the gtf file.

Examples

fl <- system.file("extdata", "example.gtf.gz", package="Rsamtools", mustWork=TRUE) cast_gtf_to_genes(fl)
#> # A tibble: 91 x 4 #> gene_id seqid start end #> <chr> <chr> <int> <int> #> 1 ENSG00000223972 chr1 1737 2090 #> 2 ENSG00000223972 chr1 1873 1920 #> 3 ENSG00000223972 chr1 2042 2090 #> 4 ENSG00000223972 chr1 2476 2560 #> 5 ENSG00000223972 chr1 2476 2584 #> 6 ENSG00000223972 chr1 2838 2915 #> 7 ENSG00000223972 chr1 3084 3237 #> 8 ENSG00000223972 chr1 3084 4275 #> 9 ENSG00000223972 chr1 3316 3533 #> 10 ENSG00000227232 chr1 4226 4692 #> # ... with 81 more rows