Skip to main content

stTransfer

python >= 3.8

Installation

conda create -n stTranfer python=3.8
conda activate stTranfer
conda activate zt_stTransfer_2
conda install anaconda::h5py # if h5py install error
pip install torch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117

# install for cuda manylinux2014_aarch64
pip install torch-cluster==1.6.1 -f https://pytorch-geometric.com/whl/torch-1.13.1%2Bcu117.html
pip install torch-scatter==2.1.1 -f https://pytorch-geometric.com/whl/torch-1.13.1%2Bcu117.html
pip install torch-sparse==0.6.17 -f https://pytorch-geometric.com/whl/torch-1.13.1%2Bcu117.html
pip install torch-spline-conv==1.2.2 -f https://pytorch-geometric.com/whl/torch-1.13.1%2Bcu117.html
pip install pyg-lib==0.2.0 -f https://pytorch-geometric.com/whl/torch-1.13.1%2Bcu117.html
pip install torch-geometric

# install for cuda linux_x86_64
pip install torch-cluster==1.6.1+pt113cu117 -f https://pytorch-geometric.com/whl/torch-1.13.1%2Bcu117.html
pip install torch-scatter==2.1.1+pt113cu117 -f https://pytorch-geometric.com/whl/torch-1.13.1%2Bcu117.html
pip install torch-sparse==0.6.17+pt113cu117 -f https://pytorch-geometric.com/whl/torch-1.13.1%2Bcu117.html
pip install torch-spline-conv==1.2.2+pt113cu117 -f https://pytorch-geometric.com/whl/torch-1.13.1%2Bcu117.html
pip install pyg-lib==0.2.0+pt113cu117 -f https://pytorch-geometric.com/whl/torch-1.13.1%2Bcu117.html
pip install torch-geometric

# if jaxlib error if you need
conda install jaxlib

pip install git+https://github.com/zEpoch/stTransfer
# need to install again
pip install torch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117

# fix error you may need
pip install flax==0.7.2 
pip install pyro-ppl==1.8.6
pip install optax==0.1.7

And for my mechine, I need to install the following packages:

pip install wheel
git config --global url."https://mirror.ghproxy.com/https://github.com".insteadOf "https://github.com" 
pip install torch-cluster==1.6.1+pt113cu117 -f https://pytorch-geometric.com/whl/torch-1.13.1%2Bcu117.html
pip install torch-scatter==2.1.1+pt113cu117 -f https://pytorch-geometric.com/whl/torch-1.13.1%2Bcu117.html
pip install torch-sparse==0.6.17+pt113cu117 -f https://pytorch-geometric.com/whl/torch-1.13.1%2Bcu117.html
pip install torch-spline-conv==1.2.2+pt113cu117 -f https://pytorch-geometric.com/whl/torch-1.13.1%2Bcu117.html
pip install torch-geometric
git config --global url."https://mirror.ghproxy.com/https://github.com".insteadOf "https://github.com"
pip install git+https://github.com/zEpoch/stTransfer
pip install torch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117
pip install flax==0.7.2 
pip install pyro-ppl==1.8.6
pip install optax==0.1.7
from stTransfer import transfer

kwargs = {
    'sc_adata_path': '/data/work/sttransfer/stereoseq/script/adata.scvi.leiden.anno.h5ad',
    'sp_adata_path': '/data/work/sttransfer/cellbin_adatas/A01890F2_ot_left.h5ad',
    'sc_anno': 'anno',
    'sp_anno': 'annotation',
    'name': 'A01890F2_ot_left',
    'save_path': '/data/work/sttransfer/stereoseq/Result_3/',
    'sp_filter': True,
    'k_n_fold': 3, # for xgboost train
    'st_spatial_anno': 'spatial', # in the obsm
    'finetune_epochs': 50,
    'finutune_pca_dim': 0,
    'gpu': 0,
    'finutune_w_cls': 10,
    'finutune_w_gae': 1,
    'finutune_w_dae': 1,
'KD_T': 1,
'marker_genes':None
}
transfer(**kwargs)

import anndata as ad
adata = ad.read('/data/work/sttransfer/stereoseq/Result_3/spd_filtered.h5ad')
import pandas as pd
csv = pd.read_csv('/data/work/sttransfer/stereoseq/Result_3/celltype_label.h5ad')
csv.lolumns = ['0']
adata.obs['celltype'] = csv['0']

Metadata

Release files for stTransfer 1.0.25

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stTransfer 1.0.25
File Size Uploaded
sttransfer-1.0.25.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stTransfer 1.0.25
File Interpreter ABI Platform
stTransfer-1.0.25-py3-none-any.whl Python 3 none any Details

Total release size: 25.4 kB

Release files / sttransfer-1.0.25.tar.gz

Download URL sttransfer-1.0.25.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5152d04e958e32229eaeef328f64a9ef94afb8a290fb53f30d42aa9c3e3e6b2e
BLAKE2b-256 checksum
How to use checksums
f743cfbc5d6fc36e2669fe57d136493723bf33e89c45e3d2ec57da63668aecb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.18

Release files / stTransfer-1.0.25-py3-none-any.whl

Download URL stTransfer-1.0.25-py3-none-any.whl
Size 21.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5a14a06a76a0a68138d305f454581c9edb42010f0f4684e64028d9261b73ca73
BLAKE2b-256 checksum
How to use checksums
7fc36010b6b885fe07cb0d6c4b3005de3ecf0e082eefe92af45ebcce6c314a5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.18

Release history Release notifications | RSS feed

This release

1.0.25 This release

2 release files

1.0.15

2 release files

1.0.14

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.11

2 release files

1.0.9

2 release files

1.0.8

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page