gtf_attributes_as_cols: Helper function to convert the last column list of a GTF file...

View source: R/genomics_files_utils.R

gtf_attributes_as_colsR Documentation

Helper function to convert the last column list of a GTF file to a different separate columns

Description

Helper function to convert the last column list of a GTF file to a different separate columns

Usage

gtf_attributes_as_cols(data)

Arguments

data

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

Details

This function works only if the "attributes" column was first converted to a list with gtf_attributes_as_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() |>
                  gtf_attributes_as_cols()

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