GetCountsPerRegion: Count the number of reads that are in a given genomic region.

Description Usage Arguments Value Author(s) Examples

Description

Count the number of reads that are in a given genomic region.

Usage

1
GetCountsPerRegion(BamFilePath, param)

Arguments

BamFilePath

location of aligned bam file. Corresponding bai index file must be in the same directory.

param

ScanBamParam data structure.

Value

An integer value for the number of reads that are in a given genomic region.

Author(s)

Nathaniel J. Madrid, Jason Byars

Examples

1
2
3
4
5
6
7
8
9
# Get file paths of aligned bam files. The corresponding bai index file must also be in the same directory.
BamFilePaths <- dir(path="/home/BamFiles", pattern=".*.bam$", full.names=T)
rRNAparamRegions <- GRanges(seqnames="GL000220.1", IRanges(1, 161802))

# Note that any region(s) can be used in GetCountsPerRegion, not just rRNA regions. 
rRNAparam <- ScanBamParam(which=rRNAparamRegions)

# Secondary alignments will only be counted once
rRNATotalCounts <- GetCountsPerRegion(BamFilePaths[1], rRNAparam)

njmadrid/RNAseqQuality documentation built on May 20, 2019, 3:32 p.m.