Skip to main content

Crate gchemol_geometry

Crate gchemol_geometry 

Source
Expand description

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

Modules§

prelude
random
Generate 3D coordinates randomly

Structs§

AlignmentDeprecated
Alignment of candidate structure onto the reference
Superpose
Superpose of candidate structure onto the reference
Superposition
The result of alignment defining how to superimpose.

Enums§

SuperpositionAlgo

Functions§

euclidean_distance
Return Cartesian distance between two points in 3D space.
weighted_center_of_geometry
Return the weighted geometric center

Type Aliases§

Coord3
Three-dimensional Cartesian coordinates
Superimpose
Alias name of Superpose