Metadata-Version: 2.4
Name: modernsn
Version: 0.1.6
Summary: MODERN (MOdule DEtection and Refinement in signed Networks): community detection of a signed network.
Home-page: https://github.com/rnakato/MODERN
Author: Ryuichiro Nakato
Author-email: rnakato@iqb.u-tokyo.ac.jp
License: GPL3.0
Keywords: MODERN modernsn signed network community detection
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.14.2
Requires-Dist: pandas>=0.22.0
Requires-Dist: leidenalg>=0.8.3
Requires-Dist: eeisp>=0.5.0
Requires-Dist: matplotlib
Requires-Dist: seaborn
Requires-Dist: networkx
Requires-Dist: igraph
Provides-Extra: mat
Requires-Dist: scipy; extra == "mat"
Provides-Extra: comparison
Requires-Dist: scikit-learn; extra == "comparison"
Provides-Extra: scrna
Requires-Dist: scanpy; extra == "scrna"
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: provides-extra
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# <img src="img/MODERN_logo.png" width="120"> MODERN

**MODERN (MOdule DEtection and Refinement in signed Networks)** detects and
refines modules in networks containing positive and negative edges. The Python
package is named `modernsn`, and the command-line program is `modern`.

MODERN provides signed modularity and signed Constant Potts Model clustering,
metanode analysis, negative-edge-guided reintegration, hard cannot-link
refinement, multi-seed negative-edge leverage, and practical signed-network
diagnostics.

<img src="docs/_static/img/Workflow.png" width="800">

## Installation

```bash
pip install modernsn==0.1.2
```

The core dependencies are NumPy, pandas, python-igraph, leidenalg, NetworkX,
Matplotlib, seaborn, and EEISP. Optional dependencies can be installed for
specific functions:

```bash
pip install "modernsn[mat]==0.1.2"         # MATLAB .mat input (SciPy)
pip install "modernsn[comparison]==0.1.2"  # partition ARI comparison (scikit-learn)
pip install "modernsn[scrna]==0.1.2"       # single-cell analysis (Scanpy)
```

## Quick start

MODERN accepts separate positive and negative edge lists. The default TSV
format has five columns and no header:

```text
gene_id1    gene_id2    gene_name1    gene_name2    weight
ENSG00001   ENSG00002   GeneA         GeneB         15.3
```

Run signed Leiden modularity as follows:

```bash
modern --pos positive.tsv --neg negative.tsv \
  --thre-pos 10 --thre-neg 1 \
  --method leiden-mod-alpha --alpha 0.7 --resolution 1 \
  --seed 12345 --out-prefix results/run1
```

To inspect a network before selecting an analysis, run:

```bash
modern --pos positive.tsv --neg negative.tsv \
  --method leiden-mod-alpha --check-signed-network \
  --leverage-seeds 1 2 3 10 42 \
  --out-prefix results/network_check
```

## Documentation

See the [MODERN documentation](docs/index.rst) for:

- command-line input, methods, refinement modes, and outputs;
- the Python API and parallel parameter sweeps;
- interpretation guidance; and
- runnable tutorials.

The example notebooks are available in [`examples/`](examples/).

## Citation

Nakato R., Nagai LAE, List M. *MODERN: community detection and
exclusivity-aware module refinement in signed biological networks*. In
preparation.
