Learn R Programming

rbamtools (version 2.16.17)

nucStats: Table nucleotides in whole BAM file(s)

Description

The function counts occurrence of the Nucleotides A,C,G,T for whole BAM file from bamReader object or a list of BAM files. Letters different from A,C,G,T are subsumed in the value N. The function returns a data.frame with 8 columns. The names indicate which position contains the count value each nucleotide. The function also calculates GC-content and AT/GC ratio which make up the last two columns. The returned data.frame contains one row for each reference sequence (when used for bamReader) or one row for each given BAM file name.

Usage

nucStats(object,...)

Arguments

object

bamReader object. The reader must be opened and have initialized index.

...

Optional name for BAM-index files (argument name=idxInfiles).

Value

data.frame

Examples

Run this code
# NOT RUN {
bam<-system.file("extdata","accepted_hits.bam",package="rbamtools")
nucStats(bam)
idx<- system.file("extdata", "accepted_hits.bam.bai", package="rbamtools")
nucStats(bam,idxInfiles=idx)
reader<-bamReader(bam,idx=TRUE)
nucStats(reader)
range<-bamRange(reader,c(0,0,100000))
nucStats(range)
# }

Run the code above in your browser using DataLab