Skip to main content

A Multi-modal LLM-Knowledge Fusion Framework for Predicting Single-cell Genetic Perturbation Effects

scPert, a multi-modal transformer framework that integrates large language model embeddings with structured biological knowledge to predict single-cell transcriptomic responses to genetic perturbations. Through hierarchical fusion of knowledge graph representations, contextual embeddings from foundation models, and gene-specific encodings, scPert achieves significant performance improvements in both single-gene and combinatorial perturbations over existing methods. In cancer-relevant applications, scPert demonstrates the capability to reveal p53 pathway dynamics and immune checkpoint regulatory mechanisms. Systematic evaluation on 42 cancer dependency genes demonstrates scPert's ability to identify critical potential therapeutic targets. Our framework establishes a powerful computational foundation for virtual cell construction and accelerates drug target discovery.

scPert Model

Installation

Install PyG, and then do pip install scpert

Requirement

  • anndata==0.9.2
  • scanpy==1.9.8
  • torch==2.3.0
  • torch-geometric==2.6.1
  • scvi-tools==0.20.3
  • pandas==2.0.3
  • numpy==1.24.4
  • scipy==1.10.1
  • cell-gears==0.0.2
  • nvidia-cublas-cu12==12.1.3.1
  • nvidia-cudnn-cu12==8.9.2.26
  • flash_attn==0.2.8

Usage

embedding_dir: Directory containing gene embedding files (.npy)

data_path: Base directory for perturbation datasets

model_path: Pretrained model directory containing model.pt

pert_file:CSV file specifying perturbation pairs with columns: gene1,gene2

You can train scPert on your perturbation dataset simply running the Python script:

python ./scripts/train.py

You can use scPert to predict single gene or gene pairs perturbations by running the scripts:

python ./scripts/infer.py

Using API Interface:

from scpert import ProcePertdata,scPert

pertData = ProcePertdata(data_path)
pertData.load(DataName = 'norman')

# training
SCPert = scPert(pertData, device = 'cuda:0')
SCPert.model_initialize(hidden_size = 64)
SCPert.train(epochs = 20)

# saving or loading model
SCPert.save_model(model_path)
SCPert.load_pretrained(model_path)

# predict
SCPert.predict([['PRDM1+CBFA2T3'], ['FEV']])
SCPert.GI_predict(['CBL', 'CNN1'])

Cite Us

This work is currently under peer review.

Metadata

Release files for scpert 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scpert 0.1.1
File Size Uploaded Provenance Actions
scpert-0.1.1.tar.gz 36.4 kB Without provenance Details for scpert-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for scpert 0.1.1
File Interpreter ABI Platform Actions
scpert-0.1.1-py3-none-any.whl Python 3 none any Details for scpert-0.1.1-py3-none-any.whl

Total release size: 75.5 kB

Release files / scpert-0.1.1.tar.gz

Download URL scpert-0.1.1.tar.gz
Size 36.4 kB
Tags Source
SHA-256 checksum
How to use checksums
62292ae1e35a4ab194408a172c950b6015c79d9b3bb15bfda51398d31ea8e19b
BLAKE2b-256 checksum
How to use checksums
a3d2d5b9d4ff3c9d86dd24f1a32c5fc407b3a51db39c6f7956eb5dd4ab453337
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.8

Release files / scpert-0.1.1-py3-none-any.whl

Download URL scpert-0.1.1-py3-none-any.whl
Size 39.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e6ec3f76cebcc233e41bc2b59c2310be1b6953abeaa2eafec443db1509c9cc2
BLAKE2b-256 checksum
How to use checksums
059e619a4bc0dd4d803d57ac3336c86bc9c44cb504ea417fdf5f1fa979cae5aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.8.8

Security for scpert 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page