createBwSample: Create a BigWig file with the coverage information for a...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/createBwSample.R

Description

Given the output of fullCoverage, this function coerces the coverage to a GRanges object using coerceGR and then exports the coverage to a BigWig file using export.

Usage

1
createBwSample(sample, path = ".", fullCov, keepGR = TRUE, ...)

Arguments

sample

The name or integer index of the sample of interest to coerce to a GRanges object.

path

The path where the BigWig file will be created.

fullCov

A list where each element is the result from loadCoverage used with returnCoverage = TRUE. Can be generated using fullCoverage.

keepGR

If TRUE, the GRanges object created by coerceGR is returned. Otherwise it is discarded.

...

Arguments passed to other methods and/or advanced arguments. Advanced arguments:

verbose

If TRUE basic status updates will be printed along the way.

Passed to coerceGR.

Value

Creates a BigWig file with the coverage information (regions with coverage greater than zero) for a given sample. If keepGR it returns the output from coerceGR.

Author(s)

Leonardo Collado-Torres

See Also

GRanges, export, linkcoerceGR

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Create a small fullCov object with data only for chr21
fullCov <- list("chr21" = genomeDataRaw)

## Create a BigWig for the first sample in a test directory
dir.create("createBwSample-example")
bw <- createBwSample("ERR009101", "createBwSample-example",
    fullCov = fullCov, seqlengths = c("chr21" = 48129895)
)

## Explore the output
bw

## Exports a single sample to a BigWig file

derfinder documentation built on Dec. 20, 2020, 2 a.m.