getGtfAttrs: Grab GTF or GFF3 attributes into a data.frame

getGtfAttrsR Documentation

Grab GTF or GFF3 attributes into a data.frame

Description

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.frame with GTF or GFF3 formatted data

useRows

logical, default NULL, rows in gtfDF to use for analysis, or NULL to use all rows supplied in gtfDF.

attrNames

character vector of attribute names, matching one of two types of fields in the gtfDF data:

  1. 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 value⁠

    • GTF: ⁠attrName value;⁠

    • GFF3: attrName=value

    • GFF3: attrName=value;

    • GFF3: attrName="value"

    • GFF3: attrName="value";

  2. 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 when verbose=TRUE.

ignore.case

logical default FALSE, passed to grep() and gsub() to enable case-insensitive matching of attribute names.

verbose

logical indicating whether to print verbose output.

...

additional arguments are ignored.

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().

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.

See Also

Other jam gtf functions: describeGtfAttrNames(), makeTx2geneFromGtf(), readGtf()


jmw86069/splicejam documentation built on April 14, 2025, 3:12 a.m.