codonInfo {RiboProfiling} | R Documentation

## Associates the read counts on codons with the codon type for each ORF.

### Description

Associates the read counts on codons with the codon type for each ORF.

### Usage

    codonInfo(listReadsCodon, genomeSeq, orfCoord, motifSize)

### Arguments

`listReadsCodon` | a list of data.frame objects. It contains the number of reads per codon in a CDS.
`genomeSeq` | a BSgenome object. It contains the full genome sequences for the organism.
`orfCoord` | a GRangesList. The coordinates of the ORFs on the genome.
`motifSize` | an integer. The number of nucleotides in each motif on which to compute coverage and usage. Either 3, 6, or 9. Default 3 nucleotides (codon). Attention! For long motifs, the function can be quite slow!!

### Value

a list of 2 data.frame objects: one with the number of times each codon type is found in each ORF and one with the number of reads for each codon type in each ORF.

### Examples

    #for each codon in each ORF get the read coverage
    #parameter listReadsCodon can be returned by the riboSeqFromBam function
    #it corresponts to the 2nd element in the list returned by riboSeqFromBam
    data(codonIndexCovCtrl)
    listReadsCodon <- codonIndexCovCtrl

    txdb <- TxDb.Hsapiens.UCSC.hg19.knownGene::TxDb.Hsapiens.UCSC.hg19.knownGene

    #get the names of the ORFs
    #grouped by transcript
    cds <- GenomicFeatures::cdsBy(txdb, use.names=TRUE)
    orfCoord <- cds[names(cds) %in% names(listReadsCodon)]

    #get the genome, please check that the genome has the same seqlevels
    genomeSeq <- BSgenome.Hsapiens.UCSC.hg19::BSgenome.Hsapiens.UCSC.hg19
    #if not rename it
    #gSeq <- GenomeInfoDb::renameSeqlevels(genomeSeq,
    #sub("chr", "", GenomeInfoDb::seqlevels(genomeSeq)))

    #codon frequency, coverage, and annotation
    codonData <- codonInfo(listReadsCodon, genomeSeq, orfCoord)

[Package RiboProfiling version 1.7.2 Index]