Skip to content

NASAPNet

This is the documentation for NASAPNet.

Introduction

NASAPNet is a Python package that automates the construction of reaction networks as part of the NASAP (Numerical Analysis of Self-Assembly Process) methodology, originally developed by the Hiraoka Group. NASAPNet is designed to streamline and accelerate the process of generating reaction networks for self-assembly systems, and is one of several tools in the NASAP series.

Some features can be accessed through the command line interface (CLI), while others are available through the Python API.

Installation

To install NASAPNet, you can use pip:

pip install nasap_net

Info

If you encounter any issues with the above command, you can try using pip3:

pip3 install nasap_net

CLI

Some features of NASAPNet can be accessed through the command line interface (CLI).

Example

nasapnet enumerate-assemblies input.yaml output.yaml

Python Package

NASAPNet can also be used as a Python package, e.g., import nasap_net.

Example

In the following example, we will check if two assemblies are isomorphic. The Assembly objects, MX2 and ANOTHER_MX2, are the same assembly but with different labels for the components and binding sites.

example.py
from nasap_net import Assembly, Component, is_isomorphic

MX2 = Assembly(# (1)!
    {'M1': 'M', 'X1': 'X', 'X2': 'X'},
    [('M1.a', 'X1.a'), ('M1.b', 'X2.a')])

ANOTHER_MX2 = Assembly(# (2)!
    {'M100': 'M', 'X100': 'X', 'X200': 'X'},
    [('M100.a', 'X100.a'), ('M100.b', 'X200.a')])

COMPONENT_KINDS = {# (3)!
    'M': Component(['a', 'b']),
    'X': Component(['a']),
}

result = is_isomorphic(MX2, ANOTHER_MX2, COMPONENT_KINDS)# (4)!

print(f'Isomorphism check: {result}')# (5)!
  1. Create an assembly object of the form X-M-X
  2. Create another assembly object of the same form but with different component names
  3. Define the structure of each component kind
  4. Check if the two assemblies are isomorphic. This should return True, as they are structurally identical.
  5. Print the result

Run the example:

python example.py

Result:

Isomorphism check: True