Convert ORCA node-orbit vectors (15/73) into global graphlet count vectors.
Project description
orca-globalizer
Convert ORCA per-node orbit vectors into global graphlet count vectors.
Install (editable)
pip install -e .
Usage
import numpy as np from orca_globalizer import globalize_orca
node_vectors = np.loadtxt("orca_output.txt") # N x 15 (orca_node=4) or N x 73 (orca_node=5) g = globalize_orca(node_vectors, orca_node=5, method="sum", log_transform=False) print(g.shape) # (30,)
Output modes: method="sum" vs method="frequency"
ORCA produces per-node orbit counts: a matrix of shape (N nodes × O orbits) where each entry tells you how many times that node participates in that orbit.
This package converts those node-level orbit counts into a global graphlet vector.
method="sum" (global graphlet counts)
Returns global counts of each graphlet type (e.g., how many triangles, how many 4-cycles, etc.).
How it works:
- Sum orbit counts across all nodes (total “node-incidences” per orbit).
- Group orbit columns that belong to the same graphlet and sum them.
- Divide by the number of nodes in that graphlet (2 / 3 / 4 / 5) to undo multi-counting.
Why the division?
Each graphlet instance touches k nodes, so when you sum over nodes it contributes k times.
Example: 10 triangles → 30 node-incidences (3 per triangle) → 30 / 3 = 10 triangles.
method="frequency" (normalized distribution)
Returns a normalized version of the global counts so the vector sums to 1:
freq[i] = count[i] / sum(count)
Interpretation:
freq[i]is the fraction of all counted graphlets (in the output vector) that are of typeGi.- Useful for comparing graphs of different sizes/densities.
Log transform (optional)
If log_transform=True, the package applies a log1p transform (i.e., log(1 + x)) to reduce heavy-tailed dominance.
For method="frequency":
- If
log_before_normalize=True(default): log then normalize - If
log_before_normalize=False: normalize then log
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 orca_globalizer-0.1.0.tar.gz.
File metadata
- Download URL: orca_globalizer-0.1.0.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8824f1139a072595511d28a98c03f5dc014bff55561cea33b44ed39c51096bc1
|
|
| MD5 |
1fbd6a7648f1ab0f089126575d16f226
|
|
| BLAKE2b-256 |
1595f88d7204f242eb6b8df2399006e0a29246c66f9df0327a568cc5d4e26b1a
|
File details
Details for the file orca_globalizer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: orca_globalizer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f8358956cbe2842ffba7ec4c80c748e982fbe7b1e9e714e155a65c6519519bc4
|
|
| MD5 |
6cf71542fea3a7061e754811421a3339
|
|
| BLAKE2b-256 |
1c88a785297d8a9a3fcde66729459a952e5cb275d4efa60087a0c67a8d30b4be
|