% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/riboseq_features.R
\name{entropy}
\alias{entropy}
\title{Calucalte entropy value of overlapping input reads per GRanges.}
\usage{
entropy(grl, reads)
}
\arguments{
\item{grl}{a \code{\link{GRangesList}} that the reads will
be overlapped with}

\item{reads}{a GAlignment, GRanges or GRangesList object,
usually of RiboSeq, RnaSeq, CageSeq, etc.}
}
\value{
A numeric vector containing one entropy value per element in
`grl`
}
\description{
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.
}
\examples{
# 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)

}
\seealso{
Other features: \code{\link{computeFeaturesCage}},
  \code{\link{computeFeatures}},
  \code{\link{disengagementScore}},
  \code{\link{distToCds}}, \code{\link{distToTSS}},
  \code{\link{floss}}, \code{\link{fpkm_calc}},
  \code{\link{fpkm}}, \code{\link{fractionLength}},
  \code{\link{initiationScore}},
  \code{\link{insideOutsideORF}}, \code{\link{isInFrame}},
  \code{\link{isOverlapping}},
  \code{\link{kozakSequenceScore}}, \code{\link{orfScore}},
  \code{\link{rankOrder}},
  \code{\link{ribosomeReleaseScore}},
  \code{\link{ribosomeStallingScore}},
  \code{\link{startRegionCoverage}},
  \code{\link{startRegion}}, \code{\link{subsetCoverage}},
  \code{\link{translationalEff}}
}
\concept{features}
