% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plots.R
\name{dfdr_plot_pep_density_by_decoy}
\alias{dfdr_plot_pep_density_by_decoy}
\title{Plot PEP density by decoy/target}
\usage{
dfdr_plot_pep_density_by_decoy(
  x,
  pep_max = 0.5,
  bw = "nrd0",
  adjust = 1,
  title = "PEP distribution (density): targets vs decoys"
)
}
\arguments{
\item{x}{A \code{dfdr_tbl} with a \code{pep} column.}

\item{pep_max}{Numeric. Maximum PEP displayed (default 0.5).}

\item{bw}{Bandwidth passed to \code{ggplot2::geom_density()}.}

\item{adjust}{Numeric smoothing adjustment passed to \code{geom_density()}.}

\item{title}{Character. Plot title.}
}
\value{
A \link[ggplot2:ggplot]{ggplot} object.
}
\description{
Plots density curves of PEP values for targets vs decoys, truncated to
\code{pep <= pep_max}.
}
\examples{
library(tibble)

set.seed(1)
n <- 4000
df <- tibble(
  id = as.character(seq_len(n)),
  run = "run1",
  is_decoy = sample(c(FALSE, TRUE), n, replace = TRUE, prob = c(0.95, 0.05)),
  score = rnorm(n),
  q = stats::runif(n, 0, 0.05),
  pep = stats::runif(n)
)
x <- as_dfdr_tbl(df, unit = "psm", scope = "global", q_source = "toy")
dfdr_plot_pep_density_by_decoy(x, pep_max = 0.5)

}
