Learn R Programming

rbamtools (version 2.16.17)

exonLoessModel-class: Class "exonLoessModel": Align-depth data for single genes on multiple samples (BAM files). Intronic regions are cut out of align depth matrix.

Description

Objects of this class combine data from geneAlignDepth. During construction, the align depth matrix is segmentized, so that only (unified) exonic regions are represented in align depth matrix.

Arguments

Objects from the Class

Objects can be created by calls of the form exonLoessModel(sal).

Slots

gene_id:

"character": Gene identifier (e.g. Ensembl or UCSC).

%
gene_name:

"character": Gene name.

%
seq_name:

"character": Reference sequence (chromosome) name.

%
strand:

"character": Strand orientation of gene on reference sequence (+, - or *)

%
nAligns:

"numeric": Total number of alignments in each BAM file.

%
group:

"character": Group assignment

%
loessPred:

"matrix": Loess estimated align depth values for each group. Each column contains estimates for one group.

Methods

show

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

%
exonLoessModel

signature(object=c("sampleBamFiles", "geneModel": Constructs exonLoessModel object and reads align depth data from BAM files.

%
plot

signature(object="exonLoessModel"): Plots align depth data.

%
groupRatio

signature(object="exonLoessModel", lim="numeric"): Returns single numeric value. From align depth estimates in loessPred matrix, the ratio between a column and the precedent column is calculated. For each position, the minimum ratio is extracted. The function returns the relative number of positions, where the minimum ratio exceeds given lim value.

Examples

Run this code
# NOT RUN {
## - - - - - - - - - - - - - - - - - - - - - - ##
# Construct sampleBamFiles object
bam<-system.file("extdata", "accepted_hits.bam", package="rbamtools")
bs <-sampleBamFiles(1)
bamFiles(bs) <- bam
sampleLabels(bs) <- "s1"
sampleGroups(bs) <- "g1"
checkBamFiles(bs)
nAligns(bs) <- bamCountAll(bs)
bs
## - - - - - - - - - - - - - - - - - - - - - - ##
# Construct geneModel object
library(refGenome)
ucfile<-system.file("extdata", "hs.ucsc.small.RData", package="refGenome")
uc<-loadGenome(ucfile)
gt <- getGeneTable(uc)
gene_id <- as.character(gt$gene_id[1])
gm <- geneModel(uc, gene_id)
## - - - - - - - - - - - - - - - - - - - - - - ##
# Construct geneAlignDepth object
gad <- geneAlignDepth(bs, gm)
## - - - - - - - - - - - - - - - - - - - - - - ##
# Extract exonLoessModel object
ead <- exonAlignDepth(gad, ratioLim=5, infVal=1000)
elm <- exonLoessModel(ead)
celm <- cutFlatAlignDepth(elm, ratio=0.1)
groupRatio(celm, lim=1.2, cut=0, order=1)
# }

Run the code above in your browser using DataLab