Skip to content

How to use

The concat-assembly-lists subcommand is used to concatenate assembly lists. The assemblies in the input files are concatenated and reindexed.

The command will check for isomorphism between assemblies, and isomorphic assemblies will be merged (unless the --skip-isomorphism-checks option is used).

Syntax

nasapnet concat-assembly-lists [OPTIONS] [ASSEMBLIES]... COMPONENT_KINDS OUTPUT

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.

python -m nasap_net concat-assembly-lists [OPTIONS] [ASSEMBLIES]... COMPONENT_KINDS OUTPUT

Positional Arguments

  1. ASSEMBLIES: Paths to input files of assemblies. Multiple paths can be provided.
  2. COMPONENT_KINDS: Path to input file of component kinds.
  3. OUTPUT: Path to output file.

Options

  • --already-unique-within-files, -u: Whether the assemblies in each file are already unique. If used, the isomorphism checks are skipped for the assemblies within each file.
  • --skip-isomorphism-checks, -i: Skip isomorphism checks for the assemblies. If used, the isomorphism checks are skipped for all assemblies. The resulting assembly list may contain isomorphic assemblies.
  • --start, -s: Starting index for the reindexing of the assemblies.
  • --overwrite, -o: Overwrite output file if it exists.
  • --verbose, -v: Print verbose output.
  • --help: Show this message and exit.

Example

Directory structure before running the command:

/
├── assemblies1.yaml
├── assemblies2.yaml
└── component_kinds.yaml

Command:

nasapnet concat-assembly-lists assemblies1.yaml assemblies2.yaml component_kinds.yaml output.yaml

Directory structure after running the command:

/
├── assemblies1.yaml
├── assemblies2.yaml
├── component_kinds.yaml
└── output.yaml

Input and output files are as follows:

Input File
assemblies1.yaml
0: !Assembly  # MX2
  bonds:
  - [X1.a, M1.a]
  - [M1.b, X2.a]
  comp_id_to_kind: {M1: M, X1: X, X2: X}
1: !Assembly  # L
  comp_id_to_kind: {L1: L}
2: !Assembly  # X
  comp_id_to_kind: {X1: X}
Input File
assemblies2.yaml
0: !Assembly  # MLX
  bonds:
  - [L1.a, M1.b]
  - [M1.a, X0.a]
  comp_id_to_kind: {L1: L, M1: M, X0: X}
1: !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}
2: !Assembly
  bonds:
  - [L1.a, M1.b]
  - [L4.b, M1.a]
  comp_id_to_kind: {L1: L, L4: L, M1: M}
3: !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}
4: !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}
5: !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}
6: !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}
7: !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}
8: !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}
9: !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}
10: !Assembly  # M4L4 square
  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}
Output File
output.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}