Learn R Programming

rbamtools (version 2.16.17)

GenomePartition-class: Class "GenomePartition": .

Description

.

Arguments

Objects from the Class

can be created using the genomePartition function on an opened bamReader and a data.frame containing target regions (usually gene annotation data).

Slots

ev:

"environment". Environment which contains data as data.frames.

Methods

show

signature(object="GenomePartition"): Prints a short message with some summarizing data.

%
getSeqNr

signature(object="GenomePartition"): Returns number of reference sequences in refdata.

%
getRefData

signature(object="GenomePartition"): Returns refdata data.frame.

%
getPos

signature(object="GenomePartition"): Returns numeric position values for align depth.

%
countPartition

signature(partition="GenomePartition", src="bamReader"): Counts BAM alignments on the contained grid from a single BAM file (represented by an opened bamReader.

%
countPartition

signature(partition="GenomePartition", src="data.frame"): Counts BAM alignments on the contained grid from multiple BAM files (filenames and sample names given in src)

%
checkPartition

signature(partition="GenomePartition", src="data.frame", verbose="logical"): Checks incoming arguments and present reference sequences for consistency. Intended to be used as preparation for countPartition in order to prevent unexpected routine terminations.

%
getFileTable

signature(object="GenomePartition"): Returns the contained filetable (constituted by usage of countPartition function).

%
getAlignCounts

signature(object="GenomePartition"): Returns counted alignments in annotated regions (exons, genes).

%
getGridAlignCounts

signature(object="GenomePartition"): Returns counted alignments in underlying equidistant grid.

Details

The environment contains at least three objects: reftable, reflist and genome. The reftable data.frame contains data on reference sequences (chromosomes) derived from the bamReader getRefData function. The reflist is a list containing calculated partition segments based on the genome argument of the genomePartition function and a underlying equidistant grid on the genome. After counting BAM alignments using a genomePartition object, the environment additionally contains a filetable data.frame.

Examples

Run this code
# NOT RUN {
# Open (indexed) BAM file
bam<-system.file("extdata", "accepted_hits.bam", package="rbamtools")
reader<-bamReader(bam,idx=TRUE)

# Provide exon positions
id <- 1:13
seqid <- "chr1"
gene <- "WASH7P"
ensg_id <- "ENSG00000227232"
start <- c(14411, 15000, 15796, 15904, 16607, 16748, 16858, 17233,
           17602, 17915, 18268, 24737, 29534)
end <-   c(14502, 15038, 15901, 15947, 16745, 16765, 17055, 17364,
           17742, 18061, 18366, 24891, 29806)
           
ref <- data.frame(id=id, seqid=seqid, begin=start, end=end, gene=gene, ensg=ensg_id)

# Create partition (adds equidistant grid)
partition <- genomePartition(reader, ref)

# Count alignments
countPartition(partition, reader)

# Extract result data
urc <- getAlignCounts(partition)
gac <- getGridAlignCounts(partition)

# }

Run the code above in your browser using DataLab