Skip to content

scTenifoldpy

scTenifoldpy is a Python port of the scTenifold family of single-cell gene-regulatory-network analyses. It provides two workflows:

  • scTenifoldNet: compare two single-cell expression matrices and rank genes by differential regulation. Use it when you have a control and a condition sample.
  • scTenifoldKnk: build a wild-type network and simulate a virtual knockout of one or more genes. Use it when you only have one sample and want to predict downstream effects of perturbing a gene.

Both workflows share the same backbone: per-cell QC, many PC networks on resampled cells, tensor decomposition, manifold alignment, and a differential regulation test. See Pipeline Steps for the step-by-step inputs and outputs.

Install

uv venv
uv pip install scTenifoldpy

or:

pip install scTenifoldpy

See Installation for optional extras, Docker, and development setup.

Hello World

from scTenifold import compare_networks
from scTenifold.data import get_test_df

x = get_test_df(n_cells=200, n_genes=300, random_state=0)
y = get_test_df(n_cells=200, n_genes=300, random_state=1)

result = compare_networks(
    x, y,
    qc_kws={"min_lib_size": 1},
    network_kws={"n_nets": 3, "n_samp_cells": 100},
)
print(result.head())

The returned DataFrame has one row per shared gene with columns Gene, Distance, boxcox-transformed distance, Z, FC, p-value, and adjusted p-value.

Next

Version

This documentation reflects 0.2.x. See the Changelog for what changed since 0.1.