Automated reaction network generator for NASAP (Numerical Analysis of Self-Assembly Process)
Project description
nasap-net
nasap-net is a Python library for automatically constructing elementary reaction networks within the NASAP (Numerical Analysis for Self-Assembly Process) framework, developed by the Hiraoka Group.
Installation
pip install nasap-net
Requires Python ≥ 3.12.
What it does
Given a target assembly (a metal–organic cage) and the components that make it up, nasap-net:
- Enumerates all subassemblies — finds every chemically meaningful partial structure
- Enumerates all elementary reactions — generates every ligand-exchange step connecting those subassemblies
- Classifies reactions — applies a user-defined rule to assign a reaction type to each elementary reaction
- Saves and loads results — serializes assemblies and reactions to YAML/CSV files for downstream use
Quick start
from nasap_net import (
Assembly, Bond, Component, MLEKind,
enumerate_assemblies, enumerate_reactions,
classify_reactions, IncompleteReactionClassifierError,
save_assemblies, save_reactions, save_classification_result,
)
# Define components
M = Component(kind='M', sites=[0, 1])
L = Component(kind='L', sites=[0, 1])
X = Component(kind='X', sites=[0])
# Define target assembly
target = Assembly(
components={'M0': M, 'M1': M, 'L0': L, 'L1': L},
bonds=[
Bond('M0', 1, 'L0', 0), Bond('L0', 1, 'M1', 0),
Bond('M1', 1, 'L1', 0), Bond('L1', 1, 'M0', 0),
]
)
# Enumerate subassemblies and reactions
assemblies = list(enumerate_assemblies(target, leaving_ligand=X, metal_kinds='M'))
reactions = list(enumerate_reactions(
assemblies=assemblies,
mle_kinds=[
MLEKind(metal='M', leaving='X', entering='L'),
MLEKind(metal='M', leaving='L', entering='X'),
],
))
# Classify reactions with a user-defined rule
def my_classifier(reaction):
reaction = reaction.as_reaction_to_classify()
if reaction.leaving_kind == 'X' and reaction.entering_kind == 'L':
return 'association'
elif reaction.leaving_kind == 'L' and reaction.entering_kind == 'X':
return 'dissociation'
raise IncompleteReactionClassifierError(reaction)
reaction_to_class = classify_reactions(reactions, my_classifier)
# Save results
save_assemblies(assemblies, 'assemblies.yaml')
save_reactions(reactions, 'reactions.csv')
save_classification_result(reaction_to_class, 'classification_result.csv')
Example
A worked example for an M4L4/M10L11 system is available as a Jupyter notebook:
examples/M4L4_reaction_classification/
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nasap_net-1.1.0.tar.gz.
File metadata
- Download URL: nasap_net-1.1.0.tar.gz
- Upload date:
- Size: 61.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1ed43434b7d3dc042136f1876b5af43b4ee3e7735acf916295c65b8ffb8936fc
|
|
| MD5 |
2dd5a7de9016b54686e6c2a1fe8ec862
|
|
| BLAKE2b-256 |
f84fed8ce351f2973f604887a2312261bb3181e09b104c078f6d34c79f695747
|
Provenance
The following attestation bundles were made for nasap_net-1.1.0.tar.gz:
Publisher:
release.yml on Hiraoka-Group/nasap-net
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nasap_net-1.1.0.tar.gz -
Subject digest:
1ed43434b7d3dc042136f1876b5af43b4ee3e7735acf916295c65b8ffb8936fc - Sigstore transparency entry: 1489918394
- Sigstore integration time:
-
Permalink:
Hiraoka-Group/nasap-net@e09df4af4c02c3ee6ffbe5d7b2e162fe1e439fa2 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/Hiraoka-Group
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e09df4af4c02c3ee6ffbe5d7b2e162fe1e439fa2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file nasap_net-1.1.0-py3-none-any.whl.
File metadata
- Download URL: nasap_net-1.1.0-py3-none-any.whl
- Upload date:
- Size: 131.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eeefd5b6619041d841f1e921ee28407b712eb9e5f6fcfbdb228609401891e282
|
|
| MD5 |
ec99a99d1816a4278f54b9829496e7c7
|
|
| BLAKE2b-256 |
982c09943794018f0e76d66d88165a2fd3de875773d2e8199d10497aa1e4f444
|
Provenance
The following attestation bundles were made for nasap_net-1.1.0-py3-none-any.whl:
Publisher:
release.yml on Hiraoka-Group/nasap-net
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nasap_net-1.1.0-py3-none-any.whl -
Subject digest:
eeefd5b6619041d841f1e921ee28407b712eb9e5f6fcfbdb228609401891e282 - Sigstore transparency entry: 1489918540
- Sigstore integration time:
-
Permalink:
Hiraoka-Group/nasap-net@e09df4af4c02c3ee6ffbe5d7b2e162fe1e439fa2 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/Hiraoka-Group
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@e09df4af4c02c3ee6ffbe5d7b2e162fe1e439fa2 -
Trigger Event:
push
-
Statement type: