Train model

GSG.GSG_train

GSG_train is a function to train the generative self-supervised graph learning model. The inputs of this function are the anndata object returned by the GSG.Graph_10X function, including the dgl object, and the args object which saves the training parameters of the model, using this function to train the model using the gene expression information and spatial location information in the spatial transcriptome, and saving the feature embedding obtained from the training in the anndata object, and the results returned by the function are anndata object and the generative self-supervised graph learning model saved by training.

Parameters

adata: anndata
       Spatial transcriptome data.

graph: dgl object
       The neighbor structure of the graph with spatial information.

args: argparse
      The arguments of constructing graph. 

Returns

adata: anndata
       Spatial transcriptome data, and feature embedding is stored in adata.obsm['GSG_embedding'].

model: Generative self-supervised graph learning model.