Learn R Programming

ExomeDepth (version 0.7.3)

getBamCounts: Get count data for multiple exomes

Description

Essentially a wrapper for the accessory function countBamInGRanges which only considers a single BAM file at a time.

Usage

getBamCounts(bed.frame = NULL,
bed.file = NULL,
bam.files,
min.mapq = 20,
read.width = 300,
include.chr = FALSE,
referenceFasta = NULL)

Arguments

bed.frame
data.frame containing the definition of the regions. The first three columns must be chromosome, start, end.
bed.file
character file name. Target BED file with the definition of the regions. This file will only be used if no bed.frame argument is provided. No headers are assumed so remove them if they exist. Either a bed.file or a bed.frame must be pro
bam.files
character, list of BAM files to extract read count data from.
min.mapq
numeric, minimum mapping quality to include a read.
read.width
numeric, maximum distance between the side of the target region and the middle of the paired read to include the paired read into that region.
include.chr
logical, if set to TRUE, this function will remove the string 'chr' from the chromosome names of the target BED file.
referenceFasta
character, file name for the reference genome in fasta format. If available, GC content will be computed and added to the output.

Value

  • A GenomicRanges object that stores the read count data for the BAM files listed as argument.

Details

This function is largely a copy of a similar one available in the exomeCopy package.

References

exomeCopy R package.

Examples

Run this code
load(exons.hg19)

my.counts <- getBamCounts(bed.frame = exonpos,
                          bam.files = my.bam,
                          referenceFasta = '/ugi/home/shared/vincent/reference_genome/fasta/human_g1k_v37.fasta')

Run the code above in your browser using DataLab