Calculate structural properties of graphs and subgraphs based on node attributes.
Project description
Graph Structure
Package focused on reading and analyzing graphs structures. It will perform a structural analysis on an undirected graph and their attribute-defined subgraphs. By providing an edge list and node attributes, it will automate the extraction of the following metrics of the graph and attribute-based subgraph:
- Number of nodes.
- Number of edges.
- Graph density.
- Number of connected components.
- Transitivity.
- Node-level characteristics:
- Node Degree Distribution.
- Betweenness centrality distribution.
- Closeness centrality distribution
- Edge-level characteristics (if weighted graph):
- Edges weight distribution
- Assortativity of the selected attribute
For the distributions, it also include descriptive statistics that summarize the central tendency, dispersion and shape of each property.
Installation
pip install graph-structure
Upgrade to a newer version using:
pip install graph-structure --upgrade
Usage
usage: graph_structure [-h] -e EDGES_FILE -n NODE_FILE -a ATTRIBUTE [-o OUTPUT_DIR]
Structural properties analysis of graph and attribute-base subgraphs
options:
-h, --help show this help message and exit
-e, --edges-file EDGES_FILE
Input TSV file with edges.
-n, --node-file NODE_FILE
Input TSV file with node attributes.
-a, --attribute ATTRIBUTE
Name of the attribute for subgraphs
-o, --output-dir OUTPUT_DIR
Directory for output files.
Input format
The input formats are the same as those accepted for cytoscape to import a network and attributes from table.
1. Network Edges File
A two or three-column tab-delimited file. The header must include Source and Target (and optionally Weight).
Source Target Weight
node01 node03 85.71
node01 node04 90.91
node01 node06 95.24
node02 node05 90.91
node02 node09 70.42
node03 node04 67.65
node03 node06 95.0
node05 node09 94.12
node07 node08 100
node10
2. Node Attribute File
A tab-delimited file with at least two columns. The first column must be named NodeID. Subsequent columns represent the attributes used for subgraph extraction.
NodeID GenomeID Country
node01 ID01 Sweden
node02 ID01 Sweden
node03 ID02 USA
node04 ID03 Norway
node05 ID03 Norway
node06 ID04 Sweden
node07 ID05 Spain
node08 ID05 Spain
node09 ID06 Denmark
node10 ID07 Japan
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file graph_structure-0.0.1.tar.gz.
File metadata
- Download URL: graph_structure-0.0.1.tar.gz
- Upload date:
- Size: 20.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
68d2c0f989cc488a185bec8888e771c137b0ecf7e8f9b97e47560c6ee8b24ffa
|
|
| MD5 |
5c29c4f320da3c649a55edca53f6fecc
|
|
| BLAKE2b-256 |
728cb85711101174218146271e1c8689f630157c12f6c863288d621e0b4706a8
|
Provenance
The following attestation bundles were made for graph_structure-0.0.1.tar.gz:
Publisher:
publish.yml on andres2901/graph_structure
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
graph_structure-0.0.1.tar.gz -
Subject digest:
68d2c0f989cc488a185bec8888e771c137b0ecf7e8f9b97e47560c6ee8b24ffa - Sigstore transparency entry: 1181097748
- Sigstore integration time:
-
Permalink:
andres2901/graph_structure@3b77b3eaa4a2a7119a28b68091b097b03473d843 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/andres2901
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3b77b3eaa4a2a7119a28b68091b097b03473d843 -
Trigger Event:
release
-
Statement type:
File details
Details for the file graph_structure-0.0.1-py3-none-any.whl.
File metadata
- Download URL: graph_structure-0.0.1-py3-none-any.whl
- Upload date:
- Size: 32.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a9abb01accf05906cc7490ed3529ad5528fef66d4177b975b1864c229b453ef
|
|
| MD5 |
e0564eb30c17cac100096563b9945f8c
|
|
| BLAKE2b-256 |
7da4273f77d6bf2695aaf52900d6511fc149c5a4c71a92a6213a2dbef2196e36
|
Provenance
The following attestation bundles were made for graph_structure-0.0.1-py3-none-any.whl:
Publisher:
publish.yml on andres2901/graph_structure
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
graph_structure-0.0.1-py3-none-any.whl -
Subject digest:
6a9abb01accf05906cc7490ed3529ad5528fef66d4177b975b1864c229b453ef - Sigstore transparency entry: 1181097771
- Sigstore integration time:
-
Permalink:
andres2901/graph_structure@3b77b3eaa4a2a7119a28b68091b097b03473d843 -
Branch / Tag:
refs/tags/v0.0.1 - Owner: https://github.com/andres2901
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3b77b3eaa4a2a7119a28b68091b097b03473d843 -
Trigger Event:
release
-
Statement type: