read_gff: Read GFF Files

View source: R/read_gff.R

read_gffR Documentation

Read GFF Files

Description

This function reads GFF files from a specified directory or file path and combines them into a single data frame.

Usage

read_gff(path, fields = NULL)

Arguments

path

A character string specifying the directory containing GFF files or the file path to a single GFF file.

fields

An optional vector of character strings specifying the fields to extract from the GFF files.

Details

This function can read multiple GFF files from a directory or a single GFF file. It processes each file, extracts the specified fields (if provided), adds a 'name' column with the filename, and combines the data frames from all files into one.

Value

A data frame containing the combined data from the GFF files.

Examples

## Not run: 
# Read GFF files from a directory
gff_data <- read_gff("path/to/directory")

# Read a single GFF file
gff_data <- read_gff("path/to/file.gff")

# Read specific fields from GFF files
gff_data <- read_gff(
"path/to/directory",
fields = c("seqid", "start", "end", "attributes")
)

## End(Not run)

geneviewer documentation built on April 12, 2025, 9:12 a.m.