graph_symmetry

Crates.iograph_symmetry
lib.rsgraph_symmetry
version0.1.1
sourcesrc
created_at2021-11-05 09:10:11.052627
updated_at2021-11-07 06:53:11.396445
descriptionSymmetry perception for graphs and its applications on canonicalization
homepagehttps://github.com/chiral-data/rust-graph-symmetry
repositoryhttps://github.com/chiral-data/rust-graph-symmetry
max_upload_size
id477247
size188,354
Qin WAN (rogerwq)

documentation

https://docs.rs/graph_symmetry

README

Crate graph_symmetry

Symmetry perception algorithm for graphs and its applications on canonicalization implemented in Rust

Examples

SMILES canonicalization

use graph_symmetry;

assert_eq!(graph_symmetry::ext::molecule::get_canon_smiles(&String::from("c1ccccc1CN")), "NCc1ccccc1".to_string());

Symmetry perception

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]]);

Tests

Unit tests

cargo test --lib

Integration tests

cargo test --test chembl_test
cargo test --test krotko_test
Commit count: 5

cargo fmt