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.1.tar.gz (9.6 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.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mirw-0.3.1.tar.gz
  • Upload date:
  • Size: 9.6 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.1.tar.gz
Algorithm Hash digest
SHA256 28beaecd01fb2716cc7ed222aa48de378709d192a39816bc5cb532dad0367f46
MD5 8d9cc02b3b1848ddb283ac0f6289ba01
BLAKE2b-256 0789aff365af3463db49748d67ba9fa3bcfa9f8dc273ace8b3166a27f9cfb97d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: mirw-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 7.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5b47cbeff906c9f47ad2c2f6bfd4cec4766366b691a32fdf11ff566739b1ed84
MD5 7f854455675390f462eafc650733a899
BLAKE2b-256 97718c6a5b8beeb28b5847da1d72afdb65cad09a848ba4d0ad89f6b1357f2a93

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