% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/simcounts.R
\name{simcounts}
\alias{simcounts}
\title{Simulate counts from a simple experiment (paired or unpaired) using
Poisson or negative binomial distributions.}
\usage{
simcounts(
  n_genes = 10,
  n_samples = 16,
  beta_0 = 1,
  sigma_0 = 0.5,
  beta_1 = 1,
  sigma_1 = 0.5,
  b_0 = 0.5,
  clusters = 8,
  sample_sd = 0.5,
  overdispersion_min_max = c(1, 10),
  seed = 123
)
}
\arguments{
\item{n_genes}{Number of genes to simulate.}

\item{n_samples}{Number of samples to simulate.}

\item{beta_0}{Gene intercepts.}

\item{sigma_0}{SD of gene intercepts}

\item{beta_1}{Gene slopes.}

\item{sigma_1}{SD of gene slopes}

\item{b_0}{Cluster-specific intercept. If NULL, non-paired data is simulated.}

\item{clusters}{Number of clusters. If NULL, non-paired data is simulated.}

\item{sample_sd}{SD of sample-specific effects.}

\item{overdispersion_min_max}{Range of overdispersion parameter. If NULL,
the Poisson distribution is used to simulate data.}

\item{seed}{Random seed for reproducibility.}
}
\value{
A list with three elements: \code{data}, a data frame of simulated
counts with one row per gene and one column per sample (first column
identifies the gene); \code{parameters}, a data frame of true gene-wise
coefficients and overdispersion values; and \code{metadata}, a data frame of
sample-level covariates (\code{sample}, \code{cluster}, \code{x}).
}
\description{
This function is used for internal testing and tutorials.
}
\examples{
# Simulate n targets from the negative binomial distribution
dat <- simcounts(n_genes = 10,
                 overdispersion_min_max = c(1, 5))

# Simulate n targets from the Poisson distribution
dat <- simcounts(n_genes = 10,
                 overdispersion_min_max = NULL)


# Data are organized in counts
dat$data
# .. and meta data
dat$metadata

}
