importData {trackViewer} | R Documentation

## Reading data from a BED or WIG file to RleList

### Description

Read a `track` object from a BED, bedGraph, WIG or BigWig file to RleList

### Usage

    importData(files, format=NA, ranges=GRanges())

### Arguments

`files` | The path to the files to read.
`format` | The format of import file. Could be BAM, BED, bedGraph, WIG or BigWig
`ranges` | An object of `GRanges` to indicate the range to be imported

### Value

a list of `RleList`.

### Author(s)

Jianhong Ou

### Examples

    #import a BED file
    bedfile <- system.file("tests", "test.bed", package="rtracklayer",
                           mustWork=TRUE)
    dat <- importData(files=bedfile, format="BED",
                        ranges=GRanges("chr7", IRanges(127471197, 127474697)))

    ##import a WIG file
    wigfile <- system.file("tests", "step.wig", package = "rtracklayer",
                           mustWork=TRUE)
    dat <- importData(files=wigfile, format="WIG",
                      ranges=GRanges("chr19",
                                     IRanges(59104701, 59110920)))

    ##import a BigWig file
    if(.Platform$OS.type!="windows"){
        ##this is because we are using rtracklayer::import
        bwfile <- system.file("tests", "test.bw", package = "rtracklayer",
                           mustWork=TRUE)
        dat <- importData(files=bwfile, format="BigWig",
                          ranges=GRanges("chr19", IRanges(1500, 2700)))
    }

[Package trackViewer version 1.14.1 Index]