compute_mean: Given a set of bigwig files, create a scaled mean BigWig...

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

View source: R/compute_mean.R

Description

Given a set of BigWig files, create a scaled mean BigWig file using the area under coverage (AUC) to scale the BigWig files. The AUC will be calculated using wiggletools if necessary. This function requires the external dependencies wiggletools and wigToBigWig to work.

Usage

1
2
3
4
compute_mean(bws, outfile = "mean", aucs = NULL,
  chr_sizes = "/dcl01/lieber/ajaffe/Emily/RNAseq-pipeline/Annotation/hg38.chrom.sizes.gencode",
  auc_scale = 4e+07 * 100, wiggletools = "wiggletools",
  wigToBigWig = "wigToBigWig", tempdir = getwd())

Arguments

bws

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

outfile

The name of the mean bigwig file to create.

aucs

A vector of equal length to bws with the AUCs for each BigWig file. If absent, this infomration will be calculated using wiggletools.

chr_sizes

A single character vector with the path to the chr sizes file. This depends on the reference genome used for creating the BigWig files.

auc_scale

The value to which the BigWig AUCs will be scaled to. By default this corresponds to 40 million 100 bp reads.

wiggletools

Path to wiggletools. At JHPCE note that you'll have to use module load wiggletools/default before opening R.

wigToBigWig

Path to wigToBigWig. At JHPCE note that you'll have to use module load ucsctools before opening R.

tempdir

Path to a temporary directory to use for saving the intermediate files. You might have to specify one yourself when processing many BigWig files.

Details

Based on parts of https://github.com/leekgroup/recount-website/blob/master/recount-prep/prep_merge.R

Value

The path to the mean Wig and BigWig files as well as scripts that were created in the process.

Author(s)

Leonardo Collado-Torres

See Also

coverage_matrix_bwtool

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
if(.Platform$OS.type != 'windows') {
## Disable the example for now. I'd have to figure out how to install
## bwtool on travis
if(FALSE) {
    ## Works at JHPCE. Load the appropriate modules before opening R.
    # module load wiggletools/default
    # module load ucsctools
    # R

    library('recount')
    library('recount.bwtool')
bws <- recount_url$path[match(colData(rse_gene_SRP009615)$bigwig_file, recount_url$file_name)]
    compute_mean(bws[1:2], chr_sizes = '/dcl01/leek/data/gtex_work/runs/gtex/hg38.sizes', tempdir = 'testBW')
}
}

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