molbuilder 1.0.0__py3-none-any.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.
- molbuilder/__init__.py +8 -0
- molbuilder/__main__.py +6 -0
- molbuilder/atomic/__init__.py +4 -0
- molbuilder/atomic/bohr.py +235 -0
- molbuilder/atomic/quantum_atom.py +334 -0
- molbuilder/atomic/quantum_numbers.py +196 -0
- molbuilder/atomic/wavefunctions.py +297 -0
- molbuilder/bonding/__init__.py +4 -0
- molbuilder/bonding/covalent.py +442 -0
- molbuilder/bonding/lewis.py +347 -0
- molbuilder/bonding/vsepr.py +433 -0
- molbuilder/cli/__init__.py +1 -0
- molbuilder/cli/demos.py +516 -0
- molbuilder/cli/menu.py +127 -0
- molbuilder/cli/wizard.py +831 -0
- molbuilder/core/__init__.py +6 -0
- molbuilder/core/bond_data.py +170 -0
- molbuilder/core/constants.py +51 -0
- molbuilder/core/element_properties.py +183 -0
- molbuilder/core/elements.py +181 -0
- molbuilder/core/geometry.py +232 -0
- molbuilder/gui/__init__.py +2 -0
- molbuilder/gui/app.py +286 -0
- molbuilder/gui/canvas3d.py +115 -0
- molbuilder/gui/dialogs.py +117 -0
- molbuilder/gui/event_handler.py +118 -0
- molbuilder/gui/sidebar.py +105 -0
- molbuilder/gui/toolbar.py +71 -0
- molbuilder/io/__init__.py +1 -0
- molbuilder/io/json_io.py +146 -0
- molbuilder/io/mol_sdf.py +169 -0
- molbuilder/io/pdb.py +184 -0
- molbuilder/io/smiles_io.py +47 -0
- molbuilder/io/xyz.py +103 -0
- molbuilder/molecule/__init__.py +2 -0
- molbuilder/molecule/amino_acids.py +919 -0
- molbuilder/molecule/builders.py +257 -0
- molbuilder/molecule/conformations.py +70 -0
- molbuilder/molecule/functional_groups.py +484 -0
- molbuilder/molecule/graph.py +712 -0
- molbuilder/molecule/peptides.py +13 -0
- molbuilder/molecule/stereochemistry.py +6 -0
- molbuilder/process/__init__.py +3 -0
- molbuilder/process/conditions.py +260 -0
- molbuilder/process/costing.py +316 -0
- molbuilder/process/purification.py +285 -0
- molbuilder/process/reactor.py +297 -0
- molbuilder/process/safety.py +476 -0
- molbuilder/process/scale_up.py +427 -0
- molbuilder/process/solvent_systems.py +204 -0
- molbuilder/reactions/__init__.py +3 -0
- molbuilder/reactions/functional_group_detect.py +728 -0
- molbuilder/reactions/knowledge_base.py +1716 -0
- molbuilder/reactions/reaction_types.py +102 -0
- molbuilder/reactions/reagent_data.py +1248 -0
- molbuilder/reactions/retrosynthesis.py +1430 -0
- molbuilder/reactions/synthesis_route.py +377 -0
- molbuilder/reports/__init__.py +158 -0
- molbuilder/reports/cost_report.py +206 -0
- molbuilder/reports/molecule_report.py +279 -0
- molbuilder/reports/safety_report.py +296 -0
- molbuilder/reports/synthesis_report.py +283 -0
- molbuilder/reports/text_formatter.py +170 -0
- molbuilder/smiles/__init__.py +4 -0
- molbuilder/smiles/parser.py +487 -0
- molbuilder/smiles/tokenizer.py +291 -0
- molbuilder/smiles/writer.py +375 -0
- molbuilder/visualization/__init__.py +1 -0
- molbuilder/visualization/bohr_viz.py +166 -0
- molbuilder/visualization/molecule_viz.py +368 -0
- molbuilder/visualization/quantum_viz.py +434 -0
- molbuilder/visualization/theme.py +12 -0
- molbuilder-1.0.0.dist-info/METADATA +360 -0
- molbuilder-1.0.0.dist-info/RECORD +78 -0
- molbuilder-1.0.0.dist-info/WHEEL +5 -0
- molbuilder-1.0.0.dist-info/entry_points.txt +2 -0
- molbuilder-1.0.0.dist-info/licenses/LICENSE +21 -0
- molbuilder-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"""Reaction categories, templates, and data structures."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from dataclasses import dataclass, field
|
|
5
|
+
from enum import Enum, auto
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ReactionCategory(Enum):
|
|
9
|
+
SUBSTITUTION = auto()
|
|
10
|
+
ELIMINATION = auto()
|
|
11
|
+
ADDITION = auto()
|
|
12
|
+
OXIDATION = auto()
|
|
13
|
+
REDUCTION = auto()
|
|
14
|
+
COUPLING = auto()
|
|
15
|
+
CARBONYL = auto()
|
|
16
|
+
PROTECTION = auto()
|
|
17
|
+
DEPROTECTION = auto()
|
|
18
|
+
REARRANGEMENT = auto()
|
|
19
|
+
RADICAL = auto()
|
|
20
|
+
PERICYCLIC = auto()
|
|
21
|
+
POLYMERIZATION = auto()
|
|
22
|
+
MISC = auto()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@dataclass
|
|
26
|
+
class ReactionTemplate:
|
|
27
|
+
"""A curated reaction template for synthesis planning.
|
|
28
|
+
|
|
29
|
+
Each template captures the essential information needed to evaluate
|
|
30
|
+
whether a reaction is applicable to a given substrate and to estimate
|
|
31
|
+
its likely outcome. Templates are consumed by the retrosynthetic
|
|
32
|
+
planner and by the forward-synthesis scoring engine.
|
|
33
|
+
|
|
34
|
+
Attributes
|
|
35
|
+
----------
|
|
36
|
+
name : str
|
|
37
|
+
Short human-readable name for the transformation.
|
|
38
|
+
named_reaction : str | None
|
|
39
|
+
Conventional named-reaction label (e.g. "Suzuki coupling").
|
|
40
|
+
category : ReactionCategory
|
|
41
|
+
Broad classification of the reaction type.
|
|
42
|
+
reagents : list[str]
|
|
43
|
+
Required reagents (stoichiometric).
|
|
44
|
+
solvents : list[str]
|
|
45
|
+
Suitable solvents.
|
|
46
|
+
catalysts : list[str]
|
|
47
|
+
Catalysts or co-catalysts (may be empty).
|
|
48
|
+
temperature_range : tuple[float, float]
|
|
49
|
+
Typical temperature window in degrees Celsius.
|
|
50
|
+
typical_yield : tuple[float, float]
|
|
51
|
+
Expected isolated-yield range in percent.
|
|
52
|
+
functional_group_required : list[str]
|
|
53
|
+
Functional groups that must be present on the substrate.
|
|
54
|
+
functional_group_produced : list[str]
|
|
55
|
+
Functional groups introduced or revealed by the reaction.
|
|
56
|
+
functional_group_incompatible : list[str]
|
|
57
|
+
Functional groups that would be destroyed or interfere.
|
|
58
|
+
mechanism : str
|
|
59
|
+
One- or two-sentence description of the mechanism.
|
|
60
|
+
reverse_transform : str
|
|
61
|
+
Description of the retrosynthetic disconnection.
|
|
62
|
+
scale_notes : str
|
|
63
|
+
Practical notes on scaling the reaction.
|
|
64
|
+
safety_notes : str
|
|
65
|
+
Hazard or handling warnings.
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
name: str
|
|
69
|
+
named_reaction: str | None
|
|
70
|
+
category: ReactionCategory
|
|
71
|
+
reagents: list[str]
|
|
72
|
+
solvents: list[str]
|
|
73
|
+
catalysts: list[str] = field(default_factory=list)
|
|
74
|
+
temperature_range: tuple[float, float] = (20.0, 25.0)
|
|
75
|
+
typical_yield: tuple[float, float] = (60.0, 90.0)
|
|
76
|
+
functional_group_required: list[str] = field(default_factory=list)
|
|
77
|
+
functional_group_produced: list[str] = field(default_factory=list)
|
|
78
|
+
functional_group_incompatible: list[str] = field(default_factory=list)
|
|
79
|
+
mechanism: str = ""
|
|
80
|
+
reverse_transform: str = ""
|
|
81
|
+
scale_notes: str = ""
|
|
82
|
+
safety_notes: str = ""
|
|
83
|
+
|
|
84
|
+
# ------------------------------------------------------------------
|
|
85
|
+
# helpers
|
|
86
|
+
# ------------------------------------------------------------------
|
|
87
|
+
|
|
88
|
+
def requires(self, fg_name: str) -> bool:
|
|
89
|
+
"""Return True if *fg_name* is among the required functional groups."""
|
|
90
|
+
return fg_name.lower() in [f.lower() for f in self.functional_group_required]
|
|
91
|
+
|
|
92
|
+
def produces(self, fg_name: str) -> bool:
|
|
93
|
+
"""Return True if *fg_name* is among the produced functional groups."""
|
|
94
|
+
return fg_name.lower() in [f.lower() for f in self.functional_group_produced]
|
|
95
|
+
|
|
96
|
+
def is_compatible(self, fg_names: list[str]) -> bool:
|
|
97
|
+
"""Return True if none of *fg_names* appear in the incompatible list."""
|
|
98
|
+
incompat = {f.lower() for f in self.functional_group_incompatible}
|
|
99
|
+
return not any(fg.lower() in incompat for fg in fg_names)
|
|
100
|
+
|
|
101
|
+
def __repr__(self) -> str:
|
|
102
|
+
return f"ReactionTemplate({self.name}, {self.category.name})"
|