# 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 detailed methodologies, 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>
## Further information
- [Usage and Examples](./network_spatial_coherence/markdown_files/usage.md)
- [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 Visualization](https://DavidFernandezBonet.github.io/Network_Spatial_Coherence/network_spatial_coherence/viz_3d.html)
## 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.6",
"maintainer_email": null,
"keywords": null,
"author": "David Fernandez Bonet",
"author_email": "dfb@kth.se",
"download_url": "https://files.pythonhosted.org/packages/61/3d/e06a24d1c01cf0907ecacbadb9950f0a874f2e6ace1333c8a8eeb7fc9630/network_spatial_coherence-0.1.197.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 detailed methodologies, 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\n## Further information\n- [Usage and Examples](./network_spatial_coherence/markdown_files/usage.md)\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- [Interactive Visualization](https://DavidFernandezBonet.github.io/Network_Spatial_Coherence/network_spatial_coherence/viz_3d.html)\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.197",
"project_urls": {
"Homepage": "https://github.com/DavidFernandezBonet/Spatial Constant Analysis"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8b871343c69052eef4b7a28a0dcf893bb7ae3758ad621884d60de2e49318e6af",
"md5": "75c51f07adf7a6a71deb2d722084373c",
"sha256": "55bf74f1e934d8fa21c260febfcd70858339dab4c7a64863e6ae2ea10a85404f"
},
"downloads": -1,
"filename": "network_spatial_coherence-0.1.197-py3-none-any.whl",
"has_sig": false,
"md5_digest": "75c51f07adf7a6a71deb2d722084373c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 4795315,
"upload_time": "2024-08-21T09:15:25",
"upload_time_iso_8601": "2024-08-21T09:15:25.009261Z",
"url": "https://files.pythonhosted.org/packages/8b/87/1343c69052eef4b7a28a0dcf893bb7ae3758ad621884d60de2e49318e6af/network_spatial_coherence-0.1.197-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "613de06a24d1c01cf0907ecacbadb9950f0a874f2e6ace1333c8a8eeb7fc9630",
"md5": "dda1a5d2688433ff474241e01c13ec76",
"sha256": "836c7025a85289175fb572052d663fb69d0263be97e816c634948d9c649d59f4"
},
"downloads": -1,
"filename": "network_spatial_coherence-0.1.197.tar.gz",
"has_sig": false,
"md5_digest": "dda1a5d2688433ff474241e01c13ec76",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 4743652,
"upload_time": "2024-08-21T09:15:27",
"upload_time_iso_8601": "2024-08-21T09:15:27.597490Z",
"url": "https://files.pythonhosted.org/packages/61/3d/e06a24d1c01cf0907ecacbadb9950f0a874f2e6ace1333c8a8eeb7fc9630/network_spatial_coherence-0.1.197.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-08-21 09:15:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "DavidFernandezBonet",
"github_project": "Spatial Constant Analysis",
"github_not_found": true,
"lcname": "network-spatial-coherence"
}