parseGffAttributes {genomeIntervals} | R Documentation |
GFF files contain a string, with key/value pairs separated by “;”, and the key and value separated by “=”. This function parses such strings into a list of vectors with named elements.
parseGffAttributes(gi)
gi |
A Genome_intervals object. |
A list, with one element per row of gi
. Each element is a
character vector with named components. Names correspond to keys, and
components correspond to values.
Key/value pairs which are missing the “=” symbol, or which have
nothing between it and the “;” delimiter or end of line, will
generate a NA
value, with a warning. Any key/value
“pairs” with more than one “=” cause an error.
In many cases, getGffAttribute
, in this package, is
easier and faster. See the function readGff3
for loading a GFF file.
# Get file path libPath <- installed.packages()["genomeIntervals", "LibPath"] filePath <- file.path( libPath, "genomeIntervals", "example_files" ) # Load gff and parse attributes gff <- readGff3( file.path( filePath, "sgd_simple.gff"), isRightOpen = FALSE ) gfatt <- parseGffAttributes(gff) head( gfatt )