Transfer learning for spatial transcriptomics data and single-cell RNA-seq data.
Project description
stTransfer
Installation
pip install stTransfer
import stTransfer as st
st.dnn_workflow(data_path = '/data/input/single.h5ad',
ann_key = 'celltype', # celltype in adata.obs
marker_genes=None, # marker genes list
batch_size=4096, # train batch size
epochs=200, # train epochs
gpu="0", # gpu id
model_name="dnn.bgi", # model name
model_path="/data/model", # model path
filter_mt=False, # filter mitochondrial genes or not
cell_min_counts=300, # min counts per cell
gene_min_cells=10, # min cells per gene
cell_max_counts=98.) # max counts per cell
st_adata = st.load_data(data_path = '/data/input/st_adata.h5ad', # obsm.['spatial'] is required
filter_mt=True,
min_cells=10,
min_counts=300,
max_percent=98.0) # load data
st_adata_with_pslabel = st.transfer_from_sc_data(adata = st_adata, # adata with obsm.['spatial']
dnn_path = '/data/model/dnn.bgi', # dnn model path
gpu="0")
st.distribution_fine_tune(st_adata_with_pslabel,
pca_dim=0,
k_graph=30,
edge_weight=True,
epochs=200,
w_cls=50,
w_dae=1.,
w_gae=1.,
gpu="0",
save_path="/data/output") # output path
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stTransfer-1.0.6.tar.gz
(10.4 kB
view hashes)
Built Distribution
stTransfer-1.0.6-py3-none-any.whl
(11.9 kB
view hashes)
Close
Hashes for stTransfer-1.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9f7d9b650a7044a428384dc4721296cff41b13d27c0c3f5125bd0e6eeea75f4 |
|
MD5 | 9ea6501171b18e1a0dc9c4b406ec26c4 |
|
BLAKE2b-256 | 2706fde291549f3f8a5aa0f6862b7093fb0a027721edb5a190c7434f4b810bee |