zhengjh39 / HiC-SGL

GNU General Public License v3.0
3 stars 0 forks source link

HiC-SGL

Subgraph decomposition and graph representation learning for single cell Hi-C imputation and clustering.

model

The structure of the HiC-SGL model. It consists of an encoder and a decoder. The encoder extracts the local feature of each edge and the global feature of the cell graph. The decoder estimates the likelihood of each edge being present in the cell map using the encoded feature.

requirements

Data Process

required data

scHiC dataset:“data.txt" is a table file, which needs to contain attributes::

"label_info.pickle": file, the attribute "cell type" records the category corresponding to the cell id

”config.JSON”: The configuration file of the dataset, including properties:

dataprocess

python HicProcess.py --dir [dir]

Get cell map (torch_geomertic.data), save in dir/cellgraph directory;cell feature(torch.tensor), save in dir/cellatr directory

Pretrain[option]

python pretrain.py --cuda [cuda] --dir [dir]

Get the pre-training weight, save it in the /GCLweight directory

Train

python train.py --cuda [cuda] --dir[dir] [--pre]

If --pre is included, the model uses pre-trained weights, otherwise it does not

Get the trained model parameters and save them in the dir/weight directory

utils

The utils module implements some methods for conveniently obtaining data, models, calling models for cell imputation, and obtaining cell embedding.

function description args return
get_cells obtain cell map and cell features data_dir(str): data directory path; c (int) chromosome number cellgraph(list[torch_geometric.data]), cell feature(tensor)
get_model obtain model data_dir(str): data directory path; c (int) chromosome number; state(str)( 'init', 'pretrained', 'trained'); device(str):model device model (torch.nn.Module)
get_cell_embed Get trained cell embeddings data_dir(str): data directory path cell embed (numpy.array)
impute_cell impute cell raw_cell(list[torch_geometric.data]:raw cell, model(torch.nn.Module): model imputed cell(torch.tensor)

Contact

Please contact zhengjh39@mail2.sysu.edu.cn