getFeatures {gmoviz} | R Documentation

## Generate a GRanges containing 'features' from .gff files

### Description

Uses a .gff file to create a GRanges of 'features' (e.g. genes or other regions of interest within the genome) which can then be plotted with the `featureDiagram` or `drawFeatureTrack` functions.

### Usage

    getFeatures(gff_file, colours = nice_colours, colour_by_type = TRUE)

### Arguments

`gff_file` | Location of the gff file to read in.
`colours` | A character vector of colours to be used to colour code the features.
`colour_by_type` | If `TRUE`, the features will be coloured according to the 'type' field of the gff file. If `FALSE`, colours will be assigned based on the name of the feature (each uniquely named feature gets its own colour).

### Value

A GRanges containing the 'features'. See `drawFeatureTrack` for a detailed description of the format.

### See Also

`getLabels` for a function which reads the entries of a .gff file into labels rather than 'features'. Also `featureDiagram` or `drawFeatureTrack` for functions which can plot this data.

### Examples

    ## the example .gff
    path <- system.file('extdata', 'example.gff3', package='gmoviz')

    ## coloured by type
    getFeatures(path)

    ## not coloured by type (each uniquely named feature gets its own colour)
    getFeatures(path, colour_by_type=FALSE)

[Package gmoviz version 1.6.0 Index]