bentopy 0.2.0a10__cp313-cp313-manylinux_2_34_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bentopy-0.2.0a10.data/scripts/bentopy-init +0 -0
- bentopy-0.2.0a10.data/scripts/bentopy-pack +0 -0
- bentopy-0.2.0a10.data/scripts/bentopy-render +0 -0
- bentopy-0.2.0a10.data/scripts/bentopy-solvate +0 -0
- bentopy-0.2.0a10.dist-info/METADATA +358 -0
- bentopy-0.2.0a10.dist-info/RECORD +58 -0
- bentopy-0.2.0a10.dist-info/WHEEL +5 -0
- bentopy-0.2.0a10.dist-info/entry_points.txt +4 -0
- bentopy-0.2.0a10.dist-info/licenses/LICENSE.txt +13 -0
- bentopy-0.2.0a10.dist-info/top_level.txt +8 -0
- check/check.py +128 -0
- core/config/bent/lexer.rs +338 -0
- core/config/bent/parser.rs +1180 -0
- core/config/bent/writer.rs +205 -0
- core/config/bent.rs +149 -0
- core/config/compartment_combinations.rs +300 -0
- core/config/legacy.rs +768 -0
- core/config.rs +362 -0
- core/mod.rs +4 -0
- core/placement.rs +100 -0
- core/utilities.rs +1 -0
- core/version.rs +32 -0
- init/example.bent +74 -0
- init/main.rs +235 -0
- mask/config.py +153 -0
- mask/mask.py +308 -0
- mask/utilities.py +38 -0
- merge/merge.py +175 -0
- pack/args.rs +77 -0
- pack/main.rs +121 -0
- pack/mask.rs +940 -0
- pack/session.rs +176 -0
- pack/state/combinations.rs +31 -0
- pack/state/compartment.rs +44 -0
- pack/state/mask.rs +196 -0
- pack/state/pack.rs +187 -0
- pack/state/segment.rs +72 -0
- pack/state/space.rs +98 -0
- pack/state.rs +440 -0
- pack/structure.rs +185 -0
- pack/voxelize.rs +85 -0
- render/args.rs +109 -0
- render/limits.rs +73 -0
- render/main.rs +12 -0
- render/render.rs +393 -0
- render/structure.rs +264 -0
- solvate/args.rs +324 -0
- solvate/convert.rs +25 -0
- solvate/cookies.rs +185 -0
- solvate/main.rs +177 -0
- solvate/placement.rs +380 -0
- solvate/solvate.rs +244 -0
- solvate/structure.rs +160 -0
- solvate/substitute.rs +113 -0
- solvate/water/martini.rs +409 -0
- solvate/water/models.rs +150 -0
- solvate/water/tip3p.rs +658 -0
- solvate/water.rs +115 -0
solvate/water.rs
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
use clap::ValueEnum;
|
|
2
|
+
use eightyseven::structure::Atom;
|
|
3
|
+
use glam::Vec3;
|
|
4
|
+
|
|
5
|
+
use crate::args::WaterType;
|
|
6
|
+
use crate::water::models::ResiduesIterator;
|
|
7
|
+
|
|
8
|
+
mod models;
|
|
9
|
+
|
|
10
|
+
#[derive(Debug, Default, Clone, Copy, ValueEnum, PartialEq, Eq)]
|
|
11
|
+
#[clap(rename_all = "lowercase")]
|
|
12
|
+
pub enum Water {
|
|
13
|
+
#[default]
|
|
14
|
+
Martini,
|
|
15
|
+
Tip3P,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
impl From<WaterType> for Water {
|
|
19
|
+
fn from(value: WaterType) -> Self {
|
|
20
|
+
match value {
|
|
21
|
+
WaterType::Martini => Self::Martini,
|
|
22
|
+
WaterType::Tip3P => Self::Tip3P,
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
impl Water {
|
|
28
|
+
/// Returns an iterator over the positions that must be considered for solvent-structure
|
|
29
|
+
/// collisions.
|
|
30
|
+
pub fn positions(&self) -> impl Iterator<Item = Vec3> {
|
|
31
|
+
match self {
|
|
32
|
+
Water::Martini => models::MARTINI.positions(),
|
|
33
|
+
Water::Tip3P => models::TIP3P.positions(),
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// TODO: All of these delegate functions can be resolved after the refactor.
|
|
38
|
+
/// Returns an iterator over the residues in this [`Water`].
|
|
39
|
+
fn residues(&'_ self) -> ResiduesIterator<'_> {
|
|
40
|
+
match self {
|
|
41
|
+
Water::Martini => models::MARTINI.residues(),
|
|
42
|
+
Water::Tip3P => models::TIP3P.residues(),
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
pub const fn dimensions(&self) -> Vec3 {
|
|
47
|
+
match self {
|
|
48
|
+
Water::Martini => models::MARTINI.dimensions(),
|
|
49
|
+
Water::Tip3P => models::TIP3P.dimensions(),
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
pub const fn resname(&self) -> &str {
|
|
54
|
+
match self {
|
|
55
|
+
Water::Martini => models::MARTINI.resname(),
|
|
56
|
+
Water::Tip3P => models::TIP3P.resname(),
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// TODO: Rename to natoms_per_residue?
|
|
61
|
+
pub const fn residue_points(&self) -> usize {
|
|
62
|
+
match self {
|
|
63
|
+
Water::Martini => models::MARTINI.residue_points(),
|
|
64
|
+
Water::Tip3P => models::TIP3P.residue_points(),
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/// Returns an iterator over the accepted atoms, ready to be written out.
|
|
69
|
+
pub fn spray<'w, 'a: 'w, A: Iterator<Item = bool>>(
|
|
70
|
+
&'w self,
|
|
71
|
+
mut occupied: A,
|
|
72
|
+
// resnum: &'a mut u32,
|
|
73
|
+
// atomnum: &'a mut u32,
|
|
74
|
+
translation: Vec3,
|
|
75
|
+
) -> impl Iterator<Item = Atom> + use<'w, A> {
|
|
76
|
+
let mut atomnum = 1;
|
|
77
|
+
let mut resnum = 1;
|
|
78
|
+
// TODO: Add the whole resnum atomnum thing back in!
|
|
79
|
+
self.residues()
|
|
80
|
+
.map(move |res| {
|
|
81
|
+
res.atoms(&mut atomnum, &mut resnum, translation)
|
|
82
|
+
.collect::<Box<[_]>>()
|
|
83
|
+
})
|
|
84
|
+
.filter(move |_atom| {
|
|
85
|
+
// TODO: Revisit the expect here. Can this happen in normal use? If so, can we make
|
|
86
|
+
// that impossible far before this function is executed. Otherwise, can we make it
|
|
87
|
+
// a nicer error? Or even an unimplemented!().
|
|
88
|
+
!occupied
|
|
89
|
+
.next()
|
|
90
|
+
.expect("occupied should have the same length as the number of residues")
|
|
91
|
+
})
|
|
92
|
+
.flatten()
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/// Returns an iterator over the accepted substitute positions.
|
|
96
|
+
pub fn substitute_positions<'w, 'a: 'w, A: Iterator<Item = bool>>(
|
|
97
|
+
&'w self,
|
|
98
|
+
mut occupied: A,
|
|
99
|
+
// resnum: &'a mut u32,
|
|
100
|
+
// atomnum: &'a mut u32,
|
|
101
|
+
translation: Vec3,
|
|
102
|
+
) -> impl Iterator<Item = Vec3> + use<'w, A> {
|
|
103
|
+
// TODO: Add the whole resnum atomnum thing back in!
|
|
104
|
+
self.positions()
|
|
105
|
+
.map(move |pos| pos + translation)
|
|
106
|
+
.filter(move |_atom| {
|
|
107
|
+
// TODO: Revisit the expect here. Can this happen in normal use? If so, can we make
|
|
108
|
+
// that impossible far before this function is executed. Otherwise, can we make it
|
|
109
|
+
// a nicer error? Or even an unimplemented!().
|
|
110
|
+
!occupied
|
|
111
|
+
.next()
|
|
112
|
+
.expect("occupied should have the same length as the number of residues")
|
|
113
|
+
})
|
|
114
|
+
}
|
|
115
|
+
}
|