fullCoverage {derfinder} | R Documentation |
For a group of samples this function reads the coverage information for several chromosomes directly from the BAM files. Per chromosome, it merges the unfiltered coverage by sample into a DataFrame. The end result is a list with one such DataFrame objects per chromosome.
fullCoverage(files, chrs, bai = NULL, chrlens = NULL, outputs = NULL, cutoff = NULL, ...)
files |
A character vector with the full path to the sample BAM files
(or BigWig files).
The names are used for the column names of the DataFrame. Check
rawFiles for constructing |
chrs |
The chromosome of the files to read. The format has to match the one used in the input files. |
bai |
The full path to the BAM index files. If |
chrlens |
The chromosome lengths in base pairs. If it's |
outputs |
This argument is passed to the |
cutoff |
This argument is passed to filterData. |
... |
Arguments passed to other methods and/or advanced arguments. Advanced arguments:
Passed to loadCoverage, define_cluster and
extendedMapSeqlevels.
Note that filterData is used internally
by loadCoverage (and hence fullCoverage) and has the important
arguments |
A list with one element per chromosome.
Each element is a DataFrame with the coverage information produced by loadCoverage.
Leonardo Collado-Torres
loadCoverage, filterData, getTotalMapped
datadir <- system.file('extdata', 'genomeData', package='derfinder') files <- rawFiles(datadir=datadir, samplepatt='*accepted_hits.bam$', fileterm=NULL) ## Shorten the column names names(files) <- gsub('_accepted_hits.bam', '', names(files)) ## Read and filter the data, only for 1 file fullCov <- fullCoverage(files=files[1], chrs=c('21', '22')) fullCov ## Not run: ## You can then use filterData() to filter the data if you want to. ## Use bplapply() if you want to do so with multiple cores as shown below. library('BiocParallel') p <- SnowParam(2L, outfile = Sys.getenv('SGE_STDERR_PATH')) bplapply(fullCov, function(x) { library('derfinder'); filterData(x, cutoff=0) }, BPPARAM = p) ## End(Not run)