-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path__init__.py
More file actions
33 lines (29 loc) · 977 Bytes
/
Copy path__init__.py
File metadata and controls
33 lines (29 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""MoleCode — polymer representation.
Converts polymer repeat units (PSMILES with two ``*`` attachment points) and
block copolymers into a MoleCode Mermaid graph that keeps the repeat unit
explicit and carries the repetition count symbolically as ``×n``, and parses
that graph back to a canonical PSMILES.
>>> from molecode.polymer import polymer_to_mermaid, mermaid_to_psmiles
>>> mermaid = polymer_to_mermaid("*CC*", n=1000, name="Polyethylene")
>>> mermaid_to_psmiles(mermaid)
'*CC*'
"""
from .polymer_to_mermaid import (
BlockSpec,
PolymerSpec,
RepeatUnitConverter,
PolymerToMermaidConverter,
polymer_to_mermaid,
block_copolymer_to_mermaid,
)
from .mermaid_to_psmiles import mermaid_to_psmiles, parse_element
__all__ = [
"BlockSpec",
"PolymerSpec",
"RepeatUnitConverter",
"PolymerToMermaidConverter",
"polymer_to_mermaid",
"block_copolymer_to_mermaid",
"mermaid_to_psmiles",
"parse_element",
]