Skip to content

Commit 6ca50f4

Browse files
authored
Merge pull request #10 from KWWyatt/merge-upstream-main
Merge upstreabgm main
2 parents 6ec736c + 5884b4f commit 6ca50f4

98 files changed

Lines changed: 26496 additions & 367 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.codespellignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
Te
2+
Nd

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ repository conda environment file.
3939
```bash
4040
git clone https://github.com/kewh5868/SAXSShell.git
4141
cd SAXSShell
42+
```
43+
44+
### macOS, Linux, and WSL
45+
46+
Create the Python 3.12 conda environment from the default environment file:
47+
48+
```bash
4249
conda env create -f requirements/saxshell-py312.yml
4350
```
4451

@@ -55,6 +62,44 @@ Launch the main SAXSShell application from the repository root:
5562
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.saxs
5663
```
5764

65+
### Native Windows
66+
67+
On native Windows, use the Windows-specific environment file:
68+
69+
```cmd
70+
conda env create -f requirements\saxshell-py312-win.yml
71+
```
72+
73+
If the `saxshell-py312` environment already exists, update it from the same
74+
file:
75+
76+
```cmd
77+
conda env update -n saxshell-py312 -f requirements\saxshell-py312-win.yml --prune
78+
```
79+
80+
From Anaconda Prompt, activate the environment, set `PYTHONPATH`, and launch
81+
the SAXS UI:
82+
83+
```cmd
84+
conda activate saxshell-py312
85+
set PYTHONPATH=src
86+
python -m saxshell.saxs
87+
```
88+
89+
You can also launch without activating the environment:
90+
91+
```cmd
92+
set PYTHONPATH=src
93+
conda run --no-capture-output -n saxshell-py312 python -m saxshell.saxs
94+
```
95+
96+
From Windows PowerShell, set `PYTHONPATH` with PowerShell syntax:
97+
98+
```powershell
99+
$env:PYTHONPATH = "src"
100+
conda run --no-capture-output -n saxshell-py312 python -m saxshell.saxs
101+
```
102+
58103
## First Project
59104

60105
Start by preparing the simulation data that the SAXS project will consume:

README.rst

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,19 @@ Installation
6060
------------
6161

6262
SAXSShell is not pip-installable yet. The current user-facing path is to clone
63-
the repository and create the conda environment from the checked-in
64-
``requirements/saxshell-py312.yml`` file.
63+
the repository and create the conda environment from the checked-in environment
64+
file for your platform.
6565

6666
From a terminal, run ::
6767

6868
git clone https://github.com/kewh5868/SAXSShell.git
6969
cd SAXSShell
70+
71+
macOS, Linux, and WSL
72+
~~~~~~~~~~~~~~~~~~~~~
73+
74+
Create the Python 3.12 conda environment from the default environment file ::
75+
7076
conda env create -f requirements/saxshell-py312.yml
7177

7278
If the environment already exists, update it with ::
@@ -77,6 +83,35 @@ Launch the main SAXSShell application from the repository root with ::
7783

7884
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.saxs
7985

86+
Native Windows
87+
~~~~~~~~~~~~~~
88+
89+
On native Windows, create the environment from the Windows-specific environment
90+
file ::
91+
92+
conda env create -f requirements\saxshell-py312-win.yml
93+
94+
If the environment already exists, update it with ::
95+
96+
conda env update -n saxshell-py312 -f requirements\saxshell-py312-win.yml --prune
97+
98+
From Anaconda Prompt, activate the environment, set ``PYTHONPATH``, and launch
99+
the SAXS UI ::
100+
101+
conda activate saxshell-py312
102+
set PYTHONPATH=src
103+
python -m saxshell.saxs
104+
105+
You can also launch without activating the environment ::
106+
107+
set PYTHONPATH=src
108+
conda run --no-capture-output -n saxshell-py312 python -m saxshell.saxs
109+
110+
From Windows PowerShell, set ``PYTHONPATH`` with PowerShell syntax ::
111+
112+
$env:PYTHONPATH = "src"
113+
conda run --no-capture-output -n saxshell-py312 python -m saxshell.saxs
114+
80115
You can also verify that the source checkout imports inside the conda
81116
environment with ::
82117

docs/getting-started/project-setup.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,21 @@ The **Component build mode** dropdown controls what happens when you click
108108
Representative structures are optional project-backed files that compatible
109109
Debye, Born, FFT, and RMCSetup workflows can use instead of average cluster
110110
folders. Use **Tools > Structure Analysis > Open Representative Structures** for
111-
the full interactive analysis UI, or use **Tools > (beta) > Open Representative
112-
CLI Setup (Beta)** to save `representative_structure_cli_run.json` and run the
113-
same backend from the source checkout:
111+
the full interactive analysis UI, or use **Tools > CLI Setup > Open
112+
Representative CLI Setup (Beta)** to save
113+
`representative_structure_cli_run.json` and run the same backend from the
114+
source checkout:
114115

115116
```bash
116117
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.representativefinder run /path/to/project
117118
```
118119

120+
The same **Tools > CLI Setup** menu can prepare project-local run files for
121+
XYZ-to-PDB conversion, cluster extraction, cluster dynamics, and cluster
122+
dynamics ML. Those run files let you run long jobs from a terminal or batch
123+
several prepared project folders while keeping outputs linked back to their
124+
projects.
125+
119126
## Debye-Waller factors
120127

121128
**Compute Debye-Waller Factors (beta)** is an optional linked step in Project

docs/getting-started/quickstart.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ that downstream tools should use:
1818

1919
```bash
2020
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.mdtrajectory inspect traj.xyz --energy-file traj.ener
21-
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.mdtrajectory suggest-cutoff traj.xyz --energy-file traj.ener --temp-target-k 300 --window 3
22-
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.mdtrajectory export traj.xyz --energy-file traj.ener --use-suggested-cutoff --temp-target-k 300 --window 3
21+
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.mdtrajectory suggest-cutoff traj.xyz --energy-file traj.ener --temp-target-k 300 --window 2
22+
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.mdtrajectory export traj.xyz --energy-file traj.ener --use-suggested-cutoff --temp-target-k 300 --window 2
2323
```
2424

2525
If residue identity matters for your downstream analysis, convert the exported

docs/tutorials/example-workflow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshel
2020
Use either a manual cutoff or the suggested one:
2121

2222
```bash
23-
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.mdtrajectory export traj.xyz --energy-file traj.ener --use-suggested-cutoff --temp-target-k 300 --window 3
23+
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.mdtrajectory export traj.xyz --energy-file traj.ener --use-suggested-cutoff --temp-target-k 300 --window 2
2424
```
2525

2626
## Step 3: convert to PDB only if needed

docs/tutorials/md-to-saxs-pipeline.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ commands from the repository root.
1919

2020
```bash
2121
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.mdtrajectory inspect traj.xyz --energy-file traj.ener
22-
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.mdtrajectory suggest-cutoff traj.xyz --energy-file traj.ener --temp-target-k 300 --window 3
23-
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.mdtrajectory export traj.xyz --energy-file traj.ener --use-suggested-cutoff --temp-target-k 300 --window 3
22+
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.mdtrajectory suggest-cutoff traj.xyz --energy-file traj.ener --temp-target-k 300 --window 2
23+
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.mdtrajectory export traj.xyz --energy-file traj.ener --use-suggested-cutoff --temp-target-k 300 --window 2
2424
```
2525

2626
## Convert to residue-aware PDB, if needed

docs/user-guide/cluster-dynamics-ml.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,42 @@ plus a structure library for the observed smaller clusters.
6262
`SAXS` tabs.
6363
10. Save the dataset, CSV exports, or a detailed PowerPoint report if needed.
6464

65+
## Project-Backed CLI Setup
66+
67+
For background prediction runs, use **Tools > CLI Setup > Open Cluster Dynamics
68+
ML CLI Setup (Beta)**. The setup window writes
69+
`cluster_dynamics_ml_cli_run.json` in the active project folder and shows the
70+
terminal commands to run later:
71+
72+
```bash
73+
clusterdynamicsml run /path/to/project
74+
saxshell clusterdynamicsml run /path/to/project
75+
```
76+
77+
The command reads the project-local run file, runs the same prediction backend
78+
used by the UI, and saves the reloadable JSON dataset plus companion CSV files,
79+
predicted structures, SAXS profiles, histogram exports, and the inherited
80+
cluster-dynamics heatmap/lifetime exports under
81+
`exported_results/data/clusterdynamicsml` by default. It refreshes the
82+
project's registered frames, clusters, energy, and experimental-data references
83+
when a `saxs_project.json` file is present.
84+
85+
You can launch the setup window directly:
86+
87+
```bash
88+
clusterdynamicsml setup-ui /path/to/project
89+
```
90+
91+
To process several prepared projects from one terminal session, use:
92+
93+
```bash
94+
clusterdynamicsml batch-run /path/to/project_a /path/to/project_b --workers 2 --keep-going
95+
```
96+
97+
Each project keeps its own run file and output dataset. The CLI path is
98+
separate from the interactive UI, so the existing tabs, cached-history browser,
99+
and plotting controls remain UI-only.
100+
65101
## Training data assembled by the workflow
66102

67103
The workflow first runs the standard cluster-dynamics analysis and then joins

docs/user-guide/cluster-dynamics.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,40 @@ times, not the folder label.
7878
If the tool is launched from the main SAXS UI, it inherits the active project
7979
directory automatically.
8080

81+
## Project-Backed CLI Setup
82+
83+
For longer cluster-dynamics runs, use **Tools > CLI Setup > Open Cluster
84+
Dynamics CLI Setup (Beta)**. The setup window writes
85+
`cluster_dynamics_cli_run.json` in the active project folder and shows the
86+
terminal commands to run later:
87+
88+
```bash
89+
clusterdynamics run /path/to/project
90+
saxshell clusterdynamics run /path/to/project
91+
```
92+
93+
The command reads the project-local run file, runs the same backend used by the
94+
UI, and saves the reloadable JSON dataset plus the heatmap CSV, lifetime CSV,
95+
and optional energy CSV under `exported_results/data/clusterdynamics` by
96+
default. It also refreshes the project's registered frames and energy-file
97+
references when a `saxs_project.json` file is present.
98+
99+
You can also launch the setup window directly:
100+
101+
```bash
102+
clusterdynamics setup-ui /path/to/project
103+
```
104+
105+
To process several prepared projects from one terminal session, use:
106+
107+
```bash
108+
clusterdynamics batch-run /path/to/project_a /path/to/project_b --workers 2 --keep-going
109+
```
110+
111+
Each project keeps its own run file and output dataset, so these runs can also
112+
be started in separate terminals or background jobs without touching the
113+
interactive plotting workflow.
114+
81115
## Saved Outputs
82116

83117
The save action writes a JSON dataset plus companion CSV files beside it:

docs/user-guide/cluster-extraction.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ Example:
3434

3535
```bash
3636
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.mdtrajectory inspect traj.xyz --energy-file traj.ener
37-
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.mdtrajectory suggest-cutoff traj.xyz --energy-file traj.ener --temp-target-k 300 --window 3
38-
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.mdtrajectory export traj.xyz --energy-file traj.ener --use-suggested-cutoff --temp-target-k 300 --window 3
37+
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.mdtrajectory suggest-cutoff traj.xyz --energy-file traj.ener --temp-target-k 300 --window 2
38+
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.mdtrajectory export traj.xyz --energy-file traj.ener --use-suggested-cutoff --temp-target-k 300 --window 2
3939
```
4040

4141
When a cutoff is applied, the default folder name now uses the form
@@ -76,6 +76,36 @@ The cluster workflow supports both UI and CLI usage. Its CLI exposes separate
7676
The CLI help text explicitly calls out faster neighbor search modes such as
7777
`kdtree` and `vectorized`.
7878

79+
### Project-backed cluster run files
80+
81+
For repeatable project runs, launch the setup window and save a run file in the
82+
SAXSShell project folder:
83+
84+
From the main SAXSShell window, use **Tools > CLI Setup > Open Cluster
85+
Extraction CLI Setup (Beta)**. The same setup window can also be launched from
86+
a terminal:
87+
88+
```bash
89+
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.cluster setup-ui /path/to/saxs_project
90+
```
91+
92+
The setup window records the project folder, extracted frames folder, output
93+
clusters folder, atom rules, pair cutoffs, PBC/box settings, shell options, and
94+
neighbor-search settings in `cluster_extraction_cli_run.json`. Paths inside the
95+
project are stored relative to the project folder so the project can move as a
96+
unit.
97+
98+
After saving, run the extraction from the terminal:
99+
100+
```bash
101+
PYTHONPATH=src conda run --no-capture-output -n saxshell-py312 python -m saxshell.cluster run /path/to/saxs_project
102+
```
103+
104+
Use `--run-file custom_run.json` to run a different JSON file. Relative
105+
`--run-file` paths are resolved against the project folder. A completed run
106+
updates the project `clusters_dir` reference to the output folder while leaving
107+
the existing frames and PDB-frames references unchanged.
108+
79109
## `clusterdynamics`
80110

81111
This application consumes the extracted XYZ or PDB frames from `mdtrajectory`

0 commit comments

Comments
 (0)