Learn R Programming

Repitools (version 1.18.0)

annoGR2DF: Convert an annotated GRanges to a data.frame.

Description

Converting a GRanges that might be annotated with some kind of results to a data.frame is useful, because it allows easier writing to file and viewing in other programs, like a spreadsheet program.

Usage

"annoGR2DF"(anno)

Arguments

anno
A GRanges, describing some genomic features.

Value

A data.frame of the annotation.

Details

The column name seqnames is changed to chr, and if all the strands are *, then the strand column is dropped.

Examples

Run this code
  require(GenomicRanges)
  chrs <- c("chr1", "chr3", "chr7", "chr22")
  starts <- seq(1000, 4000, 1000)
  ends <- seq(1500, 4500, 1000)
  t <- c(3.11, 0.93, 2.28, -0.18)
  gc <- c("High", "High", "Low", "High")
  gr <- GRanges(chrs, IRanges(starts, ends), strand = '*', t, gc)

  annoGR2DF(gr)

Run the code above in your browser using DataLab