DEGseq (version 1.26.0)

getGeneExp: getGeneExp: Count the number of reads and calculate the RPKM for each gene

Description

This function is used to count the number of reads and calculate the RPKM for each gene. It takes uniquely mapped reads from RNA-seq data for a sample with a gene annotation file as input. So users should map the reads (obtained from sequencing library of the sample) to the corresponding genome in advance.

Usage

getGeneExp(mapResultBatch, fileFormat="bed", readLength=32, strandInfo=FALSE,
           refFlat, output=paste(mapResultBatch[1],".exp",sep=""), min.overlapPercent=1)

Arguments

mapResultBatch
vector containing uniquely mapping result files for a sample. Note: The sample can have multiple technical replicates.
fileFormat
file format: "bed" or "eland". example of "bed" format: chr12 7 38 readID 2 + example of "eland" format: readID chr12.fa 7 U2 F Note: The field separator character is TAB. And the files must follow the format as one of the examples.
readLength
the length of the reads (only used if fileFormat="eland").
strandInfo
whether the strand information was retained during the cloning of the cDNAs.
  • "TRUE": retained,
  • "FALSE": not retained.
refFlat
gene annotation file in UCSC refFlat format. See http://genome.ucsc.edu/goldenPath/gbdDescriptionsOld.html#RefFlat.
output
the output file.
min.overlapPercent
the minimum percentage of the overlapping length for a read and an exon over the length of the read itself, for counting this read from the exon. should be <=1. 0: at least 1 bp overlap between a read and an exon.

References

Mortazavi,A. et al. (2008) Mapping and quantifying mammalian transcriptomes by RNA-seq. Nat. Methods, 5, 621-628.

See Also

DEGexp, DEGseq, readGeneExp, kidneyChr21.bed, liverChr21.bed, refFlatChr21.

Examples

Run this code
kidneyR1L1 <- system.file("extdata", "kidneyChr21.bed.txt", package="DEGseq")
  refFlat    <- system.file("extdata", "refFlatChr21.txt", package="DEGseq")
  mapResultBatch <- list(kidneyR1L1)
  output <- file.path(tempdir(), "kidneyChr21.bed.exp")
  exp <- getGeneExp(mapResultBatch, refFlat=refFlat, output=output)
  write.table(exp[30:35,], row.names=FALSE)
  cat("output: ", output, "")

Run the code above in your browser using DataLab