getGffAttribute: Pull one or more key/value pairs from gffAttributes strings

Description Usage Arguments Value See Also Examples

View source: R/parseGffAttributes.R

Description

GFF files contain a string, with key/value pairs separated by “;”, and the key and value separated by “=”. This function quickly extracts one or more key/value pairs.

Usage

1
getGffAttribute(gi, attribute)

Arguments

gi

A Genome_intervals object.

attribute

A vector of key names.

Value

A matrix with the same number of rows as gi, and one column per element of attribute.

See Also

See parseGffAttributes for more complete parsing. See the function readGff3 for loading a GFF file.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Get file path
libPath <- installed.packages()["genomeIntervals", "LibPath"]
filePath <- file.path(
                   libPath,
                   "genomeIntervals",
                   "example_files"
                   )

# Load gff
gff <- readGff3( file.path( filePath, "sgd_simple.gff"), isRightOpen=FALSE)

## head of full gff annotations
head(annotation(gff))

# extract ID and Parent attributes
idpa = getGffAttribute( gff, c( "ID", "Parent" ) )

head(idpa)

genomeIntervals documentation built on Nov. 8, 2020, 4:56 p.m.