Convert a data.frame to a GRanges.

Description

Checks that the data.frame has the required columns, chr, start, end, then creates a GRanges, keeping all of the additional columns.

Usage

1
2
  ## S4 method for signature 'data.frame'
annoDF2GR(anno)

Arguments

anno

An data.frame, describing some genomic features.

Details

Extra columns are added to the elementMetadata of the GRanges object.

Value

A GRanges of the annotation.

Author(s)

Dario Strbenac

Examples

1
2
3
4
5
6
7
  df <- data.frame(chr = c("chr1", "chr3", "chr7", "chr22"),
                   start = seq(1000, 4000, 1000),
                   end = seq(1500, 4500, 1000),
                   t = c(3.11, 0.93, 2.28, -0.18),
                   gc = c("High", "High", "Low", "High"))

  annoDF2GR(df)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.