cRanges-class {spliceSites} | R Documentation

## Class `"cRanges"`: Centered ranges.

### Description

`"cRanges"` Objects that contain centered genomic ranges. The center position marks a prominent position inside the range, generally an exon-intron junction. Position values represent the 0-based position of last exon nucleotide.

### Objects from the Class

Objects can be created by calls of the form `new("cRanges", seqnames, start, end, width, strand, position, id)`.

### Slots

`dt`:

  Object of class `"data.frame"`. The data.frame contains the columns id, seqnames, start, end, width, strand and position. Each row contains data for one centered range.

### Methods

as.data.frame

  `signature(x = "cRanges")`: Returns a copy of the contained data inside a `data.frame` object.

c

  `signature(x = "cRanges")`: Generic combining for `cRanges` objects.

count

  `signature(x = "cRanges")`: Returns the number of contained ranges (number of rows).

dim

  `signature(x = "cRanges")`: Returns the dim of the contained data.frame.

dnaRanges

  `signature(x = "cRanges", dnaset="DNAStringSet",useStrand="logical",removeUnknownStrand=logical)`: Takes a `cRanges` object and a `DNAStringSet` (a reference sequence) and adds the appropriate DNA sequence to the genomic ranges. Returns a `cdRanges` object.

end

  `signature(x = "cRanges")`: Returns `end` column of data.

head

  `signature(x = "cRanges",n="numeric",digits="numeric")`: Returns first n (default: n=6) lines of contained data.frame.

id

  `signature(x = "cRanges")`: Returns id column from contained data.frame.

initialize

  `signature(.Object = "cRanges")`: Generic class initialisation method.

lCodons

  `signature(x = "cRanges",frame="numeric", keepStrand="logical")`: Returns cRanges object which represents ranges truncated to codon size. When 'keepStrand' is set to FALSE, strand is set to '+'. The intention is that appended DNA sequences which then can be translated into amino acids.

rCodons

  `signature(x = "cRanges",frame="numeric", keepStrand="logical")`: Returns cRanges object which represents ranges truncated to codon size. When 'keepStrand' is set to FALSE, strand is set to '+'. The intention is that appended DNA sequences which then can be translated into amino acids.

seqid

  `signature(x = "cRanges")`: Returns vector with seqid's.

show

  `signature(object = "cRanges")`: Generic print function.

sortTable

  `signature(x="cRanges")`: Sort contained tables by `seqid`,`lend` and `rstart`.

start

  `signature(x = "cRanges")`: Returns start column from contained data.frame.

strand

  `signature(x = "cRanges")`: Returns strand column from contained data.frame.

width

  `signature(x = "cRanges")`: Returns width of contained ranges (=end-start+1).

### Author(s)

Wolfgang Kaisers

### See Also

gapRanges

### Examples

    # A) Create cRanges object from scratch
    sq<-factor(c(1,1,2,2,3,3),labels=c("chr1","chr2","chr3"))
    st<-c(100,200,100,300,100,400)
    en<-c(120,210,110,310,110,410)
    pos<-c(2,3,4,5,6,7)
    cr<-new("cRanges",seqid=sq,start=st,end=en,position=pos)
    cr
    seqid(cr)
    start(cr)
    end(cr)
    width(cr)
    strand(cr)
    id(cr)
    lCodons(cr,frame=1,keepStrand=TRUE)
    lCodons(cr,frame=1,keepStrand=FALSE)
    lCodons(cr,frame=2,keepStrand=TRUE)
    rCodons(cr,frame=1,keepStrand=FALSE)
    # + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #
    # B) Intended way to create a cRanges object from BAM data
    bam<-system.file("extdata","rna_fem.bam",package="spliceSites")
    reader<-bamReader(bam,idx=TRUE)
    ga<-alignGapList(reader)
    bamClose(reader)
    ga
    lj<-lJunc(ga,featlen=3,gaplen=6,strand='+')
    lj
    # C) ...
    table(strand(lj))

[Package spliceSites version 1.30.0 Index]