easyRNASeq-correction-methods: easyRNASeq count table correction to RPKM

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Convert a count table obtained from the easyRNASeq function into an RPKM corrected count table.

Usage

1
2
3
4
5
6
7
8
9
## S4 method for signature 'matrix,ANY,vector,vector'
RPKM(
  obj,
  from = c("exons", "features", "transcripts", "bestExons", "geneModels", "islands"),
  lib.size = numeric(1),
  feature.size = integer(1),
  simplify = TRUE,
  ...
)

Arguments

obj

An object of class RNAseq or a matrix, see details

from

Determine the kind of coverage to use, choice limited to: exons, features, transcripts, bestExons, geneModels or islands.

lib.size

Precise the library size. It should be a named numeric list, i.e. named after the sample names.

feature.size

Precise the feature (e.g. exons, genes) sizes. It should be a named numeric list, named after the feature names.

simplify

If set to TRUE, whenever a feature (exon, feature, ...) is duplicated in the count table, it is only returned once.

...

additional arguments. See details

Details

RPKM accepts two sets of arguments:

Value

A matrix containing RPKM corrected read counts.

Author(s)

Nicolas Delhomme

See Also

readCounts

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
	## Not run: 
	## get an RNAseq object
	rnaSeq <- easyRNASeq(filesDirectory=
		    			system.file(
					"extdata",
					package="RnaSeqTutorial"),
					pattern="[A,C,T,G]{6}\\.bam$",
				format="bam",
				readLength=36L,
				organism="Dmelanogaster",
				chr.sizes=as.list(seqlengths(Dmelanogaster)),
				annotationMethod="rda",
				annotationFile=system.file(
				                            "data",
							    "gAnnot.rda",
							    package="RnaSeqTutorial"),
				count="exons",
				outputFormat="RNAseq")

	## get the RPKM
	rpkm <- RPKM(rnaSeq,from="exons")
	
	## the same from a count table
	count.table <- readCounts(rnaSeq,count="exons")

	## get the RPKM
	## verify that the feature are sorted as the count.table
	all(.getName(rnaSeq,"exon") == rownames(count.table))
	feature.size <- unlist(width(ranges(rnaSeq)))

	## verify that the samples are ordered in the same way
	all(names(librarySize(rnaSeq)) == colnames(count.table))

	## get the RPKM
	rpkm <- RPKM(count.table,
			feature.size=feature.size,
			lib.size=librarySize(rnaSeq))

## End(Not run)

easyRNASeq documentation built on April 30, 2020, 2 a.m.