# Network Spatial Coherence
How good is your network? This package measures the spatial coherence of a network—how closely it resembles a physical network—. Additionally, it can reconstruct the network's original positions in space using the STRND algorithm. Networks can be simulated (if you don't have any) or imported, and weighted and bipartite networks are supported. For details, see [Spatial Coherence](https://www.biorxiv.org/content/10.1101/2024.05.12.593725v1.abstract) and [STRND](https://pubs.rsc.org/en/content/articlehtml/2023/nr/d2nr05435c) papers.
## Features
- Analyze the spatial coherence of a network
- Reconstruct images from purely network information - like drawing a country by only knowing which train stations are connected
- Efficient graph loading and processing (sparse matrices)
- Handles simulated graphs, custom graphs, unweighted graphs, weighted graphs, bipartite graphs
## Install
Python 3.11 is reccomended, although older versions should work. See `requirements.txt` for dependencies.
```bash
pip install network_spatial_coherence
```
## Example Results
<table>
<thead>
<tr>
<th></th> <!-- Empty header for the first column -->
<th>OG Image</th>
<th>SP Constant</th>
<th>Net Dim</th>
<th>Gram Mat</th>
<th>REC Image</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>Coherent Network</strong></td>
<td><img src="./network_spatial_coherence/example_plots/spatially_coherent/1.png" alt="OG Image" width="200"/></td>
<td><img src="./network_spatial_coherence/example_plots/spatially_coherent/2.svg" alt="SP Constant" width="200"/></td>
<td><img src="./network_spatial_coherence/example_plots/spatially_coherent/3.svg" alt="Net Dim" width="200"/></td>
<td><img src="./network_spatial_coherence/example_plots/spatially_coherent/4.svg" alt="Gram Mat" width="200"/></td>
<td><img src="./network_spatial_coherence/example_plots/spatially_coherent/5.png" alt="REC Image" width="200"/></td>
</tr>
<tr>
<td><strong>Incoherent Network</strong></td>
<td><img src="./network_spatial_coherence/example_plots/spatially_incoherent/1.png" alt="OG Image" width="200"/></td>
<td><img src="./network_spatial_coherence/example_plots/spatially_incoherent/2.svg" alt="SP Constant" width="200"/></td>
<td><img src="./network_spatial_coherence/example_plots/spatially_incoherent/3.svg" alt="Net Dim" width="200"/></td>
<td><img src="./network_spatial_coherence/example_plots/spatially_incoherent/4.svg" alt="Gram Mat" width="200"/></td>
<td><img src="./network_spatial_coherence/example_plots/spatially_incoherent/5.png" alt="REC Image" width="200"/></td>
</tr>
</tbody>
</table>
## Quick Intro
For a quick introduction refer to [Usage and Examples](./network_spatial_coherence/markdown_files/usage.md)!
## Detailed information
- [Notebook](./network_spatial_coherence/notebook/run_synthetic_and_exp_pipeline.ipynb)
- [Directory Structure](./network_spatial_coherence/markdown_files/directory_structure.md)
- [GraphArgs Configuration](./network_spatial_coherence/markdown_files/graph_args.md)
- [Results Location](./network_spatial_coherence/markdown_files/results.md)
## Interactive Network Viz
- [Interactive Visualization](https://DavidFernandezBonet.github.io/Network_Spatial_Coherence/network_spatial_coherence/viz_3d.html)
## Citation
If you use this method or refer to its concepts in your research, please cite:
Bonet, D. F., Blumenthal, J. I., Lang, S., Dahlberg, S. K., & Hoffecker, I. T. (2024). *Spatial coherence of DNA barcode networks*. *bioRxiv*. [https://doi.org/10.1101/2024.05.12.593725](https://doi.org/10.1101/2024.05.12.593725)
Bonet, D. F., & Hoffecker, I. T. (2023). *Image recovery from unknown network mechanisms for DNA sequencing-based microscopy*. *Nanoscale, 15*(18), 8153–8157. [https://doi.org/10.1039/D2NR05435C](https://doi.org/10.1039/D2NR05435C)
## Contact
[dfb@kth.se]
Raw data
{
"_id": null,
"home_page": "https://github.com/DavidFernandezBonet/Spatial Constant Analysis",
"name": "network-spatial-coherence",
"maintainer": null,
"docs_url": null,
"requires_python": "<=3.12,>=3.8",
"maintainer_email": null,
"keywords": null,
"author": "David Fernandez Bonet",
"author_email": "dfb@kth.se",
"download_url": "https://files.pythonhosted.org/packages/da/93/329b7b202d2cc9d55d1448d97780c9fd88772eabff744fd7f0811a6eb803/network_spatial_coherence-0.1.1997.tar.gz",
"platform": null,
"description": "# Network Spatial Coherence\nHow good is your network? This package measures the spatial coherence of a network\u2014how closely it resembles a physical network\u2014. Additionally, it can reconstruct the network's original positions in space using the STRND algorithm. Networks can be simulated (if you don't have any) or imported, and weighted and bipartite networks are supported. For details, see [Spatial Coherence](https://www.biorxiv.org/content/10.1101/2024.05.12.593725v1.abstract) and [STRND](https://pubs.rsc.org/en/content/articlehtml/2023/nr/d2nr05435c) papers.\n\n## Features\n- Analyze the spatial coherence of a network\n- Reconstruct images from purely network information - like drawing a country by only knowing which train stations are connected\n- Efficient graph loading and processing (sparse matrices)\n- Handles simulated graphs, custom graphs, unweighted graphs, weighted graphs, bipartite graphs\n\n\n## Install\nPython 3.11 is reccomended, although older versions should work. See `requirements.txt` for dependencies.\n\n```bash\npip install network_spatial_coherence\n```\n\n\n## Example Results\n\n<table>\n <thead>\n <tr>\n <th></th> <!-- Empty header for the first column -->\n <th>OG Image</th>\n <th>SP Constant</th>\n <th>Net Dim</th>\n <th>Gram Mat</th>\n <th>REC Image</th>\n </tr>\n </thead>\n <tbody>\n <tr>\n <td><strong>Coherent Network</strong></td>\n <td><img src=\"./network_spatial_coherence/example_plots/spatially_coherent/1.png\" alt=\"OG Image\" width=\"200\"/></td>\n <td><img src=\"./network_spatial_coherence/example_plots/spatially_coherent/2.svg\" alt=\"SP Constant\" width=\"200\"/></td>\n <td><img src=\"./network_spatial_coherence/example_plots/spatially_coherent/3.svg\" alt=\"Net Dim\" width=\"200\"/></td>\n <td><img src=\"./network_spatial_coherence/example_plots/spatially_coherent/4.svg\" alt=\"Gram Mat\" width=\"200\"/></td>\n <td><img src=\"./network_spatial_coherence/example_plots/spatially_coherent/5.png\" alt=\"REC Image\" width=\"200\"/></td>\n </tr>\n <tr>\n <td><strong>Incoherent Network</strong></td>\n <td><img src=\"./network_spatial_coherence/example_plots/spatially_incoherent/1.png\" alt=\"OG Image\" width=\"200\"/></td>\n <td><img src=\"./network_spatial_coherence/example_plots/spatially_incoherent/2.svg\" alt=\"SP Constant\" width=\"200\"/></td>\n <td><img src=\"./network_spatial_coherence/example_plots/spatially_incoherent/3.svg\" alt=\"Net Dim\" width=\"200\"/></td>\n <td><img src=\"./network_spatial_coherence/example_plots/spatially_incoherent/4.svg\" alt=\"Gram Mat\" width=\"200\"/></td>\n <td><img src=\"./network_spatial_coherence/example_plots/spatially_incoherent/5.png\" alt=\"REC Image\" width=\"200\"/></td>\n </tr>\n </tbody>\n</table>\n\n## Quick Intro\nFor a quick introduction refer to [Usage and Examples](./network_spatial_coherence/markdown_files/usage.md)!\n\n\n## Detailed information\n- [Notebook](./network_spatial_coherence/notebook/run_synthetic_and_exp_pipeline.ipynb)\n- [Directory Structure](./network_spatial_coherence/markdown_files/directory_structure.md)\n- [GraphArgs Configuration](./network_spatial_coherence/markdown_files/graph_args.md)\n- [Results Location](./network_spatial_coherence/markdown_files/results.md)\n\n## Interactive Network Viz\n- [Interactive Visualization](https://DavidFernandezBonet.github.io/Network_Spatial_Coherence/network_spatial_coherence/viz_3d.html)\n\n## Citation\nIf you use this method or refer to its concepts in your research, please cite: \n\nBonet, D. F., Blumenthal, J. I., Lang, S., Dahlberg, S. K., & Hoffecker, I. T. (2024). *Spatial coherence of DNA barcode networks*. *bioRxiv*. [https://doi.org/10.1101/2024.05.12.593725](https://doi.org/10.1101/2024.05.12.593725)\n\nBonet, D. F., & Hoffecker, I. T. (2023). *Image recovery from unknown network mechanisms for DNA sequencing-based microscopy*. *Nanoscale, 15*(18), 8153\u20138157. [https://doi.org/10.1039/D2NR05435C](https://doi.org/10.1039/D2NR05435C)\n\n\n\n\n\n\n\n## Contact\n[dfb@kth.se]\n",
"bugtrack_url": null,
"license": null,
"summary": "Network Validation using the Spatial Coherence Framework.",
"version": "0.1.1997",
"project_urls": {
"Homepage": "https://github.com/DavidFernandezBonet/Spatial Constant Analysis"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f8b6a980ca8c85dddb50cc7405dff911fdfe4849257b4f0a02d00905f3659be5",
"md5": "c9901a0aa6a7e3c49eb1c7428112718d",
"sha256": "25c6b209b8f425ccff87e942fe75845677d0ff9a115b78438f352b05f798d7e5"
},
"downloads": -1,
"filename": "network_spatial_coherence-0.1.1997-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c9901a0aa6a7e3c49eb1c7428112718d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<=3.12,>=3.8",
"size": 4819439,
"upload_time": "2025-09-10T15:36:33",
"upload_time_iso_8601": "2025-09-10T15:36:33.137267Z",
"url": "https://files.pythonhosted.org/packages/f8/b6/a980ca8c85dddb50cc7405dff911fdfe4849257b4f0a02d00905f3659be5/network_spatial_coherence-0.1.1997-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "da93329b7b202d2cc9d55d1448d97780c9fd88772eabff744fd7f0811a6eb803",
"md5": "89d60321251e6884d0abeb2fa3ab6aac",
"sha256": "320971bd144522f0f9a7257daf7d6c9c1b828bb5df0c6c754f72c456f6e6c55b"
},
"downloads": -1,
"filename": "network_spatial_coherence-0.1.1997.tar.gz",
"has_sig": false,
"md5_digest": "89d60321251e6884d0abeb2fa3ab6aac",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<=3.12,>=3.8",
"size": 4767190,
"upload_time": "2025-09-10T15:36:35",
"upload_time_iso_8601": "2025-09-10T15:36:35.252367Z",
"url": "https://files.pythonhosted.org/packages/da/93/329b7b202d2cc9d55d1448d97780c9fd88772eabff744fd7f0811a6eb803/network_spatial_coherence-0.1.1997.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-10 15:36:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "DavidFernandezBonet",
"github_project": "Spatial Constant Analysis",
"github_not_found": true,
"lcname": "network-spatial-coherence"
}