HMMcopy-input: WIG Import Functions

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Fast fixedStep WIG file reading and parsing

Usage

1
2
wigToRangedData(wigfile, verbose = TRUE)
wigToArray(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

RangedData for wigToRangedData with chromosome and position information, sorted in decreasing chromosal size and increasing position.

Numeric array for wigToArray sorted in decreasing chromosal size and increasing position.

Author(s)

Daniel Lai

References

WIG

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

See Also

wigsToRangedData is a wrapper around these functions for easy WIG file loading and structure formatting.

Examples

1
2
3
  wigfile <- system.file("extdata", "tumour.wig", package = "HMMcopy")
  posAndValues <- wigToRangedData(wigfile)
  justValues <- wigToArray(wigfile)

Example output

Loading required package: IRanges
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

The following object is masked from 'package:base':

    expand.grid

Loading required package: geneplotter
Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.

Loading required package: lattice
Loading required package: annotate
Loading required package: AnnotationDbi
Loading required package: XML
Slurping: /usr/local/lib/R/site-library/HMMcopy/extdata/tumour.wig
Parsing: fixedStep chrom=6 start=1 step=10000 span=10000
Sorting by decreasing chromosome size
Slurping: /usr/local/lib/R/site-library/HMMcopy/extdata/tumour.wig
Parsing: fixedStep chrom=6 start=1 step=10000 span=10000
Sorting by decreasing chromosome size

HMMcopy documentation built on Nov. 8, 2020, 8:09 p.m.