% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/gspace-coercion.R
\name{as.GraphSpace}
\alias{as.GraphSpace}
\alias{as.GraphSpace.default}
\alias{as.GraphSpace.igraph}
\alias{as.GraphSpace.tbl_graph}
\alias{as.GraphSpace.data.frame}
\alias{as.GraphSpace.Seurat}
\title{Convert objects to GraphSpace}
\usage{
as.GraphSpace(x, ...)

\method{as.GraphSpace}{default}(x, ...)

\method{as.GraphSpace}{igraph}(x, ...)

\method{as.GraphSpace}{tbl_graph}(x, ...)

\method{as.GraphSpace}{data.frame}(x, ...)

\method{as.GraphSpace}{Seurat}(x, space = c("embedding", "spatial"), layer = NULL, ...)
}
\arguments{
\item{x}{An object to be converted.}

\item{...}{Additional arguments passed to methods associated with the
selected \code{space}.}

\item{space}{Character specifying the coordinate space used for node
geometry. Either \code{"embedding"} or \code{"spatial"}. See details.}

\item{layer}{Name of the layer from which node data should be retrieved
(see \code{\link[SeuratObject]{LayerData}}).}
}
\value{
A \code{GraphSpace} object.
}
\description{
S3 generic function for coercing objects into a \code{GraphSpace} object.
}
\details{
Unified entry point for converting graph, spatial, and high-dimensional
data into a \code{GraphSpace} object.

Graph objects are imported either through native methods or via
\link[tidygraph]{as_tbl_graph} when available.

For \strong{Seurat} objects, coordinate extraction depends on the
selected \code{space}:
\itemize{
\item \code{space = "embedding"} uses the first two dimensions returned by
\code{\link[SeuratObject]{Embeddings}}.

\item \code{space = "spatial"} uses tissue coordinates returned by
\code{\link[SeuratObject]{GetTissueCoordinates}}.
}

Assay data are stored in the \code{data} slot of the resulting
\code{GraphSpace} object. Node metadata from \code{x@meta.data} are
appended to the node table.
}
\seealso{
\code{\linkS4class{GraphSpace}}
}
