% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/functions_single_cell.R
\name{match_cells2}
\alias{match_cells2}
\title{Find pairs of cells that are close in tSNE space}
\usage{
match_cells2(test_groups = NULL, cell_subset = NULL,
  cell_metadata = cell_data, swap_groups = F)
}
\arguments{
\item{test_groups}{string; type of cell to pair cell to}

\item{cell_subset}{character vector; cell barcodes of cells to consider pairing, e.g. only cells with a certian component score >2}

\item{cell_metadata}{data.table with columns cell, Tsne1_QC1, Tsne2_QC2, and components V1, V2 etc.}

\item{swap_groups}{logical; control cells and test_group cells are swapped.
As this is a greedy algorithm, it can be better to swap the groups when there are few control cells}
}
\value{

}
\description{
Find pairs of cells that are close in tSNE space
}
\details{
For a given cell type, find the closest cells of a different type. e.g. find pairs of wt and Hormad1 mutatnt cells close together on tSNE.
This is useful for performing differentiall expression analysis whilst accounting for developmental stage of cells
The default control cells are genetically WT cells (WT,mj,SPG,SPD,SPCII,SPCI)
}
