WIG Import Functions {TitanCNA} | R Documentation

## WIG Import Functions. wigToGRanges (new) and wigToRangedData (deprecated)

### Description

Fast fixedStep WIG file reading and parsing

### Usage

    wigToGRanges(wigfile, verbose = TRUE)
    wigToRangedData(wigfile, verbose = TRUE)

### Arguments

`wigfile` | Filepath to fixedStep WIG format file
`verbose` | Set to FALSE to suppress messages

### Details

Reads the entire file into memory, then processes the file in rapid fashion, thus performance will be limited by memory capacity.

The WIG file is expected to conform to the minimal fixedStep WIG format (see References), where each chromsome is started by a “fixedStep” declaration line. The function assumes only a single track in the WIG file, and will ignore any lines before the first line starting with “fixedStep”.

### Value

`GRanges` object with chromosome and position information, sorted in decreasing chromosal size and increasing position.

### Author(s)

Gavin Ha, Daniel Lai

### References

WIG

  http://genome.ucsc.edu/goldenPath/help/wiggle.html

### See Also

`wigToGRanges` is a wrapper around these functions for easy WIG file loading and structure formatting. It is modified from the HMMcopy package.

### Examples

    	map <- system.file("extdata", "map_chr2.wig", package = "TitanCNA")
    	mScore <- as.data.frame(wigToGRanges(map))

[Package TitanCNA version 1.25.0 Index]