coverageFromBedGraph: read coverage from bedGraph files

Description Usage Arguments Value Author(s) Examples

View source: R/coverageFromBedGraph.R

Description

read coverage from bedGraph files and save as a list.

Usage

1
2
    coverageFromBedGraph(bedgraphs, tags, genome, 
                        hugeData=FALSE, BPPARAM=NULL, ...)

Arguments

bedgraphs

The file names of bedgraphs generated by bedtools. eg: bedtools genomecov -bg -split -ibam $bam -g mm10.size.txt > $bedgraph

tags

the names for each input bedgraphs

genome

an object of BSgenome

hugeData

is this dataset consume too much memory? if it is TRUE, the coverage will be saved into tempfiles.

BPPARAM

An optional BiocParallelParam instance determining the parallel back-end to be used during evaluation, or a list of BiocParallelParam instances, to be applied in sequence for nested calls to bplapply.

...

parameters can be passed into tempfile. This is useful when you submit huge dataset to cluster.

Value

return a list of coverage for each bedgraph files. For each item in the list, it is a list of coverage for each chromosome. And the chromosome must start from "chr".

Author(s)

Jianhong Ou

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
    if(interactive()){
        library(BSgenome.Mmusculus.UCSC.mm10)
        path <- file.path(find.package("InPAS"), "extdata")
        bedgraphs <- file.path(path, "Baf3.extract.bedgraph")
        data(utr3.mm10)
        tags <- "Baf3"
        genome <- BSgenome.Mmusculus.UCSC.mm10
        coverage <- 
            coverageFromBedGraph(bedgraphs, tags, genome, hugeData=FALSE)
    }

InPAS documentation built on Nov. 8, 2020, 5:03 p.m.