| entropy {ORFik} | R Documentation |
Calculates entropy of the 'reads' coverage over each 'grl' group. The entropy value per group is a real number in the interval (0:1), where 0 indicates no variance in reads over group. For example c(0,0,0,0) has 0 entropy, since no reads overlap.
entropy(grl, reads)
grl |
a |
reads |
a GAlignment, GRanges or GRangesList object, usually of RiboSeq, RnaSeq, CageSeq, etc. |
A numeric vector containing one entropy value per element in 'grl'
Other features:
computeFeaturesCage(),
computeFeatures(),
disengagementScore(),
distToCds(),
distToTSS(),
floss(),
fpkm_calc(),
fpkm(),
fractionLength(),
initiationScore(),
insideOutsideORF(),
isInFrame(),
isOverlapping(),
kozakSequenceScore(),
orfScore(),
rankOrder(),
ribosomeReleaseScore(),
ribosomeStallingScore(),
startRegionCoverage(),
startRegion(),
subsetCoverage(),
translationalEff()
# a toy example with ribo-seq p-shifted reads
ORF <- GRanges("1", ranges = IRanges(start = c(1, 12, 22),
end = c(10, 20, 32)),
strand = "+",
names = rep("tx1_1", 3))
names(ORF) <- rep("tx1", 3)
grl <- GRangesList(tx1_1 = ORF)
reads <- GRanges("1", IRanges(c(25, 35), c(25, 35)), "+")
# grl must have same names as cds + _1 etc, so that they can be matched.
entropy(grl, reads)
# or on cds
cdsORF <- GRanges("1", IRanges(35, 44), "+", names = "tx1")
names(cdsORF) <- "tx1"
cds <- GRangesList(tx1 = cdsORF)
entropy(cds, reads)