% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/panoramic-visualization.R
\name{plot_volcano}
\alias{plot_volcano}
\title{Volcano plot for differential spatial colocalization}
\usage{
plot_volcano(
  se_diff,
  sig_col = c("fdr_diff", "p_diff"),
  alpha = 0.05,
  x_scale = c("beta_diff", "log2fc"),
  label_top = 12L,
  label_text_pt = 4,
  p_floor = 1e-300,
  title = NULL
)
}
\arguments{
\item{se_diff}{A \code{SummarizedExperiment} with contrast columns in
\code{rowData(se_diff)} (at least \code{ct1}, \code{ct2},
\code{beta_diff}, \code{p_diff}; and \code{fdr_diff} when
\code{sig_col = "fdr_diff"}).}

\item{sig_col}{Character, one of \code{"fdr_diff"} or \code{"p_diff"}.
Controls which column determines significance coloring.}

\item{alpha}{Numeric threshold for significance based on \code{sig_col}.}

\item{x_scale}{Character, one of \code{"beta_diff"} or \code{"log2fc"}.
\code{"log2fc"} uses \code{sign(beta_diff) * log2(1 + abs(beta_diff))}.}

\item{label_top}{Integer number of significant hits to label. Use
\code{NULL} or \code{0} to disable labels.}

\item{label_text_pt}{Numeric font size (points) for significant-hit labels.}

\item{p_floor}{Numeric floor applied to \code{p_diff} before
\code{-log10()}.}

\item{title}{Optional character title.}
}
\value{
A \code{ggplot} object.
}
\description{
Updated volcano helper based on the CRC TMA manuscript workflow.
It uses \code{beta_diff} for the x-axis and \code{-log10(p_diff)} for
the y-axis, and colors points by significance direction.
}
\examples{
se_diff <- SummarizedExperiment::SummarizedExperiment(
  assays = list(dummy = matrix(0, nrow = 2, ncol = 1)),
  rowData = S4Vectors::DataFrame(
    ct1 = c("A", "A"),
    ct2 = c("B", "C"),
    radius_um = c(10, 10),
    beta_diff = c(0.4, -0.3),
    p_diff = c(0.01, 0.20),
    fdr_diff = c(0.02, 0.30)
  )
)
m <- S4Vectors::metadata(se_diff)
m$panoramic <- list(contrast = list(control = "control", case = "case"))
S4Vectors::metadata(se_diff) <- m
plot_volcano(se_diff, sig_col = "fdr_diff")
}
