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

Share:

Description

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

Usage

1
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. Default 3 nucleotides (codon). No motif longer than 6 nucleotides is accepted. 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
#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)