Repository navigation
Create Molecule Graph with Loop Chains
New Features
- Molecule Source with Different Chains: You can now define a molecule source with multiple chains, enabling the creation of complex molecular structures.
- Loop Chain Capability: A new feature allows you to define a loop chain, such as the benzene molecule, by adding asterisks (*) at the beginning and end of the bond sequence.
Chain Types
- Branch:
Chain1: ["*-C1", "C1=C2", "C2-C3", "C3=C4"] - Loop:
Chain1: ["*-C1", "C1=C2", "C2-C3", "C3=*"] - Bridge:
Chain1: ["*-C1", "C1=C2", "C2-C3", "C3=**"]
Example Usage
The following example demonstrates how to define a molecule source with multiple chains, including a loop chain:
molecule_src = { 'MainChain': ["C1*{Chain1}", "C1-C2", "C2*{Chain2}"], 'Chain1': ["*-C1", "C1=C2", "C2-C3", "C3=*"], 'Chain2': ["*-C1", "C1=C2", "C2-C3", "C3=*"], } # 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")
molecule_src = { 'MainChain': ["C1*{Chain1}", "C1-C2", "C2*{Chain2}", "C2-C3", "C3*{Chain3}"], 'Chain1': ["*-C1", "C1=C2", "C2-C3", "C3=*"], 'Chain2': ["*-C1", "C1=C2", "C2-C3", "C3=*"], 'Chain3': ["*-C1", "C1=C2", "C2-C3"], }
# naphthalene molecule_src = { 'MainChain': ["C1-C2", "C2=C3", "C3-C4", "C4=C5", "C5-C6", "C6=C1", "C1*{Chain1}", "C6*{Chain1}"], 'Chain1': ["*-C1", "C1=C2", "C2-C3", "C3=C4", "C4-**"], }


