Graph construction

GSG.Data_read_and_comb

GSG.Data_read_and_comb is a function to read the two different files in the specified folder, merge them and return the merged anndata object for subsequent operations.

The input parameters of this function are the args object and the min_cell, the args object holds various training parameters, and min_cell is the minimum number of cells expressed required for a gene to pass filtering.The anndata object holds the gene expression information of the spatial transcriptome data as well as the spatial location of each captured point.This function is used to integrate two spatial transcriptome data to remove batch effects. The sample names of the two spatial transcriptome data are stored in the input args of the function, which reads the two data separately, and then merges the anndata objects read separately into one anndata object and returns it.

Parameters

args: argparse
      The arguments of data path, which includes two data.
min_cell: int (default: 5)
       Minimum number of cells expressed required for a gene to pass filtering.

Returns

adatas: anndata
       Spatial transcriptome data including two different data.

GSG.Graph_Get_And_Data_Charge

GSG.Graph_Get_And_Data_Charge is a function to construct the neighbor structure of the graph using spatial information with the anndata object which returns from the function GSG.Data_read_and_comb.

The input parameters of this function are the anndata object and the args object, the anndata object is the merged 10X spatial transcriptome data, and the args object holds various training parameters. The anndata object holds the gene expression information of the two spatial transcriptome data as well as the spatial location of each captured point, and by using this method we use the spatial information of the points to construct the neighbor-joining map used in the subsequent model training and save the constructed graph in the dgl object. In addition, this function performs preprocessing operations on the spatial transcriptome data, including removing genes with low expression, normalizing the gene expression, and downscaling the data, and saves the gene expression after preprocessing in the dgl object as well.The return values of the function are the preprocessed and merged anndata object and dgl objects from the merged data.

Parameters

adatas: anndata
       Spatial transcriptome data.

args: argparse
      The arguments of constructing graph. 

Returns

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

two_adata: anndata
       Two spatial transcriptome data.