BigSMILES Parser
Project description
BigSMILES Parser
SMILES (simplified molecular-input line-entry system) representation is a line notation for molecules with given deterministic molecular structures.
BigSMILES is an extension to SMILES which provides support for molecules that contain stochastic molecular structures.
Learn more about BigSMILES Notation
Installation
Pip installable package available
pip install bigsmiles
Requirements / Dependencies
Python 3.10+
Basic Usage
Print Tree
Code:
import bigsmiles
polymer_string = "CC{[>][<]CC(C)[>][<]}CC(C)=C"
polymer = bigsmiles.BigSMILES(polymer_string)
polymer.print_tree()
Output:
BigSMILES: CC{[>][<]CC(C)[>][<]}CC(C)=C
├── Atom: C
├── Bond:
├── Atom: C
├── Bond:
├── StochasticObject: {[>][<]CC(C)[>][<]}
│ └── StochasticFragment: [<]CC(C)[>]
│ ├── BondDescriptor: [<]
│ ├── Bond:
│ ├── Atom: C
│ ├── Bond:
│ ├── Atom: C
│ ├── Branch: (C)
│ │ ├── Bond:
│ │ └── Atom: C
│ ├── Bond:
│ └── BondDescriptor: [>]
├── Bond:
├── Atom: C
├── Bond:
├── Atom: C
├── Branch: (C)
│ ├── Bond:
│ └── Atom: C
├── Bond: =
└── Atom: C
Abstract Syntax Tree
root node: BigSMILES
intermediate nodes: StochasticObject
, StochasticFragment
, Branch
leaf nodes: BondDescriptor
, Atom
, Bond
The tree structure is built through the nodes
attribute.
classDiagram
class BigSMILES {
list: nodes
}
class StochasticObject {
int: id_
list: nodes
BondingDescriptor: end_group_left
BondingDescriptor: end_group_right
}
class StochasticFragment {
int: id_
list: nodes
}
class Branch {
int: id_
list: nodes
}
class BondDescriptor {
int: id_
str: symbol
Enum: type_
int: index_
}
class Bond {
int: id_
str: symbol
Enum: type_
Atom: atom1
Atom: atom2
int: ring
}
class Atom {
int: id_
str: symbol
Enum: type_
int: isotope
int: charge
Enum: chiral
int: valance
bool: orgainic
list[Bond]: bonds
}
BigSMILES --|> Atom
BigSMILES --|> Bond
BigSMILES --|> Branch
BigSMILES --|> StochasticObject
StochasticObject --|> StochasticFragment
StochasticFragment --|> BondDescriptor
StochasticFragment --|> Atom
StochasticFragment --|> Bond
StochasticFragment --|> Branch
StochasticFragment --|> StochasticObject
Branch --|> BondDescriptor
Branch --|> StochasticObject
Branch --|> Bond
Branch --|> Atom
Advanced Options
Colored outputs
import bigsmiles
bigsmiles.Config.color_output = True
BigSMILES: CC { [>] [<] CC(C) [>] [<] } CC(C)=C
Features NOT implemented yet
- Cis/Trans
- Fragment Notation
- ladder polymers
- mixture notation '.'
- reactions
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bigsmiles-0.0.2.tar.gz
(13.8 kB
view hashes)
Built Distribution
bigsmiles-0.0.2-py3-none-any.whl
(14.3 kB
view hashes)
Close
Hashes for bigsmiles-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d54ee2e977692f92c1ad2067168c548c3b936a3ce28fd489fcc19f564a73f08b |
|
MD5 | 3f1e712e8b9fcd7e181f09d13f812449 |
|
BLAKE2b-256 | a2ea1490f578460dfc61e08e6ff1aefd426bf7108f9e5d88d9c83646142940b9 |