quantifyExpressionsFromTrCounts: Evaluates introns and exons RPKMs, per gene, from counts...

Description Usage Arguments Value Examples

View source: R/quantifyExpressionsFromTrCounts-functions.R

Description

Evaluates introns and exons RPKMs, per gene, from counts data.

Usage

1
2
3
quantifyExpressionsFromTrCounts(libsize, exonsWidths, intronsWidths, allcounts,
  by = c("gene", "tx"), DESeq2 = TRUE, experimentalDesign,
  varSamplingCondition = NULL)

Arguments

libsize

A numeric reporting the number of assigned reads.

exonsWidths

A numeric containing the exons widths.

intronsWidths

A numeric containing the intorns widths.

allcounts

A list object containing introns and exons counts.

by

A character, either "gene" or "tx", indicating if rpkms and counts should be summarized at the levels of genes or transcripts. "gene" by default

DESeq2

A logical, if TRUE the RPKMs variances are evaluated through the package DESeq2, if FALSE plgem is used.

experimentalDesign

A numerical which reports the desing of the experiment in terms of time points and replicates. The time points must be ordered according to the columns of the count matrices submitted for the analysis; these labels define conditions and replicates.

varSamplingCondition

A character reporting which experimental condition should be used to sample the fatiance if DESeq2 = FALSE.

Value

A list containing RPKMs and associated variances for exons and introns.

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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
data('allcounts', package='INSPEcT')

nascentCounts<-allcounts$nascent
matureCounts<-allcounts$mature

testGenes<-rownames(matureCounts$exonsCounts)

require(TxDb.Mmusculus.UCSC.mm9.knownGene)
txdb<-TxDb.Mmusculus.UCSC.mm9.knownGene

exonsDB<-reduce(exonsBy(txdb ,'gene'))
exonsDB<-exonsDB[elementNROWS(range(exonsDB))==1]
intronsDB<-psetdiff(unlist(range(exonsDB)),exonsDB)
intronsDB<-intronsDB[elementNROWS(intronsDB)>0]

exWdths<-sapply(width(exonsDB),sum)
intWdths<-sapply(width(intronsDB),sum)

exWdths<-exWdths[testGenes]
intWdths<-intWdths[testGenes]

nascentLS<-colSums(nascentCounts$
  stat[c('Assigned_Exons','Assigned_Introns'),,drop=FALSE])

totalLS<-colSums(matureCounts$
  stat[c('Assigned_Exons','Assigned_Introns'),,drop=FALSE])

expDes<-rep(c(0,1/6,1/3,1/2,1,1.5,2,4,8,12,16),3)

nasExp_DESeq2<-quantifyExpressionsFromTrCounts(libsize=nascentLS
                                              ,exonsWidths=exWdths
                                              ,intronsWidths=intWdths
                                              ,allcounts=nascentCounts
                                              ,DESeq2=TRUE
                                              ,experimentalDesign=expDes)

matExp_DESeq2<-quantifyExpressionsFromTrCounts(libsize=totalLS
                                              ,exonsWidths=exWdths
                                              ,intronsWidths=intWdths
                                              ,allcounts=matureCounts
                                              ,DESeq2=TRUE
                                              ,experimentalDesign=expDes)

vsc<-as.character(expDes[[1]])

nasExp_plgem<-quantifyExpressionsFromTrCounts(libsize=nascentLS
                                             ,exonsWidths=exWdths
                                             ,intronsWidths=intWdths
                                             ,allcounts=nascentCounts
                                             ,DESeq2=FALSE
                                             ,experimentalDesign=expDes
                                             ,varSamplingCondition=vsc)

matExp_plgem<-quantifyExpressionsFromTrCounts(libsize=totalLS
                                             ,exonsWidths=exWdths
                                             ,intronsWidths=intWdths
                                             ,allcounts=matureCounts
                                             ,DESeq2=FALSE
                                             ,experimentalDesign=expDes
                                             ,varSamplingCondition=vsc)

ste-depo/INSPEcT documentation built on July 30, 2018, 12:04 p.m.