This function allows you to parse the complex 'attributes' column of a gff file and get only feature names or IDs, for example. Adapted from function in the davidTiling experimental package. Also posted on the Bioconductor support system here.
gff_get_attribute(gffColumn, field, attrSep = ";")
gffColumn | The column of the Gff file to parse, typically 'attributes'. No default. |
---|---|
field | A string representing the field with the value you want
(formatted as |
attrSep | A string representing the field separator ( |
A vector containing the specified field values of the same size as the number of features in the gff file.
Typical use of this function will include first using gff_read
,
also in this package, to load gff file and then parsing the attributes field.
See examples below.
# NOT RUN { gff_read(s288C_annotation_R64_modified.gff) gff_get_attribute(gff$attributes, 'Name') gff_get_attribute(gff$attributes, 'ID') # }