xCodons {spliceSites} | R Documentation |
The xCodon functions work on cRanges
objects. On the contained ranges the function can have two effects: an upstream frame-shift of 0 to 2 positions and a downstream trim to full codons (i.e. (end-start+1)%%3==0). The lCodon
function acts in '+' strand mode (left frame-shift, right truncation) and the rCodon
function acts in '-' strand mode (right frame-shift, left truncation).
lCodons(x,frame=1,keepStrand=TRUE)
x |
cRanges. Object in which codon positions are calculated |
frame |
Numeric. Default is 1. Accepted values are 1,2 or 3. The value causes a frame-shift of size (frame-1). |
keepStrand |
Logical. Default is TRUE. When FALSE, |
The function causes an upstream frameshift and a downstream truncation. lCodon
works with '+'-strand view (left-to-right) and rCodon
works with '-'-strand view (right to left). The underlying rationale is: The cRanges
object contains ranges around exon-intron boundaries. The boundary itself is marked by the position value. The functions calculate genomic ranges which can be supplemented by the reference DNA-sequence which then can readily be translated into amino-acid sequences. The different values for frame
and keepStrand
are used to produce all six putative amino-acid sequences for this exon-intron boundary.
Wolfgang Kaisers
bam<-system.file("extdata","rna_fem.bam",package="spliceSites") reader<-bamReader(bam,idx=TRUE) ga<-alignGapList(reader) bamClose(reader) dnafile<-system.file("extdata","dna_small.RData",package="spliceSites") load(dnafile) ucf<-system.file("extdata","uc_small.RData",package="spliceSites") uc<-loadGenome(ucf) lj<-lJunc(ga,featlen=21,gaplen=21,strand='+') ljc<-lCodons(lj,frame=1,keepStrand=TRUE) rj<-rJunc(ga,featlen=21,gaplen=21,strand='-') rjc<-rCodons(rj,frame=1,keepStrand=TRUE)