% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/music2.R
\name{music2_prop}
\alias{music2_prop}
\title{MuSiC2_Deconvolution}
\usage{
music2_prop(
  bulk.control.mtx,
  bulk.case.mtx,
  sc.sce,
  clusters,
  samples,
  select.ct,
  expr_low = 20,
  prop_r = 0.1,
  eps_c = 0.05,
  eps_r = 0.01,
  n_resample = 20,
  sample_prop = 0.5,
  cutoff_expr = 0.05,
  cutoff_c = 0.05,
  cutoff_r = 0.01,
  maxiter = 200,
  markers = NULL,
  cell_size = NULL,
  ct.cov = FALSE,
  centered = FALSE,
  normalize = FALSE
)
}
\arguments{
\item{bulk.control.mtx}{Matrix of expression for bulk data, control group}

\item{bulk.case.mtx}{Matrix of expression for bulk data, case group}

\item{sc.sce}{SingleCellExperiment for single cell data}

\item{clusters}{character, the phenoData of single cell dataset used as clusters;}

\item{samples}{character, the phenoData of single cell dataset used as samples;}

\item{select.ct}{vector of cell types, default as NULL. If NULL, then use all cell types provided by the single cell dataset;}

\item{expr_low}{numeric, cutoff for defining lowly expressed genes in bulk data. Genes with mean expression across samples in bulk data < expr_low will be excluded from cell-type-specific DE gene detection. Default is 20;}

\item{prop_r}{numeric, cutoff for defining rare cell types. Cell types with mean proportion across samples in bulk data < prop_r will be characterized as rare cell types. Otherwise, will be characterized as common cell types. Default is 0.1;}

\item{eps_c}{numeric, convergence cutoff for common cell types. The cell type proportion estimate is converged if absolute relative change of proportion estimates for the current iteration against the previous iteration < eps_c. Default is 0.05;}

\item{eps_r}{numeric, convergence cutoff for rare cell types. The cell type proportion estimate is converged if absolute change of proportion estimates for the current iteration against the previous iteration < eps_r. Default is 0.01;}

\item{n_resample}{numeric, number of resamples used for detecting cell-type-specific DE genes. Default is 20;}

\item{sample_prop}{numeric, proportion of samples to be randomly sampled without replacement under each condition at each resampling. Default is 0.5;}

\item{cutoff_expr}{numeric, cutoff for defining lowly expressed genes over resamples. Genes with average cell-type-specific expression calculated over all resamples in the lower cutoff_expr quantile are excluded from cell-type-specific DE gene detection. Default is 0.05;}

\item{cutoff_c}{numeric, cutoff for defining cell-type-specific DE genes for common cell types. Genes with the value of statistic, defined as the absolute value of the ratio of the mean and standard deviation of the log fold change over all resamples, in the upper cutoff_c quantile are considered as cell-type-specific DE genes. Default is 0.05;}

\item{cutoff_r}{numeric, cutoff for defining cell-type-specific DE genes for rare cell types. Genes with the value of statistic, defined as the absolute value of the ratio of the mean and standard deviation of the log fold change over all resamples, in the upper cutoff_r quantile are considered as cell-type-specific DE genes. Default is 0.01;}

\item{maxiter}{numeric, maximum number of iterations. Default is 200;}

\item{markers}{vector or list of gene names. Default as NULL, i.e., use all genes that provided by both bulk and single cell datasets;}

\item{cell_size}{data.frame of cell sizes. 1st column contains the names of cell types, 2nd column has the cell sizes per cell type. Default as NULL. If NULL, then estimate cell size from data;}

\item{ct.cov}{logical. If TRUE, use the covariance across cell types;}

\item{centered}{logic, subtract avg of Y and D;}

\item{normalize}{logic, divide Y and D by their standard deviation;}
}
\value{
If MuSiC2 converges, return:
\itemize{
   \item {Est.prop: matrix, cell type proportion estimates.}
   \item {convergence: logical, whether MuSiC2 converged or not.}
   \item {n.iter: numeric, number of iterations.}
   \item {DE.genes: vector, cell-type-specific DE genes being removed.}
   }
 Or if MuSiC2 does not converge, return:
 \itemize{
   \item {Est.prop: matrix, cell type proportion estimates.}
   \item {convergence: logical, whether MuSiC2 converged or not.}
   \item {id.not.converge: vector, sample ids that failed to converge.}
   }
}
\description{
This function is used to deconvolve bulk RNA-seq data using single-cell reference generated under a different condition.
}
\seealso{
\code{\link{music_prop}}
}
