readBigwig: Read a bigWig file and return it as a data frame

View source: R/readBigwig.R

readBigwigR Documentation

Read a bigWig file and return it as a data frame

Description

Read a bigWig file and return it as a data frame

Usage

readBigwig(
    file,
    chrom = NULL,
    chromstart = 1,
    chromend = .Machine$integer.max,
    strand = "*",
    params = NULL
)

Arguments

file

A character value specifying the path to the bigwig file.

chrom

Chromosome of data as a string, if data for a specific chromosome is desired.

chromstart

Integer start position on chromosome.

chromend

Integer end position on chromosome.

strand

A character value specifying strand. Default value is strand = "*". Options are:

  • "+": Plus strand.

  • "-": Minus strand.

  • "*": Plus and minus strands.

params

An optional pgParams object containing relevant function parameters.

Details

This function does not work on Windows.

Value

Returns a 6-column dataframe of bigwig information.

See Also

import.bw

Examples

if (.Platform$OS.type != "windows"){
    bwFile <- system.file("extdata/test.bw", package="plotgardenerData")

    ## Read in entire file
    bwData <- readBigwig(file = bwFile)

    ## Read in specified region
    bwRegion <- readBigwig(file = bwFile,
                            chrom = "chr2",
                            chromstart = 1,
                            chromend = 1500)
}


PhanstielLab/BentoBox documentation built on June 30, 2024, 12:50 p.m.