coverage_bwtool: Given a set of regions and bigwig files, compute the coverage...

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

View source: R/coverage_bwtool.R

Description

Given a set of regions and bigwig files, compute the coverage matrix for using bwtool and build a RangedSummarizedExperiment-class object.

Usage

1
2
3
4
coverage_bwtool(bws, regions, strand = "*", pheno = NULL,
  bwtool = "/dcl01/leek/data/bwtool/bwtool-1.0/bwtool", bpparam = NULL,
  verbose = TRUE, sumsdir = tempdir(), commands_only = FALSE,
  overwrite = FALSE, stranded_sumsdir = TRUE)

Arguments

bws

A named vector with the paths to the bigWig files. The names are used as sample ids.

regions

A GRanges-class object with regions for which to calculate the coverage matrix.

strand

Either *, + or -. If set to * (default) then all regions are used. Otherwise the matrix is subset to the regions of the corresponding strand. The users should supply the correct corresponding list of bigWig files in bws.

pheno

NULL by default. Specify the data.frame with the same length as bws to be used in the resulting RSE object.

bwtool

The path to bwtool. Uses as the default the location at JHPCE.

bpparam

A BiocParallelParam-class instance which will be used to calculate the coverage matrix in parallel. By default, SerialParam-class will be used.

verbose

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

sumsdir

The path to an existing directory where the bwtool sum tsv files will be saved. We recommend setting this to a value beyond the default one.

commands_only

If TRUE the bwtool commands will be saved in a file called coverage_bwtool_strandSTRAND.txt and exit without running bwtool. This is useful if you have a very large regions set and want to run the commands in an array job. Then run coverage_bwtool(commands_only = FALSE) to create the RSE object(s).

overwrite

Logical, whether to overwrite output files.

stranded_sumsdir

Logical, whether to automatically add the strand to sumsdir, to avoid overwriting files from different strands.

Details

Based on coverage_matrix_bwtool, but made more general for data outside recount2.

Value

A RangedSummarizedExperiment-class object with the counts stored in the assays slot.

Author(s)

Leonardo Collado-Torres

See Also

coverage_matrix_bwtool

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
if(.Platform$OS.type != 'windows') {
## Disable the example for now. I'd have to figure out how to install
## bwtool on travis
if(FALSE) {
    ## Reading BigWig files is not supported by rtracklayer on Windows
    ## (only needed for defining the regions in this example)
    
    ## TODO
}
}

LieberInstitute/recount.bwtool documentation built on Feb. 7, 2020, 3:53 p.m.