Skip to main content

miRW: A Multi-Omics Random Walk Framework for Sample-Independent Construction of Personalized Protein Interaction Networks in Cancer

Project description

miRW

miRW: A Multi-Omics Random Walk Framework for Sample-Independent Construction of Personalized Protein Interaction Networks in Cancer

miRW provides a computational framework for constructing personalized protein interaction networks by integrating multi-omics data and a modulation-adjusted Random Walk with Restart (RWR) algorithm. This tool enables sample-specific network refinement and supports downstream analysis in cancer and other complex diseases.


Installation

pip install miRW

Example Usage

Example datasets can be downloaded from:

https://github.com/bioUroZC/miRW/tree/main/miRWsingleLayer/data_example

In cases where no seed gene list is available, users can use single_RW_prepare and single_RW_analysis, which only rely on the expression matrix and the interaction network. High-expression genes (e.g. top 10% per sample) are used as seeds internally.

Running miRW on Example Data (with seed genes)

import pandas as pd
from miRW import single_RWSeed_prepare, single_RWSeed_analysis

# === Step 1: Load example data ===
links = pd.read_csv("Links.csv", index_col=0)
expr = pd.read_csv("exprSet.csv", index_col=0)

# CellMarkers is optional
try:
    seeds = pd.read_csv("CellMarkers.csv")
except FileNotFoundError:
    print("CellMarkers.csv not found; using the first gene as fallback seed.")
    seeds = pd.DataFrame({"symbol": [expr.index[0]]})

# === Step 2: Choose a sample ID ===
sample_id = expr.columns[0]
print("Testing sample:", sample_id)

# === Step 3: Prepare the protein interaction network ===
G, real_w, expr2, seeds2 = single_RWSeed_prepare(seeds, links, expr)

# === Step 4: Run Random Walk with Restart ===
result = single_RWSeed_analysis(sample_id, G, real_w, expr2, seeds2)

# === Step 5: Inspect the output ===
print(result.head())
print("\nmiRW test completed successfully!")

Running miRW without an explicit seed list (expression-driven seeds)

import pandas as pd from miRW import single_RW_prepare, single_RW_analysis

links = pd.read_csv("Links.csv", index_col=0) expr = pd.read_csv("exprSet.csv", index_col=0) sample_id = expr.columns[0]

G, real_w, expr2 = single_RW_prepare(links, expr) result = single_RW_analysis(sample_id, G, real_w, expr2)

print(result.head()) print("\nmiRW test completed successfully!")

Input Data Format

1. Protein Interaction Network (Links.csv)

Required columns:

Column Description
protein1 First protein/gene in interaction
protein2 Second protein/gene
score Interaction confidence score

2. Expression Matrix (exprSet.csv)

  • Rows → Genes
  • Columns → Sample IDs
  • Values → Expression levels (e.g., TPM, FPKM, normalized counts)

Example:

Gene Sample1 Sample2 Sample3
TP53 3.12 2.89 3.55
EGFR 1.22 0.98 1.34

3. Seed Gene List (CellMarkers.csv, optional)

Required column:

Column Description
symbol Seed or marker genes used to initiate RWR

If no seed file is provided, miRW automatically assigns the first gene in your expression matrix as the fallback seed.


Output

The function single_RWSeed_analysis returns a DataFrame containing:

Column Description
Sample Sample ID
link Sorted gene pair (e.g., GeneA_GeneB)
miRW-Imp Importance-adjusted interaction weight
miRW-Flow Flow-based score derived from RWR

These scores can be used for network-based biomarker discovery, pathway investigation, and integration with downstream multi-omics analyses.


Features

  • Modulation-adjusted edge weights using expression deviation
  • Sparse matrix–optimized Random Walk with Restart
  • Personalized network construction for each sample
  • Outputs interpretable edge-level importance and flow scores

License

This project is licensed under the MIT License.


Project Repository

GitHub: https://github.com/bioUroZC/miRW
PyPI: https://pypi.org/project/miRW/

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

mirw-0.3.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

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

mirw-0.3.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file mirw-0.3.0.tar.gz.

File metadata

  • Download URL: mirw-0.3.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for mirw-0.3.0.tar.gz
Algorithm Hash digest
SHA256 fdbcbe90faf5be0573313b638b2c8b7481450e68b81fc8916c0c2dbe357b9f8b
MD5 d897c91d9ebd0934cd56f8f7550f7a26
BLAKE2b-256 7871f07c963dd08a72db90b0ea11c6a9ccfeb5eea7dc94f29629487e8f843549

See more details on using hashes here.

File details

Details for the file mirw-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: mirw-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.7

File hashes

Hashes for mirw-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9434a7a4880b2f2e4128806e6b52ea4367102f55c9d66268ca5220e9fb283df
MD5 d47e4c95da6cef9fb7b7471ddfa7fb38
BLAKE2b-256 48528fd93d4e00e182cd6e113ce9a3b0407a0b32e1685ad26136581f20228c27

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