Dna Nanotube Software

Overview
 

NATuG (Nucleic Acid Tube Grapher) was an academic research project I undertook in my senior year that's a Python3-based desktop application designed to streamline the DNA nanotube design process. It's one of my most extensive projects, involving a complex and dynamic UI that lets users visualize DNA nanotube shapes, weave together strands of DNA with cross-strand exchanges, set and export sequences, and more. Here I discuss what the program does, a bit about how it works, and how I got involved.
academicfeatured

Getting Started

A video "TLDR" of what NATuG can do --

Program preview

A technical briefing made in preparation for a "technical deep dive" presentation on the project can be found here.

Involvement

It was early 2022, in my professor's Physics class, when in my first homework assignment, an about-me paper, I discussed my love of programming. I wrote about how I liked the problem solving that accompanied code, and how I was eager to learn more about Physics because of its practical applications. Fast forward a few months, and he reached out to see whether I'd be interested in contributing to an ongoing research project.

What I love about code is that it enables actual application of theory (praxis). By implementing known algorithms computationally, processes become simpler and more practical. In some cases, they become simply possible and, critically, accessible. This project was to involve me developing an application around a complex framework for designing DNA nanotubes, which I could see would enable never before possible designs, but also could serve as a tool for people with limited knowledge of the field in general to learn more too. The project builds off my professor's research paper discussing DNA nanotube design by implementing the theory in practical and user friendly software.

But before discussing the specific application I developed, it is important to gain a brief understanding of the field surrounding the software.

Background

I like to think of DNA nanotubes as a niche in the complex and ever-growing realm of DNA nanotech. DNA nanotech is, essentially, taking advantage of how DNA operates (base pairing, shape, chemistry, etc.) to get it to form custom shapes. These shapes are super tiny, so in a way it's like nanoscale 3D printing. Nanotubes are, of course, just one of many different possible shapes that you can form DNA into, but one with particularly many use cases. Employing DNA nanotechnology, one can create a wide array of highly customizable, self-assembling, rigid nanostructures with precision of up around 1nm, and applications ranging from nanophotonics (altering light wavelengths by passing light through tiles of the DNA), to DNA based computing, to DNA-based sensors, and much more. The field is still developing, and new applications are sprouting constantly.

DNA Nanotubes

Example DNA nanotube
Example DNA nanotube

There are many different forms of nanotubes that can be created, but they are all somehow alterations of a hollow, tubular structure. They involve conjoining many cylindrical DNA double helices with cross-strand exchanges to 'bond' them together. DNA nanotubes possess significant potential for use in targeted drug delivery, tissue wound repair, and much more. The specific form of nanotube that I've focused on consist of multiple double helices running parallel to each other, a specific type of nanotube. Even with the constraints of the structure I was designing software to create, design is very complex, and there are many different possible tubes. The design process involves identifying a tube shape consistent with the intrinsic geometry of a DNA double helix, aligning helices, placing connections between helices as to generate minimal strain, and determining base sequences.

Staple Strands
Staple Strands

Making matters more complex is the fact that to actually go about transferring the theoretical shapes to test tubes, these nanotubes generally utilize DNA origami, in which a long viral strand is folded into shape by short "staple strands." This is because synthetic DNA can only be up to 100 base pairs in length or so, while viral DNA can cheaply be produced with thousands of bases. By using strand "staples" you can fold up the virus into a shape of your choosing.

While the process needed for nanotube design has been known for a while, up until NATuG there's been no good computational tool specifically dedicated to their design. Previously bionanotechnologists could utilize a complex spreadsheet tool, allowing users to plot the side view and top view, but it could only support a fixed number of double helices (given the nature of spreadsheets), and did not provide the necessary interactivity that the software I developed, NATuG (nucleic-acid-tube-grapher), offers. Interestingly, NATuG also allows for the creation of non-tubular structures, with a super intuitive interface that is great for people first learning about DNA nanotech; though, however, there exists various tools for nontubular DNA nanostructure design.

The program

Side view plot
Side view plot

NATuG is, most simply put, a Python-based desktop application that is designed to streamline the DNA nanotube design process. It provides a nice UI that allows users to easily set the angles between double helices as to change the overall shape of the tube, while computing a top and side view plot in real time. NATuG automatically lines up the double helices as to allow for cross-strand exchanges to hold together the structure. With a single click on overlapping nucleoside midpoints (spots between two nucleosides), NATuG automatically swerves the strands across double helices, creating a cross-strand exchange. Additionally, users can easily interact with specific nucleosides of the structure, create nicks and linkages, and more. By strategically placing junctions throughout the structure, the isolated double helices become a unified, rigid nanotube. The program provides an intuitive interface, allowing one to customize and visualize the nanotube shape, weave together helices in a matter of clicks, and apply/export sequences. So, while designing DNA nanotubes is a multistage endeavor, NATuG aims to make the process as dynamic as possible—letting users easily traverse the nanotube design process with ease.

It's a very complex tool that I've continued to build on extensively, and includes rendering features, a custom file format to bundle and save program states, and much more. I've

NATuG 2.0
NATuG 2.0

This is the third iteration of NATuG software, and is a complete overhaul both UI wise and design wise. The older versions were abandoned years ago, and at the time they had extensive limitations, such as only allowing for a single type of cross-strand exchange, insufficient for the design of structurally integral DNA nanotubes. This version of NATuG takes much inspiration from the interface of the previous versions, but is also original in many ways, and has many more features than its predecessors.

Getting started

NATuG interface
NATuG interface

When starting work on NATuG, I needed to start off choosing my UI and plotting framework, which would inevitably be a vital part of the program. Interactivity would be key, along with, ideally, a large amount of plug-and-play widgets to choose from. Ultimately, I settled on QT's UI framework, and Python as the primary language, given my experience with the paradigms of the language, and comprehensibility of the toolkit. Though the project was my first time with UI design, it was a great learning experience. For the plotting framework, though many to most Python projects implement matplotlib as their, I elected to use pyqtgraph because of how well it integrates with PyQt, and support for much needed interactivity. It's able to track clicks on individual points, and update in real time.

Adding features

NATuG's first plot
NATuG's first plot

My first step with the program, before building a complex, multi-widget UI, was to actually implement side and top view visualization plots. And for this, I began in Excel, tinkering with parameters while working on grasping the already known plotting algorithm I'd be using. Of course, Excel's plotting capabilities are much more limited than that of programic plotting in Python with pyqtgraph, and I'd have a lot I'd need to learn.

The plots

Side view plot
Side view plot

NATuG consists of two plots: the top view plot and the side view plot. Both plots display the same nanostructures, but from two different perspectives.

Top View Plot

Heart shaped tube
Heart shaped tube
Symmetrical design
Symmetrical design

The top view plot displays a view of the nanotube from the top down, showcasing the overall shape of the tube. It allows the user to better visualize what they are actually constructing. As one tinkers with the inter-domain angles, the actual shape of the tube changes. Each circle represents a DNA double helix, and the fact that they all touch and eventually close up indicates that it is a closed tube. I've also made it so that if you click on a specific double helix in the top view plot, NATuG automatically pans to the side view plot location that has information on the nucleosides in that region.

Side View Plot

Creating cross-strand exchanges
Creating cross-strand exchanges

The side view provides a view as if the nanotube had been unrolled flat, and is strategically distorted as to show all the nucleosides of the nanostructure without overlaps. This plot is much more complex and feature-rich than the top view plot, since it allows for user interaction with the actual nucleosides. It allows users to create nicks in strands, conjunct strands, link together the ends of strands to allow for DNA origami designs, and more. Lots of work has gone into converting the underlying datastructure for strands into a visualized pyqtgraph plot widget that has signals properly hooked up as to allow the user to manipulate the state.

Future Plots

In the future, there's many other types of plot improvements, and even entirely new plots that could be contrived. For instance, we have spent some time discussing the possibility of creating a 3D plot, to visualize the tube from any given perspective at once.

The interface

Multi-panel UI beginnings
Multi-panel UI beginnings

The primary goal of NATuG has been to make the nanotube design experience as pain-free and intuitive as possible. So, not only have I had to learn how to actually go about creating UIs, but I've also had to figure out the best way to position and size elements to make clear how to utilize the program. For the UX design, I choose to go with a three panel UI, with an undockable multi-use, tabbed configuration panel and a resizable top/side view plot area. This allows the user to view the different plots simultaneously or one at a time, while always having access to the configuration.

Junctions!

Possible junction types
Possible junction types

One of the most important features of NATuG is the ability to create cross-strand exchanges. These exchanges implement "Holliday" junctions to allow strands to swerve across their helical domains, weaving together the nanostructure. This was definitely the most difficult to implement part of the project, since previous works showed that junctions were possible, but relied on intuition to determine how to go about making them. This makes sense, since if you look at a side view helix plot, it is fairly obvious to a human how to conjunct the strands. This was definitely one of my favorite parts of the project, since it was both challenging and rewarding to catalog the various cases. Unrelated: this was a classic case of Moravec's Paradox, which is definitely an interesting read.

After extensive tinkering and cogitating, I've come to the conclusion that there are a distinct amount of different possible cases for conjunction the strands of two arbitrary nucleoside-end midpoints, which are outlined in the tree to the right. As it turned out, there were specific pathways to the subcases, dependent on the closedness of the strands of the NEMids and whether the NEMids are in the same strand. Coming up with this algorithm is definitely one of my most impressive contributions to the project, and was almost equally annoying to implement. Implementing the algorithm required moving nucleosides between strands, of which some had no definite start/end and were closed loops. Determining how to reindex arrays to most efficiently build the new strands, and prevent off-by-one errors, was no easy feat, and if you're interested in reading through the code yourself you can find it here.

Takeaways

Firstly, there are many project-related takeaways worth discussing. Ultimately, NATuG showcases the powerful potential of software to allow for more complex, larger-scale tubular DNA nanostructures. The program allows the user to spend less time doing tedious computations, and more time focusing on the actual design of the structure. Additionally, with the ability to load and export structures into and out of NATuG, we expect collaborative design to become much more streamlined. Additionally, we also realized that the program holds the potential for non-closed tile design, which is common in the realm of DNA origami. While there are other tools that are more sophisticated and perhaps better suited for this specific purpose, NATuG provides a uniquely user friendly and convenient experience.

As I complete the initial version of the program, Professor Sherman and I are beginning to draft a paper for NATuG, which we intend to submit for publication to a peer reviewed journal within the next few months. We hope to discuss some of the potential shapes of nanotubes that can be created, the way that the program tackles conjoining strands, and the like.

Nadrian Seeman

Towards the end of the project we've also informally shared the project at NYU's Nadrian Seeman Memorial Symposium. Nadrian Seeman is the founder of DNA Nanotechnology as a field in general, and paved the path for not just this project, but all structural DNA related projects and software tools. He showed that it's possible to take a medium like DNA, the molecule of life, and turn it into something completely different: a nanoscale building block. The symposium at NYU was truly an amazing experience, where I got to hear about many different fascinating areas of the field and speak with people about countless ongoing related projects.

On a more personal note, this project was one of my best coding experiences yet. I've come to find that large scale projects are generally the best way for me to improve my coding abilities, and this was no exception. Spending countless hours figuring out how to detect the click of an up button on a double spin box may seem like a complete waste of time, but many different obsessions and debugging sessions throughout the project have greatly improved my bug-catching abilities. Working with libraries like PyQt may seem to provide niche skills that may only be useful for specific types of projects in the future, but they actually helped me grasp the complex concepts of OOP and better understand Python's weird quirks. I liked this project more than many of the others I've worked on because it's not a means to an end, but is an end that provides more means.

Learn more

Poster preview
Poster preview

Though this post attempts to discuss the needed background to understand what NATuG does, I still strongly suggest reading my professor's paper on the design of DNA nanotubes. It's definitely quite complex, but it has useful diagrams and is a very interesting and mind bending read. Also, it may be helpful to check out this poster I created showcasing the project.

If you're interested in learning more about how to actually set up and use the program, check out its user manual and Github repository. Also, feel free to reach out if you have any questions.