Repository navigation
Create Molecule Graph
New Features
- Create Molecule Graph: A new method
create_molecule_graphhas been added to create a molecule graph from a given molecule source. - Molecule Source Definition: A new set of rules has been introduced to define the molecule source, including connection points (*), chain references ({}), and bond types.
Molecule Source Definition Rules
*represents a connection point.- {} is used to reference another chain.
- Bond index starts from 1 in all chains.
- Supported bond types: single bond (-), double bond (=), and triple bond (#).
Example Usage
molecule_src = {
'MainChain': ["C1-C2", "C2-C3", "C3*{Chain1}", "C3-C4", "C4*{Chain2}", "C4-C5", "C5-C6"],
'Chain1': ["C1=C2", "C2-C3", "C3=*"],
'Chain2': ["*-C1", "C1=C2", "C2-XX3"]
}
mol_graph = mi.create_molecule_graph(molecule_src, molecule_name='my_molecule')
print(mol_graph)
mol_graph.d("my_molecule")molecule_src = {
'MainChain': ["C1-C2", "C2=C3", "C3-C4", "C3*{Chain1}", "C4=C5", "C5*{Chain1}", "C5-C6", "C6=C1", "C6*{Chain2}"],
'Chain1': ["C1=C2", "C2-C3", "C3=*"],
'Chain2': ["*-C1", "C1=C2", "C2-XX3"]
}
# * create molecule graph
mol_graph = mi.create_molecule_graph(molecule_src, molecule_name='my_molecule')
print(mol_graph)
# display molecule graph
mol_graph.d("my_molecule")
