% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/CIBERSORT.R
\name{CIBERSORT}
\alias{CIBERSORT}
\title{CIBERSORT Deconvolution Algorithm}
\usage{
CIBERSORT(
  sig_matrix = NULL,
  mixture_file,
  perm,
  QN = TRUE,
  absolute = FALSE,
  abs_method = "sig.score",
  parallel = FALSE,
  num_cores = 2,
  seed = NULL
)
}
\arguments{
\item{sig_matrix}{Cell type GEP barcode matrix: row 1 = sample labels;
column 1 = gene symbols; no missing values; default = LM22.txt download
from CIBERSORT (https://cibersortx.stanford.edu/runcibersort.php)}

\item{mixture_file}{GEP matrix: row 1 = sample labels; column 1 = gene
symbols; no missing values}

\item{perm}{Set permutations for statistical analysis
(>=100 permutations recommended).}

\item{QN}{Quantile normalization of input mixture (default = TRUE)}

\item{absolute}{Run CIBERSORT in absolute mode (default = FALSE)
- note that cell subsets will be scaled by their absolute levels and
  will not be represented as fractions (to derive the default output,
  normalize absolute levels such that they sum to 1 for each mixture sample)
- the sum of all cell subsets in each mixture sample will be added to the
  output ('Absolute score'). If LM22 is used, this score will capture
  total immune content.}

\item{abs_method}{If absolute is set to TRUE, choose method:
'no.sumto1' or 'sig.score'
- sig.score = for each mixture sample, define S as the median expression
  level of all genes in the signature matrix divided by the median
  expression level of all genes in the mixture. Multiple cell subset
  fractions by S.
- no.sumto1 = remove sum to 1 constraint}

\item{parallel}{Logical. Enable parallel execution? (default = FALSE)}

\item{num_cores}{Integer. Number of cores to use when \code{parallel = TRUE}
(default = 2)}

\item{seed}{Integer. Random seed for reproducible permutation testing.
If \code{NULL} (default), uses current random state. Set to a specific
value (e.g., 123) for reproducible results across runs. Applies to both
parallel and serial permutation.}
}
\value{
A matrix object containing the estimated cibersort-cell fractions,
  p-values, correlation coefficients, and RMSE values.
}
\description{
An analytical tool to estimate cell type abundances in mixed cell populations
using gene expression data.
}
\examples{
# Simulate data
set.seed(123)
sim_sig <- matrix(rnorm(100 * 5), 100, 5)
rownames(sim_sig) <- paste0("Gene", 1:100)
colnames(sim_sig) <- paste0("Cell", 1:5)

sim_mixture <- as.data.frame(matrix(
  rnorm(100 * 3), 100, 3
))
rownames(sim_mixture) <- paste0("Gene", 1:100)
colnames(sim_mixture) <- paste0("Sample", 1:3)

# Run deconvolution
result <- CIBERSORT(
  sig_matrix = sim_sig,
  mixture_file = sim_mixture,
  perm = 10, QN = FALSE, absolute = FALSE,
  parallel = FALSE
)
if (!is.null(result)) head(result)
}
\author{
Aaron M. Newman, Stanford University (amnewman@stanford.edu)
}
