Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graph_structure-0.0.1.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

graph_structure-0.0.1-py3-none-any.whl (32.2 kB view details)

Uploaded Python 3

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

Hashes for graph_structure-0.0.1.tar.gz
Algorithm Hash digest
SHA256 68d2c0f989cc488a185bec8888e771c137b0ecf7e8f9b97e47560c6ee8b24ffa
MD5 5c29c4f320da3c649a55edca53f6fecc
BLAKE2b-256 728cb85711101174218146271e1c8689f630157c12f6c863288d621e0b4706a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for graph_structure-0.0.1.tar.gz:

Publisher: publish.yml on andres2901/graph_structure

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file graph_structure-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for graph_structure-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6a9abb01accf05906cc7490ed3529ad5528fef66d4177b975b1864c229b453ef
MD5 e0564eb30c17cac100096563b9945f8c
BLAKE2b-256 7da4273f77d6bf2695aaf52900d6511fc149c5a4c71a92a6213a2dbef2196e36

See more details on using hashes here.

Provenance

The following attestation bundles were made for graph_structure-0.0.1-py3-none-any.whl:

Publisher: publish.yml on andres2901/graph_structure

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page