MOSSN: sample-specific protein network inference from gene expression and multi-omics data
Project description
mossn
mossn packages the MOSSN algorithm for constructing sample-specific protein
interaction networks from gene expression data, together with ablation variants
and multi-omics extensions.
Features
- Sample-specific edge reweighting using gene-expression-derived correction scores.
- Random walk with restart (RWR) to estimate node importance per sample.
- Ablation variants:
no_prioruniformno_seedno_rwrno_corr
- Multi-omics extensions:
- coupled restart
- direct cross-layer graph
- multilayer graph
- late fusion
Installation
pip install mossn
For local development:
pip install -e .
Quick Start
from mossn import prepare_data_no_prior, run_no_prior_single_sample
from mossn.example_data import load_example_expression, load_example_links
links = load_example_links()
expression_data = load_example_expression()
graph, base_weights, expression_data = prepare_data_no_prior(links, expression_data)
edge_table = run_no_prior_single_sample(
sample_id=expression_data.columns[0],
graph=graph,
base_weights=base_weights,
expression_data=expression_data,
)
print(edge_table.head())
Bundled Example Data
The package includes the following example datasets:
- TCGA BLCA expression matrix
- STRING-derived PPI links
You can access them with:
from mossn.example_data import (
get_example_expression_path,
get_example_links_path,
load_example_expression,
load_example_links,
)
Input format
PPI links
The links table must contain:
protein1protein2score
Expression matrix
The expression matrix must use:
- rows as genes or proteins
- columns as sample IDs
Main API
Single-omics
prepare_data_no_priorrun_no_prior_single_sampleprepare_data_uniformrun_uniform_single_sampleprepare_data_no_seedrun_no_seed_single_sampleprepare_data_no_rwrrun_no_rwr_single_sampleprepare_data_no_corrrun_no_corr_single_sample
Data-driven extension
prepare_data_drivenbuild_graph_from_correlationrun_driven_single_sampleinfer_driven_network
Multi-omics
prepare_data_coupledrun_coupled_single_sampleprepare_data_directrun_direct_single_sampleprepare_data_multilayerrun_multilayer_single_samplerun_late_fusion_single_sample
Notes
- The package expects matched identifiers between the network and omics tables.
- Sample-specific normalization uses median and interquartile range (IQR).
- Node importance is rank-normalized before computing final edge weights.
- The data-driven mode first infers a background graph from expression correlations when an external reference network is unavailable.
Data-Driven Example
from mossn import infer_driven_network, run_driven_single_sample
from mossn.example_data import load_example_expression
expression_data = load_example_expression()
graph, base_weights, expression_data = infer_driven_network(
expression_data=expression_data,
cor_threshold=0.9,
)
edge_table = run_driven_single_sample(
sample_id=expression_data.columns[0],
graph=graph,
base_weights=base_weights,
expression_data=expression_data,
)
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 mossn-0.1.0.tar.gz.
File metadata
- Download URL: mossn-0.1.0.tar.gz
- Upload date:
- Size: 3.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a075f9e8c00c2b0aa4928a5452dbdc9dfef6d4d2fe045a3c58cecbd8782d1f6
|
|
| MD5 |
f7119376b62e3661c95781d21c92477f
|
|
| BLAKE2b-256 |
993c91cf21368282d1cb742f8e5d8ff2ccd258dcac1c8af3875db5b616d98f7c
|
File details
Details for the file mossn-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mossn-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d08363589e1460806b32cc56fcce290060704820064134b9425904671e22518e
|
|
| MD5 |
2a0ef34fa015cf10c2799148d196a22d
|
|
| BLAKE2b-256 |
02b4fb372483299680b96a4534c017c0c2def6e35fc2d612cd56068a30e11354
|