A graphical interface for MOSNA and Tysserand — spatial network construction and analysis tools developed by PancaldiLAB.
Requirement: Miniconda or Anaconda must be installed and available in your
PATH.
git clone <repo-url> MOSNA_GUI
cd MOSNA_GUI
bash setup.shOptions:
| Flag | Effect |
|---|---|
--no-shortcut |
Skip desktop launcher creation |
--dev |
Install mosna-package in editable mode (pip install -e) |
The script will:
- Create a
mosna-GUIconda environment (Python 3.10) - Install all scientific dependencies via conda-forge
- Install
mosna-packageinto the environment - Generate
MosnaGUI.shand a Desktop shortcut
Requirement: No pre-requisite needed — Miniconda is downloaded automatically if absent.
- Download or clone this repository
- Double-click
setup_windows.bat
The installer will:
- Detect or download/install Miniconda silently
- Create a
mosna-GUIconda environment (Python 3.10) - Install all dependencies
- Install
mosna-package - Generate
MosnaGUI.batand a Desktop shortcut
| Platform | Command |
|---|---|
| Linux / macOS | bash MosnaGUI.sh or double-click the Desktop shortcut |
| Windows | Double-click MosnaGUI.bat or the Desktop shortcut |
| Any (manual) | conda activate mosna-GUI && python GUI_MOSNA.py |
| Dependency | Version |
|---|---|
| Python | 3.10 |
| PySide6 | ≥ 6.5 |
| scanpy | ≥ 1.9 |
| scipy | 1.13 |
| pandas | ≥ 2.0 |
| mosna | from mosna-package/ |
Full list: requirements.txt
MOSNA_GUI/
├── GUI_MOSNA.py ← Main GUI entry point
├── package/
│ ├── tysserand_network.py ← Step 1 runner
│ ├── assortativity.py ← Step 2 runner
│ ├── niche_analysis.py ← Step 3 runner
│ ├── core/ ← Analysis cores
│ ├── utils/ ← Shared utilities
│ └── style.qss ← Qt stylesheet
├── CONFIG/
│ └── configuration.yaml.example ← Config template
├── mosna-package/ ← MOSNA Python package (unchanged)
├── setup.sh ← Linux/macOS installer
└── setup_windows.bat ← Windows installer
[Step 0] Set working directory + data paths
↓
[Step 1] Tysserand — Build spatial networks from cell coordinates
↓
[Step 2] Assortativity — Compute mixing statistics per network
↓
[Step 3] Niche Analysis — Cluster niches from aggregated neighborhoods
Your input files must be CSV or Parquet tables following this structure:
| CellID | patient | sample | X_position | Y_position | Phenotype |
|---|---|---|---|---|---|
| c001 | pt-01 | s1 | 120.3 | 84.7 | CD8_T |
| … | … | … | … | … | … |
File naming convention expected by the tool:
nodes_patient-01_sample-s1.parquet
nodes_patient-02_sample-s1.parquet
| Parameter | Description |
|---|---|
| Nodes directory | Folder containing your spatial cell tables |
| Network directory | Folder with pre-built edges/nodes (default: auto-generated by Step 1) |
| Patient column name | Column used as the first grouping level (e.g. patient) |
| Sample column name | Optional second grouping level (e.g. sample) |
| Extension | File format: csv, parquet, or tsv |
| Parameter | Description |
|---|---|
| X / Y coordinates column | Spatial position columns |
| Phenotype column | Cell type or cluster column |
| Edges method | delaunay (triangulation) or knn (k-nearest neighbours) |
| Min neighbors | Minimum neighbours for KNN |
| CPU | Cores for parallel processing |
| Parameter | Description |
|---|---|
| Phenotype column | Column defining cell types |
| Index | Cell index column (index = DataFrame index) |
| Number of shuffle | Randomizations to build the null distribution |
| Randomization diagnostic | Estimate time cost for your shuffle count |
| Parameter | Description |
|---|---|
| Saving directory | Output subfolder name |
| Processing method | Aggregated nodes or Per sample |
| Niches method | NAS (SCAN-IT is work in progress) |
| Phenotype column | Cell type column |
| Column to aggregate | Columns used in the aggregated network |
| X / Y coordinates for niches | Spatial columns to rebuild coloured networks |
| CPU | Cores for parallel processing |
Clustering parameters:
| Parameter | Description |
|---|---|
order |
Neighborhood order (1 = direct neighbors) |
stat_funcs |
Aggregation functions: np.mean, np.std, … |
clusterer_type |
gmm, leiden, hdbscan, spectral, ecg |
metric |
Distance metric: euclidean, manhattan, cosine |
normalize |
Feature normalization: total, niche, obs, clr, all |
reducer_type |
Dimensionality reduction: umap |
n_neighbors |
Neighbors for graph/UMAP construction |
min_dist |
UMAP tightness (smaller = more compact) |
dim_clust |
Reduced dimensions used for clustering |
n_clusters |
Number of clusters (gmm, spectral) |
resolution |
Leiden resolution (higher = more clusters) |
min_cluster_size |
HDBSCAN minimum cluster size |
conda activate mosna-GUI
cd /path/to/MOSNA_GUI
python -m package.tysserand_network \
--file CONFIG/configuration.yaml \
--working_dir /path/to/output/
python -m package.assortativity \
--file CONFIG/configuration.yaml \
--working_dir /path/to/output/
python -m package.niche_analysis \
--file CONFIG/configuration.yaml \
--working_dir /path/to/output/Copy CONFIG/configuration.yaml.example to CONFIG/configuration.yaml and fill in your paths. The configuration.yaml file is git-ignored (it contains absolute paths specific to your machine).