Skip to main content

PYPI test-sccellfie Codecov Downloads License: MIT

Metabolic activity from single-cell and spatial transcriptomics with scCellFie

scCellFie is a Python-based tool for analyzing metabolic activity at different resolutions, developed at the Vento Lab. It efficiently processes both single-cell and spatial data to predict metabolic task activities. While its prediction strategy is inspired by CellFie, a tool from the Lewis Lab originally developed in MATLAB for bulk and small single-cell datasets, scCellFie includes a series of improvements and new analyses, such as marker selection, differential analysis, and cell-cell communication inference.

Logo

Features

  • Single cell and spatial data analysis: Inference of metabolic activity per single cell or spatial spot.

  • Speed: Runs fast and memory efficiently, scaling up to large datasets. ~100k single cells can be analyzed in ~8 min.

  • Downstream 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, including Jupyter Notebooks.

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

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

Documentation and Tutorials

Installation

To create a new conda environment (optional):

# Create a new conda environment
conda create -n sccellfie -y python=3.10

# Activate the environment
conda activate sccellfie

To install scCellFie, use pip:

pip install sccellfie

Quick Start

A quick example of how to use scCellFie with a single-cell dataset to infer metabolic activities and export them:

import sccellfie
import scanpy as sc

# Load the dataset
adata = sc.read(filename='./data/HECA-Subset.h5ad',
                backup_url='https://zenodo.org/records/15072628/files/HECA-Subset.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
                                          )

# Save adata objects containing single-cell/spatial predictions
sccellfie.io.save_adata(adata=results['adata'],
                        output_directory='/folder/path/',
                        filename='sccellfie_results'
                        )

# Summarize results in a cell-group level for the Metabolic Task Visualizer
report = sccellfie.reports.generate_report_from_adata(results['adata'].metabolic_tasks,
                                                      group_by=cell_group,
                                                      tissue_column='condition',
                                                      feature_name='metabolic_task'
                                                      )

# Export files to a specific folder.
sccellfie.io.save_result_summary(results_dict=report, output_directory='/folder/path/')

# Melted.csv and Min_max.csv are input files for the Metabolic Task Visualizer

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

Please consider citing our work if you find scCellFie useful:

Acknowledgments

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

Contributing

We welcome contributions! Feel free to add requests in the issues section or directly contribute with a pull request.

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.6.1.tar.gz (168.2 kB view details)

Uploaded Source

Built Distribution

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

sccellfie-0.6.1-py3-none-any.whl (209.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sccellfie-0.6.1.tar.gz
  • Upload date:
  • Size: 168.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for sccellfie-0.6.1.tar.gz
Algorithm Hash digest
SHA256 cd2e9b9fb48140168a172d1ff8529687c55ab1fc0f50a9ee7a4e2767fa5e3761
MD5 06b0f96c69617ce44922d6ea05b592e3
BLAKE2b-256 847bc493e18bd73a306ecf1c2979933c9b01d95e3d0f5c0574d896722c586cc9

See more details on using hashes here.

File details

Details for the file sccellfie-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: sccellfie-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 209.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for sccellfie-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7a5278e79eb601006513cc7c7343046fa5b8a1c8cd894c802fd20fb4d3f9bbe9
MD5 cebb6a1fc484fc5cc4917ff3c8c00961
BLAKE2b-256 4646ee2385e6daced3e34ebd61ff3e979d44c9b6d85b3e7a4396bbfa786acfd6

See more details on using hashes here.

Release history Release notifications | RSS feed

0.6.2

2 files

This release

0.6.1 This release

2 files

0.6.0

2 files

0.5.0

2 files

0.4.8

2 files

0.4.7

2 files

0.4.6

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

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