ChIPpeakAnno (version 3.4.0)

toGRanges: Convert dataset to GRanges

Description

Convert UCSC BED format and its variants, such as GFF, or any user defined dataset such as RangedDate or MACS output file to GRanges

Usage

toGRanges(data, format=c("BED", "GFF", "MACS", "MACS2", "narrowPeak", "broadPeak", "others"), header=FALSE, comment.char="#", colNames=NULL, ...)

Arguments

data
BED, GFF, RangedData or any user defined dataset or their file path.
format
data format. If the data format is set to BED, GFF, narrowPeak or broadPeak, please refer to http://genome.ucsc.edu/FAQ/FAQformat#format1 for column order. "MACS" is for converting the excel output file from MACS1. "MACS2" is for converting the output file from MACS2.
header
A logical value indicating whether the file contains the names of the variables as its first line. If missing, the value is determined from the file format: header is set to TRUE if and only if the first row contains one fewer field than the number of columns.
comment.char
character: a character vector of length one containing a single character or an empty string. Use "" to turn off the interpretation of comments altogether.
colNames
If the data format is set to "others", colname must be defined. And the colname must contain space, start and end. The column name for the chromosome # should be named as space.
...
parameters passed to read.table

Value

An object of GRanges

Examples

Run this code
  macs <- system.file("extdata", "MACS_peaks.xls", package="ChIPpeakAnno")
  macsOutput <- toGRanges(macs, format="MACS")

Run the code above in your browser using DataCamp Workspace