Skip to main content

STACCI for STCase

Project description

STACCI for STCase

Installation Instructions

  1. Clone the repository to your local machine and enter the repository in the command line interface.

  2. Use conda to create a new environment according to environment.yml

    conda env create -f environment.yml

    The purpose of this step is to install python, cudatoolkit and cudnn, where the versions of cudatoolkit and cudnn must correspond. The version in the .yml file is applicable to hosts with cuda ≥ 11.3. For servers with cuda lower than this version, consider upgrading cuda or finding the corresponding cudatoolkit version and cudnn version.

    Specifying the python version is to facilitate the next step to find the corresponding version of torch_geometric related packages.

  3. In the new environment, install the specified version of pytorch and torch_geometric related packages

    Don't forget to activate the env

    • First install pytorch related packages

    pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113

    The version of pytorch should be suitable for the version of cudatoolkit. The above command is from the pytorch official website and is the latest version that cuda 11.3 can install.

    Those with different cuda versions can find the appropriate command on this website.

    • Then install torch_geometric related packages

    There are five torch_geometric related packages: torch_spline_conv, torch_sparse, torch_scatter, torch_cluster, pyg_lib, of which pyg_lib should be installed last.

    The version of the above packages is related to the system architecture, operating system, python version, cuda version and torch version. If the package version of each step is consistent with the tutorial, you can directly download the wheel file in the following link for installation:

    Link: https://pan.baidu.com/s/1FqA9KFENfk4RSOMLmblyiw Password: 8rvh

    pip install torch_spline_conv-1.2.1+pt112cu113-cp310-cp310-linux_x86_64.whl

    pip install torch_sparse-0.6.16+pt112cu113-cp310-cp310-linux_x86_64.whl

    pip install torch_scatter-2.1.0+pt112cu113-cp310-cp310-linux_x86_64.whl

    pip install torch_cluster-1.6.0+pt112cu113-cp310-cp310-linux_x86_64.whl

    pip install pyg_lib-0.3.0+pt112cu113-cp310-cp310-linux_x86_64.whl

    Otherwise, please download the appropriate wheel file from this website, and note that the above installation commands should also be modified accordingly.

    Finally, install torch_geometric:

    pip install torch_geometric

  4. pip install STACCI

Usage Instructions

After creating a new environment according to the installation instructions and installing the corresponding dependencies, place the .h5ad file of the dataset in the specified file structure, specifically, the desired file structure of the dataset is as follows:

{root}
└── {dataset_path}
    └── {dataset}
        └── {h5_name}.h5ad

{x} represents the value of the variable x, and the four custom run result saving folders {generated_path}, {embedding_path}, {model_path}, {result_path} will be automatically created in the {root} folder.

After setting up the file structure, execute the following command:

python test.py --root {root} --ds-dir {dataset_path} --ds-name {dataset} --h5-name {h5_name} --target-types {target_type_list} --gpu {gpu_id} [--use-gpu] --n-nei {#neighborhood} --n-clusters {#sub-regions} [--alpha {alpha}] --label-col-name {label_column_name} --region-col-name {region_column_name}

An example command is:

python test.py --root ./tests/ --ds-dir datasets/ --ds-name 10xv4_n0_v3 --h5-name 10xv4_n0_v3_stringent_self --target-types Tumor_major --gpu 1 --use-gpu --n-nei 12 --n-clusters 4 --alpha 0.75 --label-col-name cell_type --region-col-name Region

The complete file structure of the repository including the example dataset should be as follows:

STACCI/
├── README.md
├── pyproject.toml
├── environment.yml
├── .gitignore
├── test.py
├── STACCI/
│   ├── __init__.py
│   ├── data_handler.py
│   ├── model.py
│   ├── pipeline.py
│   ├── trainer.py
│   └── utils.py
└── tests/
    └── datasets/
        └── 10xv4_n0_v3/
            └── 10xv4_n0_v3_stringent_self.h5ad

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stacci-0.8.3.tar.gz (38.9 kB view details)

Uploaded Source

Built Distribution

stacci-0.8.3-py2.py3-none-any.whl (40.1 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file stacci-0.8.3.tar.gz.

File metadata

  • Download URL: stacci-0.8.3.tar.gz
  • Upload date:
  • Size: 38.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for stacci-0.8.3.tar.gz
Algorithm Hash digest
SHA256 ac15af9cd41b1b5e7c69808374ff1fa44ed06ec17c9d3d5001c4628aa2bc1d0a
MD5 122818ca5730e1a8d314d0ce361b33f3
BLAKE2b-256 4fe88bdcbca48ccf9b5f3186253a03ca4983e329d01e1a0c1e3cdabdb6ac9adb

See more details on using hashes here.

File details

Details for the file stacci-0.8.3-py2.py3-none-any.whl.

File metadata

  • Download URL: stacci-0.8.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 40.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for stacci-0.8.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 651c016c7b89df608d6d30c1e41abd28da5f0d9f5221ebb1854bb6328de00147
MD5 cf488b8d51ff46af25854c8ced87f8d3
BLAKE2b-256 24b9fe86e19d402aa75b258a1f8697f222d5d55f5d38d61197a128a7ba78e093

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page