Crates.io | graph_symmetry |
lib.rs | graph_symmetry |
version | 0.1.1 |
source | src |
created_at | 2021-11-05 09:10:11.052627 |
updated_at | 2021-11-07 06:53:11.396445 |
description | Symmetry perception for graphs and its applications on canonicalization |
homepage | https://github.com/chiral-data/rust-graph-symmetry |
repository | https://github.com/chiral-data/rust-graph-symmetry |
max_upload_size | |
id | 477247 |
size | 188,354 |
Symmetry perception algorithm for graphs and its applications on canonicalization implemented in Rust
use graph_symmetry;
assert_eq!(graph_symmetry::ext::molecule::get_canon_smiles(&String::from("c1ccccc1CN")), "NCc1ccccc1".to_string());
use graph_symmetry;
let atom_vec = graph_symmetry::ext::molecule::smiles_to_atom_vec("C(C)(C)CCN");
let (orbits_givp, numbering) = graph_symmetry::ext::molecule::symmetry_perception_givp(&atom_vec);
assert_eq!(orbits_givp, vec![vec![1, 2]]);
assert_eq!(numbering, vec![6, 2, 2, 5, 4, 3]);
let (orbits_cnap) = graph_symmetry::ext::molecule::symmetry_perception_cnap(&atom_vec, &orbits_givp, &numbering);
assert_eq!(orbits_cnap, vec![vec![1, 2]]);
cargo test --lib
cargo test --test chembl_test
cargo test --test krotko_test