% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Convert.R
\name{H5SeuratToH5AD}
\alias{H5SeuratToH5AD}
\title{Convert h5Seurat files to H5AD files}
\usage{
H5SeuratToH5AD(
  source,
  dest,
  assay = DefaultAssay(object = source),
  overwrite = FALSE,
  verbose = TRUE
)
}
\arguments{
\item{source}{Source dataset}

\item{dest}{Name of destination dataset}

\item{assay}{Converting from \code{\link{h5Seurat}}: name of assay to write
out; converting to \code{\link{h5Seurat}}: name to store assay data as}

\item{overwrite}{Overwrite existing \code{dest}}

\item{verbose}{Show progress updates}
}
\value{
Returns a handle to \code{dest} as an \code{\link[hdf5r]{H5File}}
object
}
\description{
Convert h5Seurat files to H5AD files
}
\section{h5Seurat to AnnData/H5AD}{

The h5Seurat to AnnData/H5AD conversion will try to automatically fill in
datasets based on data presence. Data presense is determined by the h5Seurat
index (\code{source$index()}). It works in the following manner:
\subsection{Assay data}{
 \itemize{
  \item \code{X} will be filled with \code{scale.data} if \code{scale.data}
  is present; otherwise, it will be filled with \code{data}
  \item \code{var} will be filled with \code{meta.features} \strong{only} for
  the features present in \code{X}; for example, if \code{X} is filled with
  \code{scale.data}, then \code{var} will contain only features that have
  been scaled
  \item \code{raw.X} will be filled with \code{data} if \code{X} is filled
  with \code{scale.data}; otherwise, it will be filled with \code{counts}. If
  \code{counts} is not present, then \code{raw} will not be filled
  \item \code{raw.var} will be filled with \code{meta.features} with the
  features present in \code{raw.X}; if \code{raw.X} is not filled, then
  \code{raw.var} will not be filled
 }
}
\subsection{Cell-level metadata}{
 Cell-level metadata is added to \code{obs}
}
\subsection{Dimensional reduction information}{
 Only dimensional reductions associated with \code{assay} or marked as
 \link[Seurat:IsGlobal]{global} will be transfered to the H5AD file. For
 every reduction \code{reduc}:
 \itemize{
  \item cell embeddings are placed in \code{obsm} and renamed to
  \code{X_reduc}
  \item feature loadings, if present, are placed in \code{varm} and renamed
  to either \dQuote{PCs} if \code{reduc} is \dQuote{pca} otherwise
  \code{reduc} in all caps
 }
 For example, if \code{reduc} is \dQuote{ica}, then cell embeddings will be
 \dQuote{X_ica} in \code{obsm} and feature loaodings, if present, will be
 \dQuote{ICA} in \code{varm}
}
\subsection{Nearest-neighbor graphs}{
 If a nearest-neighbor graph is associated with \code{assay}, it will be
 added to \code{uns/neighbors/distances}; if more than one graph is present,
 then \strong{only} the last graph according to the index will be added.
}
\subsection{Layers}{
 Data from other assays can be added to \code{layers} if they have the same
 shape as \code{X} (same number of cells and features). To determine this,
 the shape of each alternate assays's \code{scale.data} and \code{data} slots
 are determined. If they are the same shape as \code{X}, then that slot
 (\code{scale.data} is given priority over \code{data}) will be added as a
 layer named the name of the assay (eg. \dQuote{SCT}). In addition, the
 features names will be added to \code{var} as \code{assay_features}
 (eg. \dQuote{SCT_features}).
}
}

\keyword{internal}
