Grab GTF or GFF3 attributes into a data.frame
Usage
getGtfAttrs(
gtfDF,
useRows = NULL,
attrNames,
featureType = NULL,
ignore.case = FALSE,
matchMethod = c("once", "multi"),
verbose = FALSE,
...
)Arguments
- gtfDF
data.framewith GTF or GFF3 formatted data- useRows
logical, default NULL, rows ingtfDFto use for analysis, or NULL to use all rows supplied ingtfDF.- attrNames
charactervector of attribute names, matching one of two types of fields in thegtfDFdata:Name/value pairs in column 9, typically used for miscellaneous annotations. The formats are intended to represent accepted formats according to the GTF and GFF3 specifications, for example:
GTF:
attrName "value"GTF:
attrName "value";GTF:
attrName valueGTF:
attrName value;GFF3:
attrName=valueGFF3:
attrName=value;GFF3:
attrName="value"GFF3:
attrName="value";
Recognized column from within the GTF or GFF3 format:
chr - column 1
start - column 4
end - column 5
strand - column 7
range - columns 1,4,5,7 concatenated into one field, for example: "chr:start-end:strand" or "chr1:10000-11000:+"
- featureType
character, default NULL, with feature type used as a prefix for coordinate/range attributes, and otherwise only used in messaging whenverbose=TRUE.- ignore.case
logicaldefault FALSE, passed togrep()andgsub()to enable case-insensitive matching of attribute names.- verbose
logicalindicating whether to print verbose output.- ...
additional arguments are ignored.
Value
data.frame with colnames derived from the GTF or GFF3 data.
When there is no data recognized, it returns NULL, for example
when useRows is entirely FALSE or no attrNames are recognized
in the input gtfDF.
Details
The input retrieves data for known attribute names, although when
an attribute name is not present, it is silently ignored.
However, to see available attribute names, try describeGtfAttrNames().
See also
Other GTF functions:
describeGtfAttrNames(),
makeTx2geneFromGtf(),
makeTx2geneFromTxdb(),
readGtf()