gtf_attributes_as_list: Helper function to handle the last column of a GTF file.

View source: R/genomics_files_utils.R

gtf_attributes_as_listR Documentation

Helper function to handle the last column of a GTF file.

Description

Helper function to handle the last column of a GTF file.

Usage

gtf_attributes_as_list(data)

Arguments

data

A data frame of a GTF file with the 9th column labelled 'attribute'

Details

This function helps convert the "attributes" column of a GTF file from character to a named list.

Value

A tibble

Examples

gtf <- read_delim(file = path, delim = '\t', comment = '#!',
                  col_names = c('seqname', 'source', 'feature', 'start', 
                  'end', 'score', 'strand', 'frame', 'attribute'), 
                  col_types = c('i', 'c', 'c', 'i', 'i', 'c', 'c', 'c', 'c'),
                  n_max = 100) |>
                  gtf_attributes_as_list()

Ni-Ar/niar documentation built on Feb. 3, 2025, 9:25 a.m.