% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/coverage_helpers.R
\name{windowPerReadLength}
\alias{windowPerReadLength}
\title{Find proportion of reads per position in window}
\usage{
windowPerReadLength(grl, tx = NULL, reads, pShifted = TRUE,
  upstream = if (pShifted) 5 else 20, downstream = if (pShifted) 20
  else 5, acceptedLengths = NULL, zeroPosition = upstream,
  scoring = "transcriptNormalized")
}
\arguments{
\item{grl}{a \code{\link{GRangesList}} object
with usually either leaders, cds', 3' utrs or ORFs}

\item{tx}{default NULL, a GRangesList of transcripts or (container region),
names of tx must contain all grl names. The names of grl can also be the
ORFik orf names. that is "txName_id"}

\item{reads}{any type of reads, usualy ribo seq. As GAlignment, GRanges
or GRangesList object.}

\item{pShifted}{a logical (TRUE), are riboseq reads p-shifted to size
1 width reads? If upstream and downstream is set, this argument is
irrelevant.}

\item{upstream}{an integer (5), relative region to get upstream from.}

\item{downstream}{an integer (20), relative region to get downstream from}

\item{acceptedLengths}{an integer vector (NULL), the read lengths accepted.
Default NULL, means all lengths accepted.}

\item{zeroPosition}{an integer DEFAULT (upstream), the point if all windows
are equal size, that should be set to position 0. Like leaders and
cds combination, then 0 is the TIS and -1 is last base in leader. NOTE!:
if windows have different widths, this will be ignored.}

\item{scoring}{a character (transcriptNormalized), one of
(zscore, transcriptNormalized, mean, median, sum, sumLength, fracPos),
see ?coverageScorings. Use to choose meta coverage or per transcript.}
}
\value{
a data.frame with lengths by coverage / vector of proportions
}
\description{
This is like a more detailed floss score, where floss score takes fraction
of reads per read length over whole window, this is defined as:
Fraction of reads  per read length, per position in whole window (by
upstream and downstream)
}
\details{
If tx is not NULL, it gives a metaWindow, centered around startSite of
grl from upstream and downstream. If tx is NULL, it will use only downstream
, since it has no reference from to find upstream from. Unless upstream is
negative, that is, going downstream.
}
\seealso{
Other coverage: \code{\link{coverageScorings}},
  \code{\link{metaWindow}},
  \code{\link{scaledWindowPositions}}
}
\concept{coverage}
