@@ -152,10 +152,45 @@ for a rod MOF like MIL-53, `all_node` gives `rna` and `single_node` gives `bpq`
152152mofstructure_topology structure.cif --method all_node # every branch point a node
153153mofstructure_topology ./folder --method single_node # organic groups merged
154154mofstructure_topology ./folder --method sbus # each SBU one node
155- mofstructure_topology ./folder --method all # all three, one record each
155+ mofstructure_topology ./folder --method ligand_cluster # complete ligands and metal clusters
156+ mofstructure_topology ./folder --method all # all methods, one record each
156157```
157158
158- Use ` --method all ` to compute all three at once. Each structure gets a single
159+ ` ligand_cluster ` constructs a bipartite incidence net from the same
160+ deconstruction as ` get_ligands ` , so its vertices are exactly the complete
161+ ligands and metal clusters that deconstruction returns and every atom belongs to
162+ one of them. An edge records coordination of a ligand to a particular periodic
163+ image of a cluster. Multiple donor bonds to the same cluster image count as one
164+ incidence, so chelation does not artificially increase the topological degree.
165+
166+ A ditopic ligand stays a vertex, which subdivides the edge it makes, and RCSR
167+ lists no subdivided nets — UiO-66 comes back as ` UNKNOWN ` even though the net is
168+ right. That is deliberate: the point of this method is how the ligands meet the
169+ clusters, not the RCSR symbol, and the topology hash still identifies the net.
170+ Pass ` collapse_ditopic=True ` to ` ligand_cluster_graph ` or ` cgd_ligand_cluster `
171+ to splice ditopic ligands into edges instead, which recovers the nameable net
172+ (` fcu ` for UiO-66, ` pcu ` for MIL-53, ` tbo ` either way for HKUST-1).
173+
174+ To ask what the ligands do rather than what the net is called, use the
175+ fingerprint, which is read straight from the deconstruction and needs no Systre:
176+
177+ ``` python
178+ from mofstructure import structure
179+
180+ mof = structure.MOFstructure(filename = ' UiO-66.cif' )
181+ print (mof.get_ligand_cluster_fingerprint())
182+ ```
183+
184+ It counts each ligand and cluster species per metal-cluster unit, with how many
185+ clusters each ligand bridges and at what denticity, and it does not change when
186+ the atoms are listed in another order, when the cell origin moves, or when the
187+ same crystal is given as a supercell. That makes it sensitive to defects: a
188+ missing linker lowers a cluster's connectivity, a linker hanging by one end is
189+ listed under ` terminal ` with its own formula (which is what tells it apart from
190+ a coordinated solvent), and a carboxylate that has dropped from bridging to
191+ monodentate shows in the denticity histogram even though the net is unchanged.
192+
193+ Use ` --method all ` to compute every method at once. Each structure gets a single
159194record holding every net — nested under a ` topologies ` key in the JSON, and one
160195column group per method in the CSV — so the output drops straight into a
161196database:
@@ -264,6 +299,30 @@ identify_topology('UiO-66.cif', method='all_node') # from a structure file
264299identify_topology(read(' UiO-66.cif' )) # from ASE atoms
265300```
266301
302+ ### Drawing the net
303+
304+ ` draw_topology ` traces the net over the real framework and returns an
305+ interactive plotly figure — nodes at the real building-unit positions, edges
306+ following the connectivity. Needs the optional ` plotly ` extra
307+ (` pip install mofstructure[draw] ` ).
308+
309+ ``` python
310+ fig = mof.draw_topology(method = ' all_node' , filename = ' net.html' )
311+ fig.show() # or open net.html in a browser
312+ ```
313+
314+ The interactive, axis-free molecular view overlays the underlying net on the
315+ framework and shows the unit-cell boundary. Every connection ends at a visible
316+ centre, including connections to neighbouring periodic images. The default
317+ green centre-to-centre network is generated by the selected topology method,
318+ so its nodes and contractions visibly change between ` sbus ` , ` all_node ` ,
319+ ` single_node ` and ` ligand_cluster ` . Framework atoms, framework bonds and each
320+ centre class can be toggled independently in the legend. The view shows this
321+ method-specific network by default;
322+ set ` show_topology=True ` to add the abstract blue topology edges and topology
323+ node markers. Set ` show_linker_sbu=False ` ,
324+ ` show_structure=False ` or ` show_unit_cell=False ` to hide individual layers.
325+
267326### Open metal sites
268327
269328``` python
0 commit comments