contact2schematic.py

This script converts an origami contact map into an approximate “guide” schematic diagram of the origami design in 2D or 3D space.

The syntax is:

python3 contact2schematic.py origami_name embed_dimension space_dimension

For example, command:

python3 contact2schematic.py rothemundstar 2 2

will convert the origami contact map file _assets/rothemundstar.csv into an origami guide schematic _assets/rothemundstar.html in the same directory. In the above case, the origami schematic is laid out in 2-dimensions by the KK springer embedder, and is displayed in 2-dimensional space.


Guide Schematic of Rothemund Star in 2D

Sometimes its useful to display a 2D origami schematic in 3D space, such that the flat schematic can rotated and viewed at different angles:

python3 contact2schematic.py rothemundstar 2 3

Guide Schematic of Rothemund Star in 3D

3D origami, such a wireframe structures, must be spring-embedded in 3D and displayed in 3D space:

python3 contact2schematic.py ball 3 3

Guide Schematic of vHelix Ball in 3D

Note

The origami schematic HTML file produced is self-contained, i.e. does not require any other files to work, and can be shared with others. However, an active internet connection is required for the page to display the origami schematic. This is because the force graph display library needs to be downloaded from an online URL.

Limitations

  1. 3D origamis with dense internal connections (like 3D brick origamis, designed on a grid with many parallel helices) often do not have an intelligible guide schematic. The 3D origamis to work best are 3D wireframe origamis which are compact.

  2. contact2schematic cannot render origamis which have single base domains on the scaffold strand.

If point (2) above is the case, the program will suggest using the contactutils.py script to either delete these scaffold bases (shortening the scaffold):

python3 contactutils.py del1nt origami_name

or delete staples surrounding the single nucleotide domain, making it larger:

python3 contactutils.py rs1nt origami_name

See the contactutils.py documentation page.

Comments

This script first converts the contact map to an origami domain-level graph by using contact2dlgraph.py. The Kamada-Kawai (KK) spring embedder algorithm is then used to find an approximate geometric embedding of the domain-graph, given distances between local graph node pairs. The KK algorithm uses all pairs shortest path (APSP) in order to estimate geometric distances between nodes whose distances are not specified in the origami graph.

Finally, the geometric layout of the schematic origami graph is displayed as an interactive HTML page using the Force Graph or 3D Force Graph javascript graph physics engines.

On the HTML page, parts of the schematic can be manually tweaked, zoomed and rotated and graph nodes dragged to organise the schematic further. The schematic is embedded in a force field and so dragging nodes on the schematic has fluid consequences if forces are turned on; conversely, forces can be turned off.

The routing of the scaffold, or the staples or the positions of ambiguous crossovers can be selectively displayed by pressing the “Toggle View” button. Finally, tooltip text appearing as the mouse is hovered over the schematic describes details of staple sections, crossovers, loopouts, dangling ends, scaffold nicks and single stranded scaffold sections.

See the REVNANO documentation for more on guide schematics.