Description Details Objects from the Class Slots Methods Author(s) Examples
The alignDepth class represents data and provides plot functions for alignment depth for genomic regions (represented by bamRange objects).
The params
vector contains the following values:
1 | seqid | 0-based index of reference sequence |
2 | qrBegin | 0-based left boundary of query region (query range begin) |
3 | qrEnd | 0-based right boundary of query region (query range end) |
4 | complex | 0= all aligns included, 1= only aligns with n_cigar > 1 included |
5 | rSeqLen | Length of reference sequence |
6 | qSeqMinLen | Minimum of query sequence length (= read length) |
7 | qSeqMaxLen | Maximum of query sequence length (= read length) |
Objects can be created by calls of the form alignDepth(object,gap))
on bamRange objects. From the bamRange
object, the range is extracted
and for each nucleotide position whithin this range the numbers of align
matches are calculated.
When alignDepth
is called wich gap=TRUE
,
the function counts aligns solely for gap-adjacent match regions (cigar-op's).
depth
:"integer"
. Align depth values.
pos
:"integer"
. Corresponding (1-based) positions
params
:"numeric"
. Set of internally
used parameters
refname
:"character"
.
Name of reference sequence from which bamRange
was extracted.
signature(object="alignDepth")
:
Prints a short message with some summarizing data.
signature(object="alignDepth", main, xlab,
ylab, start, end, transcript, xlim, strand,"...")
:
Plots align depth in a line-plot.
signature(object="alignDepth")
:
Returns numeric align depth values.
signature(object="alignDepth")
:
Returns numeric position values for align depth.
signature(object="alignDepth")
:
Returns numeric parameter values.
Wolfgang Kaisers
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | # Open (indexed) BAM file
bam<-system.file("extdata", "accepted_hits.bam", package="rbamtools")
reader<-bamReader(bam,idx=TRUE)
# Extract reads from BAM file
xlim = c(10000, 30000)
coords<-c(0,xlim[1], xlim[2])
range<-bamRange(reader,coords)
bamClose(reader)
# Calculate align depth
ad<-alignDepth(range)
ad
getParams(ad)
# Prepare plotting parameter
gene<-"WASH7P"
ensg_id <- "ENSG00000227232"
enst_id <- "ENST00000538476"
# Get exon positions
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)
# Do plot
plotAlignDepth(ad, lwd = 2, xlim = xlim,
main = paste("Align depth for gene",gene),
ylab = "Align depth", start = start,
end = end, strand = "-",
transcript = paste("Chromosome 1",
"\tGene", ensg_id,
"\tTranscript ",enst_id)
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.