% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dtu_analysis.R
\name{priming_bias_detection_probability}
\alias{priming_bias_detection_probability}
\title{Estimate transcript detection probability}
\usage{
priming_bias_detection_probability(
  counts,
  gtf,
  tx2gene,
  one_to_one = NULL,
  priming_enrichment = "3",
  genes = NULL,
  add_to_table = NULL,
  BPPARAM = BiocParallel::SerialParam()
)
}
\arguments{
\item{counts}{A (sparse) count matrix, where columns represent a sample / cell and rows represent a single transcript isoform. This data is used to infer each gene's reference transcript.}

\item{gtf}{A GTF file with gene and exon-level information. Can be a filepath or a previously imported gtf file (as GRanges or data frame). It is advised to read-in the file like this: \code{gtf <- import_gtf("YOUR_PATH", feature_type = NULL, out_df=FALSE)}.}

\item{tx2gene}{Data frame, where the first column consists of feature identifiers and the second column consists of corresponding gene identifiers. Feature identifiers must match with the rownames of the counts object.}

\item{one_to_one}{Specify \code{TRUE}, if one_to_one mapping of gene/transcript identifiers with their respective names was enforced before (with \code{\link[=one_to_one_mapping]{one_to_one_mapping()}}). If a non default extension character (\code{ext}) has been used, please specify the used extension character.}

\item{priming_enrichment}{Specify, which end of the mRNA is supposed to be enriched in your (single-cell) RNA-seq protocol. Can be either '3' or '5', for the 3'-end or the 5'-end respectively.}

\item{genes}{(Optional) Specify certain genes, that shall be analysed. If \code{NULL}, defaults to all genes in the provided tx2gene data frame.}

\item{add_to_table}{(Optional) add the \code{detection_probability} and \code{used_as_ref} column directly to the here provided data frame. First column of the data frame must match with transcript identifiers.}

\item{BPPARAM}{If multicore processing should be used, specify a \code{BiocParallelParam} object here. Among others, can be \code{SerialParam()} (default) for non-multicore processing or \code{MulticoreParam('number_cores')} for multicore processing. See \code{\link[BiocParallel:BiocParallel-package]{BiocParallel}} for more information.}
}
\value{
A data frame with the columns:
\itemize{
\item \code{gene}: A gene identifier.
\item \code{tx}: A transcript identifier.
\item \code{detection_probability}: The calculated detection probability score.
\item \code{used_as_ref}: Boolean vector, indicating which transcripts were used as reference transcript for the specific gene.
}

If a valid data frame in \code{add_to_table} is provided, this data frame is returned with the added \code{detection_probability} and \code{used_as_ref} column.
}
\description{
Estimate transcript detection probability for 3'- or 5'-biased data
}
\details{
Many (single-cell) RNA-seq protocols do not produce reads from the full-length of the mRNA, but instead favor fragments of the 3' or 5' end of the mRNA.
Such protocols limit the ability to detect DTU events for specific transcripts, e.g. for transcripts of the same gene, where the first exon-level difference is close to the non-favoured priming end.
This function tries to estimate, which transcripts might not pop up in a DTU analysis, because of this effect.

First, this function sets the major proportionally expressed transcript as the reference transcript for that specific gene.
If no count information are availble, the first transcript is chosen as reference.

Then, for each other transcript of that gene, the first exon-level difference compared to the reference transcript is detected and a probability score is calculated
based on the exonic distance between that difference and the favoured priming end.

The probability score ranges from 0 to 1, where 1 indicates no influence by the prime-biased protocol, and 0 indicates an extreme heavy influence.
Thus, DTU effects for transcripts with a low score are less likely to be detectable with the given data.
}
\seealso{
Other DTUrtle DTU: 
\code{\link{combine_to_matrix}()},
\code{\link{import_counts}()},
\code{\link{posthoc_and_stager}()},
\code{\link{run_drimseq}()}
}
\concept{DTUrtle DTU}
