Skip to main content

A tool for studying metabolic tasks from single-cell and spatial transcriptomics

Project description

PYPI test-sccellfie Codecov Downloads

Metabolic activity from single-cell and spatial transcriptomics with scCellFie

scCellFie is a computational tool for studying metabolic tasks using Python, inspired by the original implementation of CellFie, another tool originally developed in MATLAB by the Lewis Lab. This version is designed to be compatible with single-cell and spatial data analysis using Scanpy, while including a series of improvements and new analyses.

Logo

Installation

To install scCellFie, use pip:

pip install sccellfie

Features

  • Single cell and spatial data analysis: Tailored for analysis of metabolic tasks using fully single cell resolution and in space.

  • Speed: This implementation further leverages the original CellFie. It is now memory efficient and run much faster! A dataset of ~70k single cells can be analyzed in ~5 min.

  • New analyses: From marker selection of relevant metabolic tasks to integration with inference of cell-cell communication.

  • User-friendly: Python-based for easier use and integration into existing workflows.

  • Scanpy compatibility: Fully integrated with Scanpy, the popular single cell analysis toolkit.

  • Organisms: Metabolic database and analysis available for human and mouse.

Quick start

A quick example of how to use scCellFie with a single-cell dataset and generate results:

import sccellfie
import scanpy as sc

# Load the dataset
adata = sc.read(filename='BALF-COVID19.h5ad',
                backup_url='https://zenodo.org/record/7535867/files/BALF-COVID19-Liao_et_al-NatMed-2020.h5ad')

# Run one-command scCellFie pipeline
results = sccellfie.run_sccellfie_pipeline(adata,
                                           organism='human',
                                           sccellfie_data_folder=None,
                                           n_counts_col='n_counts',
                                           process_by_group=False,
                                           groupby=None,
                                           neighbors_key='neighbors',
                                           n_neighbors=10,
                                           batch_key='sample',
                                           threshold_key='sccellfie_threshold',
                                           smooth_cells=True,
                                           alpha=0.33,
                                           chunk_size=5000,
                                           disable_pbar=False,
                                           save_folder=None,
                                           save_filename=None
                                          )

To access metabolic activities, we need to inspect results[‘adata’]:

  • The processed single-cell data is located in the AnnData object results[‘adata’].

  • The reaction activities for each cell are located in the AnnData object results[‘adata’].reactions.

  • The metabolic task activities for each cell are located in the AnnData object results[‘adata’].metabolic_tasks.

In particular:

  • results[‘adata’]: contains gene expression in .X.

  • results[‘adata’].layers[‘gene_scores’]: contains gene scores as in the original CellFie paper.

  • results[‘adata’].uns[‘Rxn-Max-Genes’]: contains determinant genes for each reaction per cell.

  • results[‘adata’].reactions: contains reaction scores in .X so every scanpy function can be used on this object to visualize or compare values.

  • results[‘adata’].metabolic_tasks: contains metabolic task scores in .X so every scanpy function can be used on this object to visualize or compare values.

Other keys in the results dictionary are associated with the scCellFie database and are already filtered for the elements present in the dataset (‘gpr_rules’, ‘task_by_gene’, ‘rxn_by_gene’, ‘task_by_rxn’, ‘rxn_info’, ‘task_info’, ‘thresholds’, ‘organism’).

How to cite

Preprint is coming soon!

Acknowledgments

This implementation is inspired by the original CellFie tool developed by the Lewis Lab. Please consider citing their work if you find this tool useful:

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

sccellfie-0.3.0.tar.gz (57.7 kB view details)

Uploaded Source

Built Distribution

scCellFie-0.3.0-py3-none-any.whl (79.3 kB view details)

Uploaded Python 3

File details

Details for the file sccellfie-0.3.0.tar.gz.

File metadata

  • Download URL: sccellfie-0.3.0.tar.gz
  • Upload date:
  • Size: 57.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for sccellfie-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c2b097eaabaa6883f342009915854496ab3904c24e2b1a48e36c3aa68bc1e06f
MD5 2e00b8f749b87cc07067cbac9b34cbe3
BLAKE2b-256 2e9db66ae0f1042d6ebe25051dbbd9cc4a55f6ae9e07412fc9825f87648af8e9

See more details on using hashes here.

File details

Details for the file scCellFie-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: scCellFie-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 79.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for scCellFie-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f12aa7bb1df84686d5c2d6a04829719de3da5c234b7d7c1040d6ec2b883670f
MD5 190cf516c935dc99a8709be11b581b53
BLAKE2b-256 8ae1a43ae485426efd7d9d49549a34e4231e73b9c25e68efbeeb8c02e8b2c272

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