GetPileUpPerGene: Get read depths per gene as defined by the RSamtools pileup...

Description Usage Arguments Value Author(s) Examples

Description

Get read depths per gene as defined by the RSamtools pileup function.

Usage

1
GetPileUpPerGene(BamFilePath, TopCDSDF, max_depth = 10000)

Arguments

BamFilePath

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

TopCDSDF

Data frame of CDS returned from select(Homo.sapiens).

max_depth

Parameter of the same name passed to Rsamtools pileup. Default value is 10000.

Value

A data.frame created via Rsamtools:pileup for each CDS region in TopCDSDF.

Author(s)

Nathaniel J. Madrid, Jason Byars

Examples

1
2
3
4
5
6
7
BamFilePaths <- dir(path="/home/ubuntu/BamFiles", pattern=".*.bam$", full.names=T)
TopGenesDF <- data.frame(gene = c("NM_016824", "NM_019903", "NP_001112"))
cdsColumns <- c("CDSCHROM", "CDSSTART", "CDSEND", "CDSSTRAND", "SYMBOL")
TopCDSDF <- select(Homo.sapiens, keys=as.character(TopGenesDF$gene), columns=cdsColumns, keytype="REFSEQ")
TopCDSDF$CDSCHROM <- sub("chr", "", TopCDSDF$CDSCHROM)
TopCDSDF <- TopCDSDF[which(TopCDSDF$CDSCHROM %in% c(1:22, "X", "Y")), ]
PileUpPerFile <- lapply(BamFilePaths[1:3], function(f) GetPileUpPerGene(f, TopCDSDF)) 

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