View source: R/riboseq_features.R
entropy | R Documentation |
Calculates percentage of maximum entropy of the 'reads'
coverage over each ORF in 'grl' group.
The entropy value per group is a real number in the interval (0:1),
where 0 indicates no variance in reads over all codons of group
For example c(0,0,0,0) has 0 entropy, since no reads overlap.
Interval: [0]: No reads or all reads in 1 place
Interval: [0.01-0.99]: >= 2 positions covered
Interval: [1]: all positions covered perfectly in frame
entropy(grl, reads, weight = 1L, is.sorted = FALSE, overlapGrl = NULL)
grl |
a |
reads |
a |
weight |
a vector (default: 1L, if 1L it is identical to countOverlaps()), if single number (!= 1), it applies for all, if more than one must be equal size of 'reads'. else it must be the string name of a defined meta column in subject "reads", that gives number of times a read was found. GRanges("chr1", 1, "+", score = 5), would mean "score" column tells that this alignment region was found 5 times. |
is.sorted |
logical (FALSE), is grl sorted. That is + strand groups in increasing ranges (1,2,3), and - strand groups in decreasing ranges (3,2,1) |
overlapGrl |
an integer, (default: NULL), if defined must be countOverlaps(grl, RFP), added for speed if you already have it |
A numeric vector containing one entropy value per element in 'grl'
Other features:
computeFeatures()
,
computeFeaturesCage()
,
countOverlapsW()
,
disengagementScore()
,
distToCds()
,
distToTSS()
,
floss()
,
fpkm()
,
fpkm_calc()
,
fractionLength()
,
initiationScore()
,
insideOutsideORF()
,
isInFrame()
,
isOverlapping()
,
kozakSequenceScore()
,
orfScore()
,
rankOrder()
,
ribosomeReleaseScore()
,
ribosomeStallingScore()
,
startRegion()
,
startRegionCoverage()
,
stopRegion()
,
subsetCoverage()
,
translationalEff()
# a toy example with ribo-seq p-shifted reads
ORF <- GRangesList(tx1 = GRanges("1", IRanges(1, width = 9), "+"))
entropy(ORF, GRanges()) # 0
entropy(ORF, GRanges("1", IRanges(c(1)), "+")) # 0
entropy(ORF, GRanges("1", IRanges(c(1,4,6,7)), "+")) # 0.94
entropy(ORF, GRanges("1", IRanges(c(1,4,7)), "+", score = c(1,2,1)),
weight = "score") # 0.94
entropy(ORF, GRanges("1", IRanges(c(1,4,7)), "+")) # Perfect = 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.