% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AllGenerics.R, R/mergeClusters.R
\docType{methods}
\name{mergeClusters}
\alias{mergeClusters}
\alias{mergeClusters,daFrame-method}
\title{Manual cluster merging}
\usage{
mergeClusters(x, table, id)

\S4method{mergeClusters}{daFrame}(x, table, id)
}
\arguments{
\item{x}{a \code{\link{daFrame}}.}

\item{table}{the merging table; a \code{data.frame} with columns 
\code{'old_cluster'}, \code{'new_cluster'} and \code{'label'}.}

\item{id}{character string. Used as a label for the merging.}

\item{...}{optional arguments.}
}
\value{
Writes the newly assigend cluster codes into the metadata slot 
\code{cluster_codes} of the input \code{daFrame} and returns the latter.
}
\description{
\code{mergeClusters} provides a simple wrapper 
to store a manual merging inside the input \code{daFrame}.
}
\details{
in the following code snippets, \code{x} is a \code{daFrame} object.
\itemize{
\item{merging codes are accesible through \code{cluster_codes(x)$id}}
\item{all functions that ask for specification of a clustering 
  (e.g. \code{\link{plotAbundances}}, \code{\link{plotClusterHeatmap}})
  take the merging ID as a valid input argument.}}
}
\examples{
data(PBMC_fs, PBMC_panel, PBMC_md, merging_table)
re <- daFrame(PBMC_fs, PBMC_panel, PBMC_md)

# run clustering
lineage <- c("CD3", "CD45", "CD4", "CD20", "CD33", 
    "CD123", "CD14", "IgM", "HLA_DR", "CD7")
re <- cluster(re, cols_to_use=lineage)

# merge clusters
re <- mergeClusters(re, merging_table, "merging_1")
plotClusterHeatmap(re, k=20, m="merging_1", hm2="pNFkB")
}
\references{
Nowicka M, Krieg C, Weber LM et al. 
CyTOF workflow: Differential discovery in 
high-throughput high-dimensional cytometry datasets.
\emph{F1000Research} 2017, 6:748 (doi: 10.12688/f1000research.11622.1)
}
\author{
Helena Lucia Crowell \email{crowellh@student.ethz.ch}
}
