Skip to main content

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_prior
    • uniform
    • no_seed
    • no_rwr
    • no_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:

  • protein1
  • protein2
  • score

Expression matrix

The expression matrix must use:

  • rows as genes or proteins
  • columns as sample IDs

Main API

Single-omics

  • prepare_data_no_prior
  • run_no_prior_single_sample
  • prepare_data_uniform
  • run_uniform_single_sample
  • prepare_data_no_seed
  • run_no_seed_single_sample
  • prepare_data_no_rwr
  • run_no_rwr_single_sample
  • prepare_data_no_corr
  • run_no_corr_single_sample

Data-driven extension

  • prepare_data_driven
  • build_graph_from_correlation
  • run_driven_single_sample
  • infer_driven_network

Multi-omics

  • prepare_data_coupled
  • run_coupled_single_sample
  • prepare_data_direct
  • run_direct_single_sample
  • prepare_data_multilayer
  • run_multilayer_single_sample
  • run_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mossn-0.1.0.tar.gz (3.0 MB view details)

Uploaded Source

Built Distribution

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

mossn-0.1.0-py3-none-any.whl (3.0 MB view details)

Uploaded Python 3

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

Hashes for mossn-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3a075f9e8c00c2b0aa4928a5452dbdc9dfef6d4d2fe045a3c58cecbd8782d1f6
MD5 f7119376b62e3661c95781d21c92477f
BLAKE2b-256 993c91cf21368282d1cb742f8e5d8ff2ccd258dcac1c8af3875db5b616d98f7c

See more details on using hashes here.

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

Hashes for mossn-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d08363589e1460806b32cc56fcce290060704820064134b9425904671e22518e
MD5 2a0ef34fa015cf10c2799148d196a22d
BLAKE2b-256 02b4fb372483299680b96a4534c017c0c2def6e35fc2d612cd56068a30e11354

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