% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plotIntegration.R
\name{plotIntegration}
\alias{plotIntegration}
\title{Joint Biplot of Multi-Omics Integration Results}
\usage{
plotIntegration(
  result,
  comp = c(1L, 2L),
  outcome = NULL,
  show_loadings = TRUE,
  n_loading_arrows = 5L,
  point_size = 2.5,
  point_alpha = 0.8,
  colours = NULL
)
}
\arguments{
\item{result}{A \code{\link{MOBResult}} object from
\code{\link{MultiOmicsBridgeAnalysis}}.}

\item{comp}{A length-2 \code{integer} vector specifying which two
components to plot. Default: \code{c(1, 2)}.}

\item{outcome}{A \code{character} or \code{factor} vector of outcome
labels (one per sample), used for point colouring. If \code{NULL},
points are plotted in a single colour.}

\item{show_loadings}{Logical. If \code{TRUE}, overlay the top feature
loading vectors as arrows. Default: \code{TRUE}.}

\item{n_loading_arrows}{An \code{integer(1)} number of top loading
arrows to display per omics layer. Default: \code{5}.}

\item{point_size}{A \code{numeric(1)} point size. Default: \code{2.5}.}

\item{point_alpha}{A \code{numeric(1)} point transparency. Default:
\code{0.8}.}

\item{colours}{A named \code{character} vector of colours for the
outcome groups. If \code{NULL}, a default palette is used.}
}
\value{
A \code{ggplot2} object.
}
\description{
Produces a scatter plot of integrated sample scores in the space
defined by two DIABLO latent components, with samples coloured by
outcome group and optional feature loading vectors overlaid as arrows.
This biplot makes it immediately clear how well the multi-omics
integration separates the outcome groups and which features drive
that separation.
}
\examples{
library(S4Vectors)
scores <- matrix(rnorm(40), nrow = 20, ncol = 2,
    dimnames = list(paste0("S", 1:20), c("Comp1","Comp2")))
fl <- list(
    host = matrix(rnorm(20), nrow = 10, ncol = 2,
        dimnames = list(paste0("G", 1:10), c("Comp1","Comp2"))),
    microbiome = matrix(rnorm(10), nrow = 5, ncol = 2,
        dimnames = list(paste0("T", 1:5), c("Comp1","Comp2")))
)
bm <- DataFrame(feature = c("G1","T1"), omics_layer = c("host","microbiome"),
                loading_score = c(0.8,0.6), rank = c(1L,2L), component = c(1L,1L))
obj <- MOBResult(scores, fl, bm, list(),
                 params = list(outcome_levels = c("ctrl","treat")))
outcome <- rep(c("ctrl","treat"), each = 10)
plotIntegration(obj, outcome = outcome)

}
\seealso{
\code{\link{MultiOmicsBridgeAnalysis}}, \code{\link{MOBResult}},
  \code{\link{plotClassifierComparison}}
}
