gapSites: Creating 'gapSites' and 'dnaGapSites' objects.

Description Usage Arguments Details Value Author(s) Examples

View source: R/spliceSites.R

Description

gapSites creates objects of class gapSites from scratch. dnaGapSites creates objects of class dnaGapSites from gapSites objects.

Usage

1
2
3
4
gapSites(seqid=factor(),lstart=integer(),lend=integer(),
                    rstart=integer(),rend=integer(),gaplen,strand,
                    nr_aligns=1,nAligns=sum(nr_aligns),
                    nAlignGaps=sum(nr_aligns),nProbes=1)

Arguments

seqid

Character.Identifies reference sequence.

lstart

Coordinates for start of left range.

lend

Coordinates for end of left range. Usually exon-intron boundary.

rstart

Coordinates for start of right range. Usually exon-intron boundary.

rend

Coordinates for end of right range.

gaplen

Length of enclosed gap. Should equal rstart-lend-1.

strand

+ or - or * (for unknown). Default: '*'.

nr_aligns

Number of gapped aligns which have the same exon-intron boundaries (lend and rstart)

nAligns

Total number of aligns for probeset.

nAlignGaps

Total lnumber of gapped aligns for probeset.

nProbes

Numeric. Number of probes in which this gapped position is present.

Details

The intended way to create a gapSites object is to use the alignGapList function which in turn calls the (rbamtools) bamGapList function. When a BAM file almoust exclusively contains gapped aligns which sometimes are multiply gapped, possibly the 'nAlignGaps' value is greater than the 'nAligns'. When reading BAM files which contain the complete date of an alignment, usually the 'nAlignGaps' value is about $1/3$ of the 'nAligns' value.

Value

An object of class 'gapSites'.

Author(s)

Wolfgang Kaisers

Examples

 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
# A) Construct source data from scratch
seqid<-c("chr1","chr1","chr2","chr2","chr2")
lstart<-c(900, 1900,900 ,900, 1900)
lend  <-c(1000,2000,1000,1000,2000)
rstart<-c(1100,2100,1100,1200,2100)
rend  <-c(1200,2200,1200,1300,2200)
nr_aligns<-c(10,20,30,40,10)

# B) Construct gapSites object
ga<-gapSites(seqid,lstart,lend,rstart,rend,nr_aligns=nr_aligns)
ga

# C) Use gapSites accessors
seqid(ga)
lend(ga)
rstart(ga)
strand(ga)
gptm(ga)
rpmg(ga)
nAligns(ga)
nAlignGaps(ga)

# D) Create 
bam<-system.file("extdata", "rna_fem.bam", package="spliceSites")
reader<-bamReader(bam,idx=TRUE)
ga<-alignGapList(reader)
ga
dnafile<-system.file("extdata","dna_small.RData",package="spliceSites")
load(dnafile)
dga<-dnaGapSites(ga,dna_small)

spliceSites documentation built on May 6, 2019, 3:05 a.m.