Python implementation of scTenifoldNet and scTenifoldKnk workflows.
Project description
scTenifoldpy
scTenifoldpy is a Python implementation of scTenifoldNet and scTenifoldKnk workflows.
Installation
uv venv
uv pip install scTenifoldpy
or:
pip install scTenifoldpy
Optional extras:
uv venv
uv pip install "scTenifoldpy[scanpy]"
uv pip install "scTenifoldpy[parallel-ray]"
pip install "scTenifoldpy[scanpy]"
pip install "scTenifoldpy[parallel-ray]"
scTenifoldpy has no R runtime dependency. The principal-component
network step is implemented in Python and uses
sklearn.utils.extmath.randomized_svd.
Docker
Build the default runtime image:
docker build -t sctenifoldpy .
Run the CLI from the container, mounting the current directory as the working directory:
docker run --rm -v "$PWD:/workspace" sctenifoldpy scTenifold --help
PowerShell:
docker run --rm -v "${PWD}:/workspace" sctenifoldpy scTenifold --help
Optional extras can be included at build time:
docker build --build-arg EXTRAS=scanpy -t sctenifoldpy:scanpy .
docker build --build-arg EXTRAS=parallel-ray -t sctenifoldpy:ray .
Class API
from scTenifold.data import get_test_df
from scTenifold import scTenifoldNet
df_1 = get_test_df(n_cells=1000)
df_2 = get_test_df(n_cells=1000)
sc = scTenifoldNet(
df_1,
df_2,
"X",
"Y",
qc_kws={"min_lib_size": 10},
nc_kws={"backend": "serial", "n_jobs": 1},
)
result = sc.build()
High-Level API
from scTenifold import compare_networks, virtual_knockout
result = compare_networks(
df_1,
df_2,
qc_kws={"min_lib_size": 10, "plot": False},
network_kws={"n_nets": 3, "n_samp_cells": 100},
backend="joblib-threading",
n_jobs=4,
)
knockout = virtual_knockout(
df_1,
ko_genes=["NG-1"],
qc_kws={"min_lib_size": 10, "min_percent": 0.001},
)
Parallel Backends
Network construction defaults to deterministic serial execution:
from scTenifold import make_networks
networks = make_networks(df_1, backend="serial", n_jobs=1)
networks = make_networks(df_1, backend="joblib-loky", n_jobs=4)
Supported backends are serial, joblib-loky, joblib-threading, and ray. Ray is optional and requires scTenifoldpy[parallel-ray].
CLI
scTenifold config -t 1 -p ./net_config.yml
scTenifold net -c ./net_config.yml -o ./output_folder
scTenifold knk -c ./knk_config.yml -o ./output_folder
Citation
Please cite the original scTenifoldNet paper if you use this package in scientific work: https://www.sciencedirect.com/science/article/pii/S2666389920301872
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sctenifoldpy-0.2.0.tar.gz.
File metadata
- Download URL: sctenifoldpy-0.2.0.tar.gz
- Upload date:
- Size: 39.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8b5d0dc7500e0a99cfe351d05a64d3e60581a8e5897d43bae54793cca67f8f5
|
|
| MD5 |
1368be645ebdf5500298f88b09ef4e72
|
|
| BLAKE2b-256 |
492159f1334b5e0d51f1b3f6712aca8d765b3d9902d3eb946c3ae32b61730926
|
Provenance
The following attestation bundles were made for sctenifoldpy-0.2.0.tar.gz:
Publisher:
pypi_pub.yml on qwerty239qwe/scTenifoldpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sctenifoldpy-0.2.0.tar.gz -
Subject digest:
c8b5d0dc7500e0a99cfe351d05a64d3e60581a8e5897d43bae54793cca67f8f5 - Sigstore transparency entry: 1530529320
- Sigstore integration time:
-
Permalink:
qwerty239qwe/scTenifoldpy@f042c0b60ad3fdb8310447b93f27afbd3de3f552 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/qwerty239qwe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi_pub.yml@f042c0b60ad3fdb8310447b93f27afbd3de3f552 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sctenifoldpy-0.2.0-py3-none-any.whl.
File metadata
- Download URL: sctenifoldpy-0.2.0-py3-none-any.whl
- Upload date:
- Size: 38.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1b78ce55950a2de2859798fe8aaaa22daa493707a9bc59fec313da36dbdab16
|
|
| MD5 |
d3115639c342ae717397fc7b8ddef694
|
|
| BLAKE2b-256 |
975ecd212fdbd0ea0973a695a6363fa81b6c02c2a540956b43b77cc848a35281
|
Provenance
The following attestation bundles were made for sctenifoldpy-0.2.0-py3-none-any.whl:
Publisher:
pypi_pub.yml on qwerty239qwe/scTenifoldpy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sctenifoldpy-0.2.0-py3-none-any.whl -
Subject digest:
d1b78ce55950a2de2859798fe8aaaa22daa493707a9bc59fec313da36dbdab16 - Sigstore transparency entry: 1530529449
- Sigstore integration time:
-
Permalink:
qwerty239qwe/scTenifoldpy@f042c0b60ad3fdb8310447b93f27afbd3de3f552 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/qwerty239qwe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi_pub.yml@f042c0b60ad3fdb8310447b93f27afbd3de3f552 -
Trigger Event:
release
-
Statement type: