% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/riboseq_features.R
\name{insideOutsideORF}
\alias{insideOutsideORF}
\title{Inside/Outside score (IO)}
\usage{
insideOutsideORF(grl, RFP, GtfOrTx, ds = NULL, RFP.sorted = FALSE)
}
\arguments{
\item{grl}{a \code{\link{GRangesList}} object
with usually either leaders, cds', 3' utrs or ORFs}

\item{RFP}{ribo seq reads as GAlignment, GRanges or GRangesList object}

\item{GtfOrTx}{if Gtf: a TxDb object of a gtf file that transcripts will be
extracted with `exonsBy(Gtf, by = "tx", use.names = TRUE)`, if
a GrangesList will use as is}

\item{ds}{numeric vector (NULL), disengagement score. If you have already
calculated \code{\link{disengagementScore}}, input here to save time.}

\item{RFP.sorted}{logical (F), have you ran this line:
\code{RFP <- sort(RFP[countOverlaps(RFP, tx, type = "within") > 0])}
Normally not touched, for internal optimization purposes.}
}
\value{
a named vector of numeric values of scores
}
\description{
Inside/Outside score is defined as
\preformatted{(reads over ORF)/(reads outside ORF and within transcript)}
A pseudo-count of one is added to both the ORF and outside sums.
}
\examples{
# Check inside outside score of a ORF within a transcript
ORF <- GRanges("1",
               ranges = IRanges(start = c(20, 30, 40),
                                  end = c(25, 35, 45)),
               strand = "+")

grl <- GRangesList(tx1_1 = ORF)

tx1 <- GRanges(seqnames = "1",
               ranges = IRanges(start = c(1, 10, 20, 30, 40, 50),
                                end = c(5, 15, 25, 35, 45, 200)),
               strand = "+")
tx <- GRangesList(tx1 = tx1)
RFP <- GRanges(seqnames = "1",
                  ranges = IRanges(start = c(1, 4, 30, 60, 80, 90),
                                   end = c(30, 33, 63, 90, 110, 120)),
                  strand = "+")

insideOutsideORF(grl, RFP, tx)

}
\references{
doi: 10.1242/dev.098345
}
\seealso{
Other features: \code{\link{computeFeaturesCage}},
  \code{\link{computeFeatures}},
  \code{\link{disengagementScore}},
  \code{\link{distToCds}}, \code{\link{distToTSS}},
  \code{\link{entropy}}, \code{\link{floss}},
  \code{\link{fpkm_calc}}, \code{\link{fpkm}},
  \code{\link{fractionLength}},
  \code{\link{initiationScore}}, \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}
