makeRPKMs {INSPEcT} | R Documentation

## Calculate RPKM and count values on introns and exons from bam/sam files

### Description

Given a TranscriptDb object and a list of bam/sam files for 4su and total RNA experiments, "makeRPKMs" function calculates read counts and RPKM on exonic and intronic features per each gene. Reads that fall where intronic and exonic features overlaps are univoquely assigned to exons.

### Usage

    makeRPKMs(txdb, paths_foursu, paths_total, by = c("gene", "tx"),
      countMultiMappingReads = FALSE, allowMultiOverlap = FALSE,
      strandSpecific = 0, isPairedEnd = FALSE)

### Arguments

`txdb` | A TranscriptDB object
`paths_foursu` | A vector of paths of 4sU-seq sam files
`paths_total` | A vector of paths of RNA-seq sam files
`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
`countMultiMappingReads` | A logical, if multimapping reads should be counted, FALSE by default. Multimap reads are identified using the tag "NH" in the bam/sam file.
`allowMultiOverlap` | A logical, indicating if a read is allowed to be assigned to more than one feature, FALSE by default
`strandSpecific` | Numeric, 0 if no strand-specific read counting should be performed, 1 stranded, 2 reversely-stranded. 0 by default
`isPairedEnd` | A logical, if paired-end reads are used, FALSE by default

### Value

A list containing rpkms, counts and the annotation extracted from TxDB for exons and introns

### Examples

    require(TxDb.Mmusculus.UCSC.mm9.knownGene)
    txdb <- TxDb.Mmusculus.UCSC.mm9.knownGene
    files4su <- system.file('extdata', '4sURNA_0h.bam', package="INSPEcT")
    filesTotal <- system.file('extdata', 'totalRNA_0h.bam', package="INSPEcT")
    makeRPKMsOut <- makeRPKMs(txdb, files4su, filesTotal)
    rpkms <- makeRPKMsOut$rpkms
    counts <- makeRPKMsOut$counts
    annotation <- makeRPKMsOut$annotation

[Package INSPEcT version 1.10.0 Index]