Description Usage Arguments Details Value Author(s) Examples
Opens multiple BAM-files and reads aligns for selected gene for each file. The function counts the tag-selected value which either is a BAM-cigar operation (like "N" or "M") or the total number of aligns.
1 | countByGeneName(object,infiles,idxInfiles=paste(infiles,".bai",sep=""),gene,tag="N")
|
object |
Object of class "refGenome" |
infiles |
Vector of BAM-files |
idxInfiles |
(Optional) Vector of BAM-index files. |
gene |
Gene name |
tag |
Character. Passed to (rbamtools) 'bamCountAll' function. Default value is "N". Other accepted values include "nAligns","M","I","D". |
countByGeneName
first uses the extractByGeneName
and getGenePositions
from 'refGenome' in order to calculate coordinates from the given gene name. Then for each given BAM-file name, the functions calls the bamCount
function and returns a vector with a count value for each given file. Internally countByGeneName
also checks for existing BAM-index file and tries to create index files which do not exist.
Numeric vector. Length equals number of BAM-input files.
Wolfgang Kaisers
1 2 3 4 5 6 7 8 9 | # A) Read filenames
ucf<-system.file("extdata","uc_small.RData",package="spliceSites")
uc<-loadGenome(ucf)
bam<-character(2)
bam[1]<-system.file("extdata","rna_fem.bam",package="spliceSites")
bam[2]<-system.file("extdata","rna_mal.bam",package="spliceSites")
# B) count
countByGeneName(uc,bam,gene="WASH7P",tag="N")
countByGeneName(uc,bam,gene="WASH7P",tag="nAligns")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.