How to use
The explore-reactions
subcommand is used to explore reactions between assemblies.
Syntax
Info
If this raises an error command not found
, you may need to use python -m nasap_net
or python3 -m nasap_net
instead of nasapnet
.
Positional Arguments
ASSEMBLIES
: Relative path to the assemblies file. (YAML format)COMPONENT_KINDS
: Relative path to the component kinds file. (YAML format)CONFIG
: Relative path to the config file. (YAML format)OUTPUT
: Relative path to the output file. (CSV format)
Options
Options with single hyphen (-
) are aliases for the corresponding options with double hyphen (--
), e.g., -w
is an alias for --wip-dir
. Either of them can be used.
Command | Alias | Description | Example |
---|---|---|---|
--overwrite |
-o |
Overwrite output file if it exists. | nasapnet explore-reactions -o input.yaml output.yaml |
--verbose |
-v |
Print feedback messages to the console. | nasapnet explore-reactions -v input.yaml output.yaml |
--help |
Show this message and exit. | nasapnet explore-reactions --help |
Reversible reactions not guaranteed
The explore-reactions
command considers left-to-right and right-to-left reactions as separate reactions.
This means that the results may contain only one direction of a reversible reaction.
For example, if the config file is set up as follows:
the results only include "X-to-L" reactions, NOT "L-to-X".e.g., "MX4 + L -> MX3L + X" will be included, but the reverse "MX3L + X -> MX4 + L" will never be included.
If you want to include both directions, you can run the command twice with swapped reactant_kind
and leaving_kind
in the config file,
e.g.,
Then you can concatenate the two resulting CSV files.
Example
Directory structure before running the command:
Command:
Directory structure after running the command:
Input and output files are as follows:
Input File (1) assemblies.yaml
0: !Assembly
bonds:
- [M1.a, X1.a]
- [M1.b, X2.a]
comp_id_to_kind: {M1: M, X1: X, X2: X}
1: !Assembly
comp_id_to_kind: {L1: L}
2: !Assembly
comp_id_to_kind: {X1: X}
3: !Assembly
bonds:
- [L1.a, M1.b]
- [M1.a, X0.a]
comp_id_to_kind: {L1: L, M1: M, X0: X}
4: !Assembly
bonds:
- [L1.a, M1.b]
- [L1.b, M2.a]
- [M1.a, X0.a]
- [M2.b, X1.a]
comp_id_to_kind: {L1: L, M1: M, M2: M, X0: X, X1: X}
5: !Assembly
bonds:
- [L1.a, M1.b]
- [L4.b, M1.a]
comp_id_to_kind: {L1: L, L4: L, M1: M}
6: !Assembly
bonds:
- [L1.a, M1.b]
- [L1.b, M2.a]
- [L2.a, M2.b]
- [M1.a, X0.a]
comp_id_to_kind: {L1: L, L2: L, M1: M, M2: M, X0: X}
7: !Assembly
bonds:
- [L1.a, M1.b]
- [L1.b, M2.a]
- [L2.a, M2.b]
- [L2.b, M3.a]
- [M1.a, X0.a]
- [M3.b, X1.a]
comp_id_to_kind: {L1: L, L2: L, M1: M, M2: M, M3: M, X0: X, X1: X}
8: !Assembly
bonds:
- [L1.a, M1.b]
- [L1.b, M2.a]
- [L2.a, M2.b]
- [L4.b, M1.a]
comp_id_to_kind: {L1: L, L2: L, L4: L, M1: M, M2: M}
9: !Assembly
bonds:
- [L1.a, M1.b]
- [L1.b, M2.a]
- [L2.a, M2.b]
- [L2.b, M3.a]
- [L3.a, M3.b]
- [M1.a, X0.a]
comp_id_to_kind: {L1: L, L2: L, L3: L, M1: M, M2: M, M3: M, X0: X}
10: !Assembly
bonds:
- [L1.a, M1.b]
- [L1.b, M2.a]
- [L2.a, M2.b]
- [L2.b, M3.a]
- [L3.a, M3.b]
- [L3.b, M4.a]
- [M1.a, X0.a]
- [M4.b, X1.a]
comp_id_to_kind: {L1: L, L2: L, L3: L, M1: M, M2: M, M3: M, M4: M, X0: X, X1: X}
11: !Assembly
bonds:
- [L1.a, M1.b]
- [L1.b, M2.a]
- [L2.a, M2.b]
- [L2.b, M3.a]
- [L3.a, M3.b]
- [L4.b, M1.a]
comp_id_to_kind: {L1: L, L2: L, L3: L, L4: L, M1: M, M2: M, M3: M}
12: !Assembly
bonds:
- [L1.a, M1.b]
- [L1.b, M2.a]
- [L2.a, M2.b]
- [L2.b, M3.a]
- [L3.a, M3.b]
- [L3.b, M4.a]
- [L4.a, M4.b]
- [M1.a, X0.a]
comp_id_to_kind: {L1: L, L2: L, L3: L, L4: L, M1: M, M2: M, M3: M, M4: M, X0: X}
13: !Assembly
bonds:
- [L1.a, M1.b]
- [L1.b, M2.a]
- [L2.a, M2.b]
- [L2.b, M3.a]
- [L3.a, M3.b]
- [L3.b, M4.a]
- [L4.a, M4.b]
- [L4.b, M1.a]
comp_id_to_kind: {L1: L, L2: L, L3: L, L4: L, M1: M, M2: M, M3: M, M4: M}
Input File (2) component_kinds.yaml
Output File
Warning
The output file only contains the X-to-L reactions, not the L-to-X reactions.
init_assem_id | entering_assem_id | product_assem_id | leaving_assem_id | metal_bs | leaving_bs | entering_bs | duplicate_count |
---|---|---|---|---|---|---|---|
12 | nan | 13 | 2 | M1.a | X0.a | L4.b | 1 |
0 | 1 | 3 | 2 | M1.a | X1.a | L1.a | 4 |
0 | 3 | 4 | 2 | M1.a | X1.a | L1.b | 2 |
0 | 5 | 6 | 2 | M1.a | X1.a | L1.b | 4 |
0 | 6 | 7 | 2 | M1.a | X1.a | L2.b | 2 |
0 | 8 | 9 | 2 | M1.a | X1.a | L2.b | 4 |
0 | 9 | 10 | 2 | M1.a | X1.a | L3.b | 2 |
0 | 11 | 12 | 2 | M1.a | X1.a | L3.b | 4 |
3 | 1 | 5 | 2 | M1.a | X0.a | L1.a | 2 |
3 | 3 | 6 | 2 | M1.a | X0.a | L1.b | 2 |
3 | 5 | 8 | 2 | M1.a | X0.a | L1.b | 2 |
3 | 6 | 9 | 2 | M1.a | X0.a | L2.b | 1 |
3 | 8 | 11 | 2 | M1.a | X0.a | L2.b | 2 |
3 | 9 | 12 | 2 | M1.a | X0.a | L3.b | 1 |
4 | 1 | 6 | 2 | M1.a | X0.a | L1.a | 4 |
4 | 3 | 7 | 2 | M1.a | X0.a | L1.b | 2 |
4 | 5 | 9 | 2 | M1.a | X0.a | L1.b | 4 |
4 | 6 | 10 | 2 | M1.a | X0.a | L2.b | 2 |
4 | 8 | 12 | 2 | M1.a | X0.a | L2.b | 4 |
6 | 1 | 8 | 2 | M1.a | X0.a | L1.a | 2 |
6 | 3 | 9 | 2 | M1.a | X0.a | L1.b | 1 |
6 | 5 | 11 | 2 | M1.a | X0.a | L1.b | 2 |
6 | 6 | 12 | 2 | M1.a | X0.a | L2.b | 2 |
7 | 1 | 9 | 2 | M1.a | X0.a | L1.a | 4 |
7 | 3 | 10 | 2 | M1.a | X0.a | L1.b | 2 |
7 | 5 | 12 | 2 | M1.a | X0.a | L1.b | 4 |
9 | 1 | 11 | 2 | M1.a | X0.a | L1.a | 2 |
9 | 3 | 12 | 2 | M1.a | X0.a | L1.b | 1 |
10 | 1 | 12 | 2 | M1.a | X0.a | L1.a | 4 |