Skip to main content

scTenifoldXct

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 Dependencies

We suggest first intall dependencies of scTenifoldXct with conda:

git clone https://github.com/cailab-tamu/scTenifoldXct.git
cd scTenifoldXct
conda env create -f environment.yml
conda activate scTenifold

Install scTenifoldXct

Install scTenifoldXct with pip:

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

or install it manually from source:

pip install .

Usages

Quick Start

The following code runs scTenifoldXct on an example data set in the tutorials:

import scanpy as sc
import scTenifoldXct as st

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 verbose 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)

Tutorial

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

Single-sample interaction analysis:
https://github.com/cailab-tamu/scTenifoldXct/blob/master/tutorials/tutorial-short_example.ipynb
Two-sample differential interaction analysis:
https://github.com/cailab-tamu/scTenifoldXct/blob/master/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:

python -m scTenifoldXct.core tutorials/data/adata_short_example.h5ad \
--rebuild \
-s "Inflam. FIB" \
-r "Inflam. DC" \
--n_cpus 8 \
-v

For runnning two-sample analysis:

python -m scTenifoldXct.merge tutorials/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.1.0.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

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

sctenifoldxct-0.1.0-py3-none-any.whl (64.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sctenifoldxct-0.1.0.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.12

File hashes

Hashes for sctenifoldxct-0.1.0.tar.gz
Algorithm Hash digest
SHA256 856bfa7de247822d3341878553709add35ee549978b4f171e7b9922270bb829d
MD5 81d283d51a80cf78eb6b239f01a11368
BLAKE2b-256 95c9ad69c87f2c10fb7b4ebdee8c349aedc60927c3f2223e96d08042b5026f40

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sctenifoldxct-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 64.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.12

File hashes

Hashes for sctenifoldxct-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 28dd34eec5a043eef96f2e663bc088d66004b059bbc84f9812391990abc4d167
MD5 13bd21b0fb47ee489bf4f610a45ffbbf
BLAKE2b-256 5788f71a00fc34a1865708f0849c714cfb6869d29a16042fb61ea26fbfc54ab4

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