Skip to main content

FineST: Fine-grained Spatial Transcriptomic

Project description

A tatistical model and toolbox to identify the super-resolved ligand-receptor interaction with spatial co-expression (i.e., spatial association). Uniquely, FineST can distinguish co-expressed ligand-receptor pairs (LR pairs) from spatially separating pairs at sub-spot level or single-cell level, and identify the super-resolved ligand-receptor interaction (LRI).

https://github.com/LingyuLi-math/FineST/blob/main/docs/fig/FineST_framework_all.png?raw=true

It comprises three components (Training-Imputation-Discovery) after HE image feature is extracted:

  • Step0: HE image feature extraction

  • Step1: Training FineST on the within spots

  • Step2: Super-resolution spatial RNA-seq imputation

  • Step3: Fine-grained LR pair and CCC pattern discovery

Installation

FineST is available through PyPI. To install, type the following command line and add -U for updates:

pip install -U FineST

Alternatively, install from this GitHub repository for latest (often development) version (time: < 1 min):

pip install -U git+https://github.com/LingyuLi-math/FineST

Installation using Conda

$ git clone https://github.com/LingyuLi-math/FineST.git
$ conda create --name FineST python=3.8
$ conda activate FineST
$ cd FineST
$ pip install -r requirements.txt

Typically installation is completed within a few minutes. Then install pytorch, refer to pytorch installation.

$ conda install pytorch=1.7.1 torchvision torchaudio cudatoolkit=11.0 -c pytorch

Verify the installation using the following command:

python
>>> import torch
>>> print(torch.__version__)
>>> print(torch.cuda.is_available())

Get Started for Visium HD data

Illustrate using a single slice of 10x Visium HD human colorectal cancer (CRC) data with 16-um bin.

Step0: HE image feature extraction

Input

  • Visium_HD_Human_Colon_Cancer_tissue_image.btf: Raw histology image (.btf Visium HD or .tif Visium)

  • tissue_positions.parquet: Spot/bin locations (.parquet Visium HD or .csv Visium)

Output

  • HD_CRC_16um_pth_32_16_image: Segmeted histology image patches (.png)

  • HD_CRC_16um_pth_32_16: Extracted image feature embeddiings for each patche (.pth)

python .FineST/HIPT_image_feature_extract.py --dataset HD_CRC_16um --position ./Colon_Cancer/square_016um/spatial/tissue_positions.parquet --image ./Colon_Cancer/Visium_HD_Human_Colon_Cancer_tissue_image.btf --output_path_img ./HD_CRC_16um_pth_32_16_image --output_path_pth ./HD_CRC_16um_pth_32_16 --patch_size 32 --logging_folder ./Finetune/HIPT_image_feature_extract/

HIPT_image_feature_extract.py also output the execution time:

  • The image segment execution time for the loop is: 62.491 seconds

  • The image feature extract time for the loop is: 1717.818 seconds

Step1: Training FineST on the within spots

Step2: Super-resolution spatial RNA-seq imputation

Step3: Fine-grained LR pair and CCC pattern discovery

Detailed Manual

The full manual is at finest-rtd-tutorial for installation, tutorials and examples.

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

finest-0.0.3.tar.gz (47.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

FineST-0.0.3-py3-none-any.whl (51.7 kB view details)

Uploaded Python 3

File details

Details for the file finest-0.0.3.tar.gz.

File metadata

  • Download URL: finest-0.0.3.tar.gz
  • Upload date:
  • Size: 47.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.2

File hashes

Hashes for finest-0.0.3.tar.gz
Algorithm Hash digest
SHA256 a754b85fa0c1da92abb625800eada89f964e98f57fd6a2386931c1fd3438dbf5
MD5 2bd383a481aa997f56c4a0b9c45a8dc1
BLAKE2b-256 eaadb78f1eabb53e694f51134c99bb3f8ee2177be6a77cf9dce3cb3fa684b289

See more details on using hashes here.

File details

Details for the file FineST-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: FineST-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 51.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.2

File hashes

Hashes for FineST-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c920b4ca561f295cc6c864111aabcdbeb838627f010244df88d945b5b4f7d90d
MD5 65c8327919c676e16261c544330acdf5
BLAKE2b-256 6dfdfdb2324571e8b2720e7cad8f6cc4cbb2f60ebbadf2aca3a66142b2da317a

See more details on using hashes here.

Supported by

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