Skip to main content

A package for VIPER-based Protein Activity analysis of transcriptomic data in Python

Project description

image pyVIPER (VIPER Analysis in Python for single-cell RNASeq)

PyPI License: MIT Downloads

This package enables network-based protein activity estimation on Python. It provides also interfaces for scanpy (single-cell RNASeq analysis in Python). Functions are partly transplanted from R package viper and the R package NaRnEA.

The user-friendly documentation is available here.

viper_visualized

Dependencies

  • scanpy for single cell pipeline.
  • pandas and anndata for data computing and storage.
  • numpy, scipy>=1.10.0 and statsmodel for scientific computation and statistical inference.
  • joblib for parallel computing
  • loompy and pyarrow for Loom file format support and efficient data serialization and I/O
  • tqdm or progress bar visualization
  • igraph for data visualization
  • leidenalg for Leiden clustering
  • torch for GPU processing

If you are using a version of scanpy <1.9.3, it is also advisable to downgrade pandas to (>=1.3.0 & <2.0), due to scanpy incompatibility (issue)

Installation

pypi

pip install viper-in-python

local

git clone https://github.com/alevax/pyviper/
cd pyviper
pip install -e .

Usage

import pandas as pd
import anndata
import pyviper

# Load sample data
ges = anndata.read_text("test/unit_tests/test_1/test_1_inputs/LNCaPWT_gExpr_GES.tsv").T

# Load network
network = pyviper.load.msigdb_regulon("h")

# Translate sample data from ensembl to gene names
pyviper.pp.translate(ges, desired_format = "human_symbol")

## Filter targets in the interactome
network.filter_targets(ges.var_names)

# Compute regulon activities
## area
activity = pyviper.viper(gex_data=ges, interactome=network, enrichment="area")
print(activity.to_df())

## narnea
activity = pyviper.viper(gex_data=ges, interactome=network, enrichment="narnea", eset_filter=False)
print(activity.to_df())

Tutorials

  1. Analyzing scRNA-seq data at the Protein Activity Level
  2. Inferring Protein Activity from scRNA-seq data from multiple cell populations with the meta-VIPER approach
  3. Generating Metacells for ARACNe3 network generation and VIPER protein activity analysis

Structure and rationale

The main functions available from pyviper are:

  • pyviper.viper: "pyviper" function for Virtual Inference of Protein Activity by Enriched Regulon Analysis (VIPER). The function allows using 2 enrichment algorithms, aREA and (matrix)-NaRnEA (see below).
  • pyviper.aREA: computes aREA (analytic rank-based enrichment analysis) and meta-aREA
  • pyviper.NaRnEA: computes matrix-NaRnEA, a vectorized, implementation of NaRnEA
  • pyviper.pp.translate: for translating between species (i.e. mouse vs human) and between ensembl, entrez and gene symbols.
  • pyviper.tl.path_enr: computes pathway enrichment

Other notable functions include:

  • pyviper.tl.OncoMatch: computes OncoMatch, an algorithm to assess the activity conservation of MR proteins between two sets of samples (e.g. validate GEMMs as effective models of human samples)
  • pyviper.pp.stouffer: computes signatures on a cluster-by-cluster basis using Cluster integration method for pathway enrichment
  • pyviper.pp.viper_similarity: computes the similarity between VIPER signatures
  • pyviper.pp.repr_metacells: compute representative metacells (e.g. for ARACNe) using our method to maximize unique sample usage and minimize resampling (users can specify depth, percent data usage, etc).
  • pyviper.pp.repr_subsample: select a representative subsample of data using our method to ensure a widely distributed sampling.

Additionally, the following submodules are available:

  • pyviper.load: submodule containing several utility functions useful for different analyses, including load_msigdb_regulon, load_TFs etc
  • pyviper.pl: submodule containing pyviper-wrappers for scanpy plotting
  • pyviper.tl: submodule containing pyviper-wrappers for scanpy data transformation
  • pyviper.config: submodule allowing users to specify current species and filepaths for regulators

Last, a new Interactome class allows users to load and interrogate ARACNe- and SCENIC-inferred gene regulatory networks.

Contact

Please, report any issues that you experience through this repository "Issues".

For any other info or queries please write to Alessandro Vasciaveo (av2729@cumc.columbia.edu)

License

[!IMPORTANT]
pyviper provides a Python-based implementation of the VIPER software. The VIPER software is distributed by Columbia University under a non-commercial, academic-only evaluation license, which restricts its use to non-profit or not-for-profit organizations and prohibits any commercial use, redistribution, or sublicensing without a separate commercial agreement with Columbia University’s Science and Technology Ventures office. All terms and conditions are specified in the accompanying LICENSE file.

Citation

If you used pyVIPER in your publication, please cite our work here:

Wang, A.L.E., Lin, Z., Zanella, L., Vlahos, L., Girotto, M.A., Zafar, A., ... & Vasciaveo, A. (2024). pyVIPER: A fast and scalable Python package for rank-based enrichment analysis of single-cell RNASeq data. bioRxiv, 2024-08. doi: https://doi.org/10.1101/2024.08.25.609585.

Manuscript in review

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

viper_in_python-2.1.1.tar.gz (5.0 MB view details)

Uploaded Source

Built Distribution

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

viper_in_python-2.1.1-py3-none-any.whl (5.0 MB view details)

Uploaded Python 3

File details

Details for the file viper_in_python-2.1.1.tar.gz.

File metadata

  • Download URL: viper_in_python-2.1.1.tar.gz
  • Upload date:
  • Size: 5.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.3

File hashes

Hashes for viper_in_python-2.1.1.tar.gz
Algorithm Hash digest
SHA256 aaf92536ae8ba8e114edc893f2f824dbe59d06e2d995c3f6d00c70765afba661
MD5 1e3e94fbf5cfff3e898219a689ef0c55
BLAKE2b-256 ff0a5ab03e42c6994a0e46a4892adc508f853fa095153285a58ea84c9387dca2

See more details on using hashes here.

File details

Details for the file viper_in_python-2.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for viper_in_python-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1619d2da65f93ddde525445b9572c554411375012a6b5345ce54e94f7de750fb
MD5 e9d1d13f2875de73f8403534591ee076
BLAKE2b-256 12ca592150e09153a484cc4038c92fecbc3c7c58a7cc67f2df7c10fe0f81a4c2

See more details on using hashes here.

Supported by

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