Learn R Programming

GenomicFiles (version 1.2.1)

BamFileViews: Views into a set of BAM files

Description

Use BamFileViews() to reference a set of disk-based BAM files to be processed

Constructor

BamFileViews(fileList, fileSample=DataFrame(row.names=make.unique(basename(path(fileList)))), fileRange, fileExperiment = list(), yieldSize = NA_integer_, .views_on_file = new.env(parent=emptyenv()), ...): This constructor is a generic function with dispatch on argument fileList. Methods exist for BamFileList and character (vector of file names).

Accessors

All accessor-like methods defined for GenomicFileViews objects work on BamFileViews objects. See ?GenomicFileViews for details.
  • fileList(x); fileList(x) <- value
  • fileSample(x); fileSample(x) <- value
  • fileRange(x); fileRange(x) <- value
  • fileExperiment(x); fileExpermient(x) <- value
  • yieldSize(x); yieldSize(x) <- value

Methods

"[": Subset the object by fileRange or fileSample.
reduceByFile
Computations are distributed in parallel by files in fileList with the option to provide MAP and REDUCE functions across ranges and / or files.
reduceByRange
Computations are distributed in parallel by ranges in fileRange with the option to provide MAP and REDUCE functions across ranges and / or files.
summarizeOverlaps
Computations are distributed in parallel by files in fileList. Ranges in the fileRange slot take precedence over ranges in param. The return value is a SummarizedExperiment object.
countBam
Computations are distributed in parallel by files in fileList. Ranges in the fileRange slot take precedence over ranges in param. The return value is a list of data.frames, one per file.
scanBam
Computations are distributed in parallel by files in fileList. Ranges in the fileRange slot take precedence over ranges in param. The return value is a list of lists, one per file.

Arguments

fileList: A character() vector of BAM path names or a BamFileList.
fileSample: A DataFrame instance with as many rows as length(fileList), containing sample information associated with each path.
fileRange: A GRanges, or missing instance with ranges defined on the spaces of the BAM files. Ranges are not validated against the BAM files.
fileExperiment: A list() containing additional information about the experiment.
yieldSize: An integer specifying number of records to process
.views_on_file: An enviornment; currently under development
...: Additional arguments.
x, object: An instance of BamFileViews.
value: An object of appropriate type to replace content.
i: During subsetting, a logical or numeric index into fileRange.
j: During subsetting, a logical or numeric index into fileSample and fileList.
file: An instance of BamFileViews.
index: Not used.
param: An optional ScanBamParam instance to further influence scanning or counting.

Slots

Inherited from GenomicFileViews class:
  • fileList
  • fileSample
  • fileRange
  • fileExperiment
  • yieldSize
  • .views_on_file

See Also

Examples

Run this code
library(RNAseqData.HNRNPC.bam.chr14)
fls <- RNAseqData.HNRNPC.bam.chr14_BAMFILES
gr <- GRanges("chr14", IRanges(1:10*5, width = 2))
bfv <- BamFileViews(fls, fileRange = gr)

## Dimensions of the object are ranges by samples (files).
bfv 
bfv[1:5,]
fileList(bfv)
fileRange(bfv)

Run the code above in your browser using DataLab