| Crates.io | atria-rs |
| lib.rs | atria-rs |
| version | 1.3.0 |
| created_at | 2026-01-03 21:57:09.224855+00 |
| updated_at | 2026-01-03 22:47:02.808155+00 |
| description | Library for running the Ablatio Triadum (ATria) centrality algorithm (Cickovski et al, 2015, 2017). |
| homepage | |
| repository | https://github.com/quinnjr/ATria-rs |
| max_upload_size | |
| id | 2020858 |
| size | 152,349 |
A reimplementation of the ATria algorithm in Rust.
Library for the Ablatio Triadum (ATria) centrality algorithm (Cickovski et al, 2015, 2017).
ATria can run on signed and weighted networks and produces a list of central nodes as both screen output and as a NOde Attribute (NOA) file for Cytoscape. The NOA file can subsequently be imported into Cytoscape resulting in centrality values becoming node attributes and enabling further analysis and visualization based on these values.
The input network should be specified in CSV format with nodes as rows and columns and entry (i, j) representing the weight of the edge from node i to node j.
The output is a NOA file, with both centrality value and rank as attributes. Larger magnitude values indicate higher centrality for both centrality and rank. This is typically more convenient for visualization, etc.
Add to your Cargo.toml:
[dependencies]
atria-rs = { git = "https://github.com/quinnjr/ATria-rs" }
To enable wgpu GPU acceleration (Vulkan/Metal/DX12):
[dependencies]
atria-rs = { git = "https://github.com/quinnjr/ATria-rs", features = ["gpu"] }
To enable NVIDIA CUDA acceleration:
[dependencies]
atria-rs = { git = "https://github.com/quinnjr/ATria-rs", features = ["cuda"] }
[dependencies]
atria-rs = { git = "https://github.com/quinnjr/ATria-rs", features = ["gpu", "cuda"] }
use ATriaPlugin::ATriaPlugin;
use pluma_plugin_trait::PluMAPlugin;
fn main() {
let mut plugin = ATriaPlugin::default();
// Load input CSV
plugin.input("path/to/network.csv".to_string()).unwrap();
// Run ATria algorithm
plugin.run().unwrap();
// Write output NOA file
plugin.output("path/to/output.noa".to_string()).unwrap();
}
use ATriaPlugin::{ATriaPlugin, ComputeBackend};
use pluma_plugin_trait::PluMAPlugin;
fn main() {
// Create plugin with specific backend
let mut plugin = ATriaPlugin::with_backend(ComputeBackend::Cuda);
// Or use auto-detection (prefers CUDA > GPU > CPU)
// let mut plugin = ATriaPlugin::with_backend(ComputeBackend::Auto);
// Check available backends
println!("CUDA available: {}", plugin.is_cuda_available());
println!("GPU available: {}", plugin.is_gpu_available());
println!("Effective backend: {:?}", plugin.effective_backend());
plugin.input("path/to/network.csv".to_string()).unwrap();
plugin.run().unwrap();
plugin.output("path/to/output.noa".to_string()).unwrap();
}
| Backend | Description | Feature |
|---|---|---|
ComputeBackend::Cpu |
CPU-only computation (default) | - |
ComputeBackend::Gpu |
wgpu GPU acceleration (Vulkan/Metal/DX12) | gpu |
ComputeBackend::Cuda |
NVIDIA CUDA acceleration | cuda |
ComputeBackend::Auto |
Best available (CUDA > GPU > CPU) | - |
# CPU-only build
cargo build --release
# With wgpu GPU support
cargo build --release --features gpu
# With CUDA support
cargo build --release --features cuda
# With all GPU backends
cargo build --release --features "gpu cuda"
cargo test
This project uses Criterion v0.8 for benchmarking. Run benchmarks with:
cargo bench
The implementation includes several optimizations for the core Floyd-Warshall algorithm:
Benchmark results on a 126-bacteria network (252×252 matrix):
| Operation | CPU Time |
|---|---|
| Floyd-Warshall (252×252) | ~12.9 ms |
| Full ATria run | ~425 ms |
| Input parsing | ~183 µs |
When using the gpu feature, the following backends are supported:
When using the cuda feature:
| Crate | Version | Purpose |
|---|---|---|
| csv | 1.1 | CSV file parsing |
| log | 0.4 | Logging framework |
| rayon | 1.4 | Parallel processing |
| Crate | Version | Purpose |
|---|---|---|
| wgpu | 0.20 | Cross-platform GPU compute |
| pollster | 0.3 | Async runtime |
| bytemuck | 1.16 | Safe buffer casting |
| Crate | Version | Purpose |
|---|---|---|
| cudarc | 0.12 | CUDA runtime bindings |
ATria-rs/
├── src/
│ ├── lib.rs # Main library with ATriaPlugin
│ ├── gpu.rs # wgpu GPU module (optional)
│ ├── cuda.rs # CUDA module (optional)
│ ├── shaders/
│ │ └── floyd_warshall.wgsl # WGSL compute shader
│ └── kernels/
│ └── floyd_warshall.cu # CUDA kernel
├── benches/
│ └── atria_benchmark.rs # Criterion benchmarks
├── tests/
│ ├── corrP.never.csv # Test input data
│ └── corrP.never.noa.expected # Expected output
├── Cargo.toml
├── CHANGELOG.md
├── LICENSE.md
└── README.md
MIT