Skip to main content

A semi-supervised method for predicting cell-cell interactions and mapping cellular communication graphs via manifold learning

Project description

scTenifoldXct

a semi-supervised method for predicting cell-cell interactions and mapping cellular communication graphs via manifold learning
New! Data has been added. Feel free to explore and use it.
New! A standalone UI has been added. Give it a try! [Paper]

drawing


Install

Install scTenifoldXct from PyPI:

pip install scTenifoldXct

Install from source (for development or the latest unreleased changes):

git clone https://github.com/cailab-tamu/scTenifoldXct.git
cd scTenifoldXct
pip install .

Usages

Quick Start

The following code runs scTenifoldXct on the bundled example data set:

import logging
import scanpy as sc
import scTenifoldXct as st

# scTenifoldXct logs progress via the logging module. Configure a handler
# to see messages when verbose=True (e.g. in a script or notebook):
logging.basicConfig(level=logging.INFO, format="%(message)s")

adata = sc.read_h5ad('data/adata_short_example.h5ad') # load data
xct = st.scTenifoldXct(data = adata, # an AnnData
                    source_celltype = 'Inflam. FIB', # sender cell type
                    target_celltype = 'Inflam. DC', # receiver cell type
                    obs_label = 'ident', # colname in adata.obs indicating cell types
                    rebuild_GRN = True, # whether to build GRNs
                    GRN_file_dir = 'Net_example_dev',  # folder path to GRNs
                    verbose = True, # whether to log the processing
                    n_cpus = -1) # CPU multiprocessing, -1 to use all
emb = xct.get_embeds(train = True) # Manifold alignment to project data to low-dimensional embeddings
xct_pairs = xct.null_test() # non-parametric test to get significant interactions
print(xct_pairs)

Command line

Two console scripts are installed with the package:

# single-sample interaction analysis
sctenifoldxct data/adata_short_example.h5ad --rebuild \
    -s "Inflam. FIB" -r "Inflam. DC" --n_cpus 8 -v

# two-sample differential interaction analysis
sctenifoldxct-merge data/adata_merge_example.h5ad NormalvsTumor N T \
    --rebuild -s "B cells" -r "Fibroblasts" --n_cpus 8 -v

Run sctenifoldxct --help or sctenifoldxct-merge --help for all options.

Tutorial

We have included two tutorial notebooks on scTenifoldXct usage and results visualization.

Single-sample interaction analysis:
https://github.com/cailab-tamu/scTenifoldXct/blob/main/tutorials/tutorial-short_example.ipynb
Two-sample differential interaction analysis:
https://github.com/cailab-tamu/scTenifoldXct/blob/main/tutorials/tutorial-merge_short_example.ipynb

Run scTenifoldXct from command-line by Docker

scTenifoldXct provides command-line utilities for users who are not familiar with Python.
A Docker image of scTenifoldXct can be built from the repository. The Docker image has all required packages and databases included.

docker build -t sctenifold .
docker run -it --name xct --shm-size=8gb sctenifold

If successful, a Bash terminal will be present in the newly created container.
An example for running single-sample analysis:

sctenifoldxct data/adata_short_example.h5ad \
--rebuild \
-s "Inflam. FIB" \
-r "Inflam. DC" \
--n_cpus 8 \
-v

For running two-sample analysis:

sctenifoldxct-merge data/adata_merge_example.h5ad \
NormalvsTumor N T \
--rebuild \
-s "B cells" \
-r "Fibroblasts" \
--n_cpus 8 \
-v

Users should copy their own data to the container for their analyses.

When analysis completes, hit Ctrl + p and Ctrl + q to detach from the container and then copy the result to the host:

docker cp xct:/app/xct_results/ .

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

sctenifoldxct-0.2.0.tar.gz (68.4 kB view details)

Uploaded Source

Built Distribution

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

sctenifoldxct-0.2.0-py3-none-any.whl (65.9 kB view details)

Uploaded Python 3

File details

Details for the file sctenifoldxct-0.2.0.tar.gz.

File metadata

  • Download URL: sctenifoldxct-0.2.0.tar.gz
  • Upload date:
  • Size: 68.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sctenifoldxct-0.2.0.tar.gz
Algorithm Hash digest
SHA256 550b64a0f6c742cceea254e27f4b3831f7f0a4767692180a80009202feb0edac
MD5 ab1f3fad93ecbf75766f0335869da45c
BLAKE2b-256 0e3a66b8ff7b68ecd693c6964c758a309d7db5e636f00268881524ff3b440240

See more details on using hashes here.

Provenance

The following attestation bundles were made for sctenifoldxct-0.2.0.tar.gz:

Publisher: publish.yml on cailab-tamu/scTenifoldXct

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sctenifoldxct-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: sctenifoldxct-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 65.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for sctenifoldxct-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 982522af0c79c556faa2edcd48ed2c0b55d718117980bc0d12b8ead82e07a771
MD5 6a17c884affc3ddb8bb4b66b709fd768
BLAKE2b-256 bae9048fcfcc42178f103d76ebe3a4c79a0316f74a07685261accb2dba359bf6

See more details on using hashes here.

Provenance

The following attestation bundles were made for sctenifoldxct-0.2.0-py3-none-any.whl:

Publisher: publish.yml on cailab-tamu/scTenifoldXct

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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