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 numeric/integer vector or metacolumn name. (default: 1L, no differential weighting). If weight is name of defined meta column in reads object, it gives the number of times a read was found at that position. GRanges("chr1", 1, "+", score = 5), would mean "score" column tells that this alignment region was found 5 times. if 1L it means each read is weighted equal as 1, this is what among others countOverlaps() presumes, if single number (!= 1), it repeats for all ranges, if vector with length > 1, it must be equal size of the reads object. |
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.