% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/dtu_analysis.R
\name{combine_to_matrix}
\alias{combine_to_matrix}
\title{Combine sparse matrices.}
\usage{
combine_to_matrix(
  tx_list,
  cell_extensions = NULL,
  cell_extension_side = "append",
  seurat_obj = NULL,
  tx2gene = NULL,
  assay_name = "dtutx"
)
}
\arguments{
\item{tx_list}{List of sparse count matrices, as returned by \code{\link[=import_counts]{import_counts()}} or \code{\link[=import_dge_counts]{import_dge_counts()}} for single-cell data.}

\item{cell_extensions}{Optional vector of cellname extensions that are added to the cellnames of the samples. The original cellnames and the extension are separated by an underscore '_'. Defaults to an increasing integer per sample.}

\item{cell_extension_side}{Define to which side of the barcode the cell extensions shall be added ('append' or 'prepend').}

\item{seurat_obj}{Optional seurat object, where the combined matrix is added as an assay. This has the advantage, that the cells are matched and subsetted if necessary. Currently only Seurat 3 objects are supported.}

\item{tx2gene}{Optional tx2gene or metadata data frame, can only be used in conjunction with a seurat object. Metadata is added as feature-level meta data to the created assay. The first column of the data frame must contain transcript names/ids. The same transcript names/ids as in the \code{tx_list} objects must be used.}

\item{assay_name}{If the combined matrix should be added to an existing Seurat object, the name of the assay can be specified here.}
}
\value{
Either a combined sparse count matrix or a seurat object which the combined sparse count matrix as an assay.
}
\description{
Combine list of sparse count matrices. Presumably coming from \code{\link[=import_counts]{import_counts()}} or \code{\link[=import_dge_counts]{import_dge_counts()}} in conjunction with single-cell data.
}
\details{
This function adds a cellname extension if necessary.
Can optionally add the combined matrix to a existing Seurat object (keeping the cellname extension of the object and matching the cells).
Also removes overall non expressed features.
}
\seealso{
Other DTUrtle DTU: 
\code{\link{import_counts}()},
\code{\link{posthoc_and_stager}()},
\code{\link{priming_bias_detection_probability}()},
\code{\link{run_drimseq}()}
}
\concept{DTUrtle DTU}
