#gchemol #objects #atoms #alignment #che-mical #superpose #graph-based

gchemol-geometry

gchemol: a Graph-based CHEMical Objects Library

7 releases

0.1.1 Dec 8, 2022
0.1.0 Mar 23, 2022
0.0.41 Feb 19, 2022
0.0.39 Mar 10, 2020
0.0.38 Feb 14, 2020

#667 in Algorithms

Download history 18/week @ 2023-11-20 19/week @ 2023-11-27 4/week @ 2023-12-04 10/week @ 2023-12-11 20/week @ 2023-12-18 14/week @ 2023-12-25 27/week @ 2024-01-08 14/week @ 2024-01-15 5/week @ 2024-01-22 2/week @ 2024-01-29 17/week @ 2024-02-05 30/week @ 2024-02-12 26/week @ 2024-02-19 64/week @ 2024-02-26 25/week @ 2024-03-04

145 downloads per month
Used in 16 crates (2 directly)

GPL-3.0 license

48KB
837 lines

Example

use gchemol::geom::Superpose;
use gchemol::Molecule;
use gchemol::prelude::*;

// load test molecules
let mol1 = Molecule::from_file("tests/files/alignment/reference.mol2").unwrap();
let mol2 = Molecule::from_file("tests/files/alignment/candidate.mol2").unwrap();

// take the first 5 atoms for superposition
let reference: Vec<_> = mol1.positions().take(5).collect();
let candidate: Vec<_> = mol2.positions().take(5).collect();

// align the candidate onto the reference
let sp = Superpose::new(&candidate).onto(&reference, None);

// apply superposition to all atoms
let superimposed_structure = sp.apply(&candidate);

// apply translation only
let translated_structure = sp.apply_translation(&candidate);

Dependencies

~11–24MB
~334K SLoC