Welcome to the world of single-cell perturbation analysis! If you’re diving into the realm of scPerturb, a powerful resource and Python tool designed for single-cell experimentation, you’ve arrived at the right spot. This article will guide you through the installation, usage, and troubleshooting of scPerturb to harness its full potential.
What is scPerturb?
scPerturb is a Python package that allows researchers to compute E-distances in single-cell perturbation data and perform essential E-tests. This tool integrates seamlessly with Scanpy, making it a valuable asset for your data analysis toolkit.
Where to Find the Data
- The datasets are available to download on scperturb.org. Here, you can also find an interactive table of all included datasets.
- For the latest versions of datasets, visit Zenodo for RNA data and Zenodo for ATAC data.
Installation: Getting scPerturb up and Running
To install scPerturb, simply use pip:
pip install scperturb
Within moments, you will have scPerturb ready to assist in your analysis.
Usage Example: Your First Steps to E-Distances
To illustrate how to use scPerturb, let’s think of it as a chef preparing a dish. Just like a chef needs specific ingredients and tools to create a culinary masterpiece, you need to input your data into scPerturb to calculate E-distances and execute E-tests.
Here’s a breakdown of the recipe:
- Ingredients:
- Your raw data (like flour and sugar)
- scPerturb installed in your environment (like kitchen tools)
- Steps:
- Call the E-distances function with your dataset:
estats = edist(adata, obs_key=perturbation) - Select a specific group (e.g., control) to analyze:
estats_control = estats.loc[control] - Perform an E-test to see differences from the control:
df = etest(adata, obs_key=perturbation, obsm_key=X_pca, dist=sqeuclidean, control=control, alpha=0.05, runs=100)
- Call the E-distances function with your dataset:
And just like that, you’ve cooked up some insightful results!
For R Users: scPerturbR Integration
If you’re an R aficionado using Seurat, scPerturb also has a counterpart: scPerturbR, available on CRAN. You can install it using:
install.packages(scperturbR)
Reproducibility: Ensuring Reliable Results
To reproduce the figures and tables presented in the publication, follow these steps:
- Install conda. You may also want to check out mamba for a faster experience.
- Create a new conda environment:
conda env create -f sc_env.yaml - Activate the environment:
conda activate sc_env - Download all datasets from scperturb.org.
- Edit the config.yaml file to set the data directory correctly.
- Execute notebooks in the “notebooks” folder to generate the figures and tables found in the paper supplement.
Troubleshooting
If you encounter issues while setting up or using scPerturb, here are some troubleshooting tips:
- Ensure that you have installed all necessary dependencies.
- Check that your data files are correctly specified in the configuration YAML file.
- Refer to the GitHub issues page for community support and reports.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Conclusion
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

