dt2gr: Convert data.table to GRanges

Description Usage Arguments Value Examples

View source: R/gUtils.R

Description

Takes as input a data.table which must have the following fields: start, end, strand, seqnames. Will throw an error if any one of these is not present. All of the remaining fields are added as metadata to the GRanges.

Usage

1
dt2gr(dt, key = NULL, seqlengths = NULL, seqinfo = Seqinfo())

Arguments

dt

data.table or data.frame to convert to GRanges

seqlengths

named integer vector representing genome (default = hg_seqlengths())

seqinfo

seqinfo of output GRanges object

Value

GRanges object of length = nrow(dt)

Examples

1
converted_gr = dt2gr(data.table(start=c(1,2), seqnames=c("X", "1"), end=c(10,20), strand = c('+', '-')))

mskilab/gUtils documentation built on July 10, 2019, 5:10 p.m.