From e31de1f8b2d850dd1cf3469844bca9b5ab606546 Mon Sep 17 00:00:00 2001 From: Johannes Klein Agents Date: Fri, 27 Nov 2026 22:53:17 +0100 Subject: [PATCH] Pin the generated commands for every analysis (#420) One table of cases in src/test/commandPins.ts, run by two test files: the host the test setup installs, and a Windows host with C: paths. Each pin builds a real Run and snapshots run.args; run.command and run.settingsFileContent are pinned once per binary. Binaries the host's list lacks (ASTRAL, RAxML-NG on Windows, and a PTHREADS-named RAxML-NG stand-in for the --threads branch) are added to the list by the table. Co-Authored-By: Claude Fable 5.2 --- src/app/store/Run.pins.test.ts | 7 + src/app/store/Run.pins.windows.test.ts | 14 + .../store/__snapshots__/Run.pins.test.ts.snap | 1511 ++++++++++++++++ .../Run.pins.windows.test.ts.snap | 1516 +++++++++++++++++ src/test/commandPins.ts | 251 +++ 5 files changed, 3299 insertions(+) create mode 100644 src/app/store/Run.pins.test.ts create mode 100644 src/app/store/Run.pins.windows.test.ts create mode 100644 src/app/store/__snapshots__/Run.pins.test.ts.snap create mode 100644 src/app/store/__snapshots__/Run.pins.windows.test.ts.snap create mode 100644 src/test/commandPins.ts diff --git a/src/app/store/Run.pins.test.ts b/src/app/store/Run.pins.test.ts new file mode 100644 index 00000000..a0073787 --- /dev/null +++ b/src/app/store/Run.pins.test.ts @@ -0,0 +1,7 @@ +// Command pins on the host the test setup installs: not Windows, paths like /out. +import { pinBridge, pinCommands } from '../../test/commandPins'; +import { installBridge } from '../../test/setup'; + +installBridge( pinBridge ); + +await pinCommands( { windows: false } ); diff --git a/src/app/store/Run.pins.windows.test.ts b/src/app/store/Run.pins.windows.test.ts new file mode 100644 index 00000000..42f1538a --- /dev/null +++ b/src/app/store/Run.pins.windows.test.ts @@ -0,0 +1,14 @@ +// Command pins on a Windows host with paths like C:\out. +import { vi } from 'vitest'; + +import { pinBridge, pinCommands } from '../../test/commandPins'; +import { installBridge } from '../../test/setup'; + +installBridge( { + ...pinBridge, + host: { windows: true, release: '10.0.19045', arch: 'x64', cpuModel: 'Intel' }, +} ); +// Run.ts and RunOptions.ts read the host once at import, so the store loads again after the host is set. +vi.resetModules(); + +await pinCommands( { windows: true } ); diff --git a/src/app/store/__snapshots__/Run.pins.test.ts.snap b/src/app/store/__snapshots__/Run.pins.test.ts.snap new file mode 100644 index 00000000..d815681c --- /dev/null +++ b/src/app/store/__snapshots__/Run.pins.test.ts.snap @@ -0,0 +1,1511 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`ASTRAL args > with a loaded tree 1`] = ` +[ + [ + "-i", + "/in/genes.tre", + "-o", + "/out/ASTRAL_pin.tre", + ], +] +`; + +exports[`ASTRAL args > without a tree 1`] = ` +[ + [ + "-o", + "/out/ASTRAL_pin.tre", + ], +] +`; + +exports[`ModelTest-NG args > binary 1`] = ` +[ + [ + "-i", + "/in/a.fasta", + "-o", + "/out/RAxML_GUI_ModelTest_pin", + "--force", + "-p", + 3, + ], +] +`; + +exports[`ModelTest-NG args > nucleotide 1`] = ` +[ + [ + "-d", + "nt", + "-i", + "/in/a.fasta", + "-o", + "/out/RAxML_GUI_ModelTest_pin", + "--force", + "-p", + 3, + ], +] +`; + +exports[`ModelTest-NG args > protein 1`] = ` +[ + [ + "-d", + "aa", + "-i", + "/in/a.fasta", + "-o", + "/out/RAxML_GUI_ModelTest_pin", + "--force", + "-p", + 3, + ], +] +`; + +exports[`RAxML args > AS alternate 1`] = ` +[ + [ + "-f", + "A", + "-t", + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/RAxML_pin.part.txt", + ], +] +`; + +exports[`RAxML args > AS bare 1`] = ` +[ + [ + "-f", + "A", + "-t", + "-m", + "GTRGAMMA", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + ], +] +`; + +exports[`RAxML args > AS full 1`] = ` +[ + [ + "-T", + 3, + "-f", + "A", + "-t", + "/in/start.tre", + "-m", + "GTRGAMMA", + "--HKY85", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/parts.txt", + ], +] +`; + +exports[`RAxML args > BS+con alternate 1`] = ` +[ + [ + "-x", + 123, + "-p", + 123, + "-N", + 100, + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-O", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/RAxML_pin.part.txt", + ], + [ + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-J", + "MR", + "-w", + "/out", + "-z", + "/out/RAxML_bootstrap.pin.tre", + "-n", + "consensus.pin.tre", + ], +] +`; + +exports[`RAxML args > BS+con bare 1`] = ` +[ + [ + "-x", + 123, + "-p", + 123, + "-N", + 100, + "-m", + "GTRGAMMA", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + ], + [ + "-m", + "GTRGAMMA", + "-J", + "MR", + "-w", + "/out", + "-z", + "/out/RAxML_bootstrap.pin.tre", + "-n", + "consensus.pin.tre", + ], +] +`; + +exports[`RAxML args > BS+con full 1`] = ` +[ + [ + "-T", + 3, + "-k", + "-x", + 123, + "-p", + 123, + "-N", + 200, + "-m", + "GTRGAMMA", + "--HKY85", + "-O", + "-o", + "t1,t2", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/parts.txt", + "-r", + "/in/backbone.tre", + "-g", + "/in/multifurcating.tre", + ], + [ + "-T", + 3, + "-m", + "GTRGAMMA", + "--HKY85", + "-J", + "MR", + "-w", + "/out", + "-z", + "/out/RAxML_bootstrap.pin.tre", + "-n", + "consensus.pin.tre", + "-r", + "/in/backbone.tre", + "-g", + "/in/multifurcating.tre", + ], +] +`; + +exports[`RAxML args > FT alternate 1`] = ` +[ + [ + "-f", + "E", + "-p", + 123, + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-O", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/RAxML_pin.part.txt", + ], + [ + "-f", + "e", + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-t", + "/out/RAxML_fastTree.pin.tre", + "-n", + "sh.pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/RAxML_pin.part.txt", + ], +] +`; + +exports[`RAxML args > FT bare 1`] = ` +[ + [ + "-f", + "E", + "-p", + 123, + "-m", + "GTRGAMMA", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + ], +] +`; + +exports[`RAxML args > FT full 1`] = ` +[ + [ + "-T", + 3, + "-f", + "E", + "-p", + 123, + "-m", + "GTRGAMMA", + "--HKY85", + "-O", + "-o", + "t1,t2", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/parts.txt", + ], + [ + "-T", + 3, + "-f", + "e", + "-m", + "GTRGAMMA", + "--HKY85", + "-t", + "/out/RAxML_fastTree.pin.tre", + "-n", + "brL.pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/parts.txt", + ], + [ + "-T", + 3, + "-f", + "e", + "-m", + "GTRGAMMA", + "--HKY85", + "-t", + "/out/RAxML_result.brL.pin.tre", + "-n", + "sh.pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/parts.txt", + ], +] +`; + +exports[`RAxML args > ML alternate 1`] = ` +[ + [ + "-f", + "d", + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-N", + 1, + "-O", + "-p", + 123, + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/RAxML_pin.part.txt", + ], + [ + "-f", + "e", + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-t", + "/out/RAxML_bestTree.pin.tre", + "-n", + "sh.pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/RAxML_pin.part.txt", + ], +] +`; + +exports[`RAxML args > ML bare 1`] = ` +[ + [ + "-f", + "d", + "-m", + "GTRGAMMA", + "-N", + 1, + "-p", + 123, + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + ], +] +`; + +exports[`RAxML args > ML full 1`] = ` +[ + [ + "-T", + 3, + "-f", + "d", + "-m", + "GTRGAMMA", + "--HKY85", + "-N", + 10, + "-O", + "-p", + 123, + "-n", + "pin.tre", + "-o", + "t1,t2", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/parts.txt", + "-r", + "/in/backbone.tre", + "-g", + "/in/multifurcating.tre", + ], + [ + "-T", + 3, + "-f", + "e", + "-m", + "GTRGAMMA", + "--HKY85", + "-t", + "/out/RAxML_bestTree.pin.tre", + "-n", + "sh.pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/parts.txt", + ], +] +`; + +exports[`RAxML args > ML+rBS alternate 1`] = ` +[ + [ + "-f", + "a", + "-x", + 123, + "-p", + 123, + "-N", + 100, + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-O", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/RAxML_pin.part.txt", + ], +] +`; + +exports[`RAxML args > ML+rBS bare 1`] = ` +[ + [ + "-f", + "a", + "-x", + 123, + "-p", + 123, + "-N", + 100, + "-m", + "GTRGAMMA", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + ], +] +`; + +exports[`RAxML args > ML+rBS full 1`] = ` +[ + [ + "-T", + 3, + "-f", + "a", + "-x", + 123, + "-p", + 123, + "-N", + 200, + "-m", + "GTRGAMMA", + "--HKY85", + "-k", + "-O", + "-o", + "t1,t2", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/parts.txt", + "-r", + "/in/backbone.tre", + "-g", + "/in/multifurcating.tre", + ], +] +`; + +exports[`RAxML args > ML+tBS alternate 1`] = ` +[ + [ + "-b", + 123, + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-p", + 123, + "-N", + 100, + "-O", + "-n", + "pinR.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/RAxML_pin.part.txt", + ], + [ + "-f", + "d", + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-p", + 123, + "-N", + 1, + "-O", + "-n", + "pinB.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/RAxML_pin.part.txt", + ], + [ + "-f", + "b", + "-t", + "/out/RAxML_bestTree.pinB.tre", + "-z", + "/out/RAxML_bootstrap.pinR.tre", + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-O", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + ], +] +`; + +exports[`RAxML args > ML+tBS bare 1`] = ` +[ + [ + "-b", + 123, + "-m", + "GTRGAMMA", + "-p", + 123, + "-N", + 100, + "-n", + "pinR.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + ], + [ + "-f", + "d", + "-m", + "GTRGAMMA", + "-p", + 123, + "-N", + 1, + "-n", + "pinB.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + ], + [ + "-f", + "b", + "-t", + "/out/RAxML_bestTree.pinB.tre", + "-z", + "/out/RAxML_bootstrap.pinR.tre", + "-m", + "GTRGAMMA", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + ], +] +`; + +exports[`RAxML args > ML+tBS full 1`] = ` +[ + [ + "-T", + 3, + "-b", + 123, + "-m", + "GTRGAMMA", + "--HKY85", + "-k", + "-p", + 123, + "-N", + 200, + "-O", + "-o", + "t1,t2", + "-n", + "pinR.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/parts.txt", + "-r", + "/in/backbone.tre", + "-g", + "/in/multifurcating.tre", + ], + [ + "-T", + 3, + "-f", + "d", + "-m", + "GTRGAMMA", + "--HKY85", + "-p", + 123, + "-N", + 10, + "-O", + "-o", + "t1,t2", + "-n", + "pinB.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/parts.txt", + "-r", + "/in/backbone.tre", + "-g", + "/in/multifurcating.tre", + ], + [ + "-T", + 3, + "-f", + "b", + "-t", + "/out/RAxML_bestTree.pinB.tre", + "-z", + "/out/RAxML_bootstrap.pinR.tre", + "-m", + "GTRGAMMA", + "--HKY85", + "-O", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + ], +] +`; + +exports[`RAxML args > PD alternate 1`] = ` +[ + [ + "-f", + "x", + "-p", + 123, + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-O", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/RAxML_pin.part.txt", + ], +] +`; + +exports[`RAxML args > PD bare 1`] = ` +[ + [ + "-f", + "x", + "-p", + 123, + "-m", + "GTRGAMMA", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + ], +] +`; + +exports[`RAxML args > PD full 1`] = ` +[ + [ + "-T", + 3, + "-f", + "x", + "-p", + 123, + "-m", + "GTRGAMMA", + "--HKY85", + "-O", + "-t", + "/in/start.tre", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/parts.txt", + ], +] +`; + +exports[`RAxML args > RBS alternate 1`] = ` +[ + [ + "-f", + "D", + "-p", + 123, + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-O", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/RAxML_pin.part.txt", + ], +] +`; + +exports[`RAxML args > RBS bare 1`] = ` +[ + [ + "-f", + "D", + "-p", + 123, + "-m", + "GTRGAMMA", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + ], +] +`; + +exports[`RAxML args > RBS full 1`] = ` +[ + [ + "-T", + 3, + "-f", + "D", + "-p", + 123, + "-m", + "GTRGAMMA", + "--HKY85", + "-k", + "-o", + "t1,t2", + "-O", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/parts.txt", + "-r", + "/in/backbone.tre", + "-g", + "/in/multifurcating.tre", + ], +] +`; + +exports[`RAxML-NG args > AS alternate 1`] = ` +[ + [ + "--ancestral", + "--msa", + "/in/a.fasta", + "--model", + "GTR+G", + "--prefix", + "/out/pin", + "--tree", + ], +] +`; + +exports[`RAxML-NG args > AS bare 1`] = ` +[ + [ + "--ancestral", + "--msa", + "/in/a.fasta", + "--model", + "GTR+G", + "--prefix", + "/out/pin", + "--tree", + ], +] +`; + +exports[`RAxML-NG args > AS full 1`] = ` +[ + [ + "--ancestral", + "--msa", + "/in/a.fasta", + "--model", + "/in/parts.txt", + "--prefix", + "/out/pin", + "--tree", + "/in/start.tre", + ], +] +`; + +exports[`RAxML-NG args > CC alternate 1`] = ` +[ + [ + "--parse", + "--model", + "/in/RAxML_pin.part.txt", + "--prefix", + "/out/pin", + "--msa", + "/in/a.fasta", + ], +] +`; + +exports[`RAxML-NG args > CC bare 1`] = ` +[ + [ + "--parse", + "--model", + "GTR+G", + "--prefix", + "/out/pin", + "--msa", + "/in/a.fasta", + ], +] +`; + +exports[`RAxML-NG args > CC full 1`] = ` +[ + [ + "--parse", + "--model", + "/in/parts.txt", + "--prefix", + "/out/pin", + "--msa", + "/in/a.fasta", + "--tree-constraint", + "/in/backbone.tre", + "--tree-constraint", + "/in/multifurcating.tre", + ], +] +`; + +exports[`RAxML-NG args > ML+TBE+con alternate 1`] = ` +[ + [ + "--all", + "--msa", + "/in/a.fasta", + "--model", + "/in/RAxML_pin.part.txt", + "--prefix", + "/out/pin", + "--seed", + 123, + "--bs-metric", + "tbe", + "--tree", + "rand{1}", + "--bs-trees", + 100, + ], +] +`; + +exports[`RAxML-NG args > ML+TBE+con bare 1`] = ` +[ + [ + "--all", + "--msa", + "/in/a.fasta", + "--model", + "GTR+G", + "--prefix", + "/out/pin", + "--seed", + 123, + "--bs-metric", + "tbe", + "--tree", + "rand{1}", + "--bs-trees", + 100, + ], +] +`; + +exports[`RAxML-NG args > ML+TBE+con full 1`] = ` +[ + [ + "--all", + "--msa", + "/in/a.fasta", + "--model", + "/in/parts.txt", + "--prefix", + "/out/pin", + "--seed", + 123, + "--threads", + 3, + "--outgroup", + "t1,t2", + "--bs-metric", + "tbe", + "--tree", + "rand{10}", + "--bs-trees", + "autoMRE", + "--tree-constraint", + "/in/backbone.tre", + "--tree-constraint", + "/in/multifurcating.tre", + ], +] +`; + +exports[`RAxML-NG args > ML+tBS+con alternate 1`] = ` +[ + [ + "--all", + "--msa", + "/in/a.fasta", + "--model", + "/in/RAxML_pin.part.txt", + "--prefix", + "/out/pin", + "--seed", + 123, + "--bs-metric", + "fbp", + "--tree", + "rand{1}", + "--bs-trees", + 100, + ], +] +`; + +exports[`RAxML-NG args > ML+tBS+con bare 1`] = ` +[ + [ + "--all", + "--msa", + "/in/a.fasta", + "--model", + "GTR+G", + "--prefix", + "/out/pin", + "--seed", + 123, + "--bs-metric", + "fbp", + "--tree", + "rand{1}", + "--bs-trees", + 100, + ], +] +`; + +exports[`RAxML-NG args > ML+tBS+con full 1`] = ` +[ + [ + "--all", + "--msa", + "/in/a.fasta", + "--model", + "/in/parts.txt", + "--prefix", + "/out/pin", + "--seed", + 123, + "--threads", + 3, + "--outgroup", + "t1,t2", + "--bs-metric", + "fbp", + "--tree", + "rand{10}", + "--bs-trees", + "autoMRE", + "--tree-constraint", + "/in/backbone.tre", + "--tree-constraint", + "/in/multifurcating.tre", + ], +] +`; + +exports[`RAxML-NG args > SC alternate 1`] = ` +[ + [ + "--check", + "--model", + "/in/RAxML_pin.part.txt", + "--prefix", + "/out/pin", + "--msa", + "/in/a.fasta", + ], +] +`; + +exports[`RAxML-NG args > SC bare 1`] = ` +[ + [ + "--check", + "--model", + "GTR+G", + "--prefix", + "/out/pin", + "--msa", + "/in/a.fasta", + ], +] +`; + +exports[`RAxML-NG args > SC full 1`] = ` +[ + [ + "--check", + "--model", + "/in/parts.txt", + "--prefix", + "/out/pin", + "--msa", + "/in/a.fasta", + "--tree-constraint", + "/in/backbone.tre", + "--tree-constraint", + "/in/multifurcating.tre", + ], +] +`; + +exports[`RAxML-NG args > TI alternate 1`] = ` +[ + [ + "--msa", + "/in/a.fasta", + "--model", + "/in/RAxML_pin.part.txt", + "--prefix", + "/out/pin", + "--seed", + 123, + "--tree", + "rand{1}", + ], +] +`; + +exports[`RAxML-NG args > TI bare 1`] = ` +[ + [ + "--msa", + "/in/a.fasta", + "--model", + "GTR+G", + "--prefix", + "/out/pin", + "--seed", + 123, + "--tree", + "rand{1}", + ], +] +`; + +exports[`RAxML-NG args > TI full 1`] = ` +[ + [ + "--msa", + "/in/a.fasta", + "--model", + "/in/parts.txt", + "--prefix", + "/out/pin", + "--threads", + 3, + "--seed", + 123, + "--outgroup", + "t1,t2", + "--tree", + "rand{10}", + "--tree-constraint", + "/in/backbone.tre", + "--tree-constraint", + "/in/multifurcating.tre", + ], +] +`; + +exports[`args for an analysis the builder does not know > RAxML 1`] = `[]`; + +exports[`args for an analysis the builder does not know > RAxML-NG 1`] = `[]`; + +exports[`args, branches the three variants miss > RAxML FT alternate with branch lengths 1`] = ` +[ + [ + "-f", + "E", + "-p", + 123, + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-O", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/RAxML_pin.part.txt", + ], + [ + "-f", + "e", + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-t", + "/out/RAxML_fastTree.pin.tre", + "-n", + "brL.pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/RAxML_pin.part.txt", + ], + [ + "-f", + "e", + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-t", + "/out/RAxML_result.brL.pin.tre", + "-n", + "sh.pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + "-q", + "/in/RAxML_pin.part.txt", + ], +] +`; + +exports[`args, branches the three variants miss > RAxML FT with branch lengths and SH-like values on a default partition 1`] = ` +[ + [ + "-f", + "E", + "-p", + 123, + "-m", + "GTRGAMMA", + "-O", + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + ], + [ + "-f", + "e", + "-m", + "GTRGAMMA", + "-t", + "/out/RAxML_fastTree.pin.tre", + "-n", + "brL.pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + ], + [ + "-f", + "e", + "-m", + "GTRGAMMA", + "-t", + "/out/RAxML_result.brL.pin.tre", + "-n", + "sh.pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + ], +] +`; + +exports[`args, branches the three variants miss > RAxML ML with SH-like values on a default partition 1`] = ` +[ + [ + "-f", + "d", + "-m", + "GTRGAMMA", + "-N", + 1, + "-O", + "-p", + 123, + "-n", + "pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + ], + [ + "-f", + "e", + "-m", + "GTRGAMMA", + "-t", + "/out/RAxML_bestTree.pin.tre", + "-n", + "sh.pin.tre", + "-s", + "/in/a.fasta", + "-w", + "/out", + ], +] +`; + +exports[`args, branches the three variants miss > RAxML-NG AS with two alignments 1`] = ` +[ + [ + "--ancestral", + "--msa", + "/out/RAxML_pin_concat.txt", + "--model", + "/out/RAxML_pin_concat.part.txt", + "--prefix", + "/out/pin", + "--tree", + ], +] +`; + +exports[`command and settings file > ASTRAL > command 1`] = `"java -jar astral.5.7.8.jar -i /in/genes.tre -o /out/ASTRAL_pin.tre"`; + +exports[`command and settings file > ASTRAL > settingsFileContent 1`] = ` +"The analysis was run using raxmlGUI 2.0 (version 2.0.0) as follows: +Analysis: ML + rapid bootstrap +Binary: astral.5.7.8.jar version 5.7.8 +Results saved to: /out +RAxML was called with these arguments: +1.) -i /in/genes.tre -o /out/ASTRAL_pin.tre +" +`; + +exports[`command and settings file > ModelTest-NG > command 1`] = `"modeltest-ng -d nt -i /in/a.fasta -o /out/RAxML_GUI_ModelTest_pin --force -p 3"`; + +exports[`command and settings file > ModelTest-NG > settingsFileContent 1`] = ` +"The analysis was run using raxmlGUI 2.0 (version 2.0.0) as follows: +Analysis: ML + rapid bootstrap +Binary: modeltest-ng version 0.1.7 +Results saved to: /out +RAxML was called with these arguments: +1.) -d nt -i /in/a.fasta -o /out/RAxML_GUI_ModelTest_pin --force -p 3 +" +`; + +exports[`command and settings file > RAxML > command 1`] = ` +"raxmlHPC-PTHREADS-SSE3 -T 3 -b 123 -m GTRGAMMA --HKY85 -k -p 123 -N 200 -O -o t1,t2 -n pinR.tre -s /in/a.fasta -w /out -q /in/parts.txt -r /in/backbone.tre -g /in/multifurcating.tre &&\\ +raxmlHPC-PTHREADS-SSE3 -T 3 -f d -m GTRGAMMA --HKY85 -p 123 -N 10 -O -o t1,t2 -n pinB.tre -s /in/a.fasta -w /out -q /in/parts.txt -r /in/backbone.tre -g /in/multifurcating.tre &&\\ +raxmlHPC-PTHREADS-SSE3 -T 3 -f b -t /out/RAxML_bestTree.pinB.tre -z /out/RAxML_bootstrap.pinR.tre -m GTRGAMMA --HKY85 -O -n pin.tre -s /in/a.fasta -w /out" +`; + +exports[`command and settings file > RAxML > settingsFileContent 1`] = ` +"The analysis was run using raxmlGUI 2.0 (version 2.0.0) as follows: +Analysis: ML + thorough bootstrap +Binary: raxmlHPC-PTHREADS-SSE3 version 8.2.12 +Results saved to: /out +RAxML was called with these arguments: +1.) -T 3 -b 123 -m GTRGAMMA --HKY85 -k -p 123 -N 200 -O -o t1,t2 -n pinR.tre -s /in/a.fasta -w /out -q /in/parts.txt -r /in/backbone.tre -g /in/multifurcating.tre +2.) -T 3 -f d -m GTRGAMMA --HKY85 -p 123 -N 10 -O -o t1,t2 -n pinB.tre -s /in/a.fasta -w /out -q /in/parts.txt -r /in/backbone.tre -g /in/multifurcating.tre +3.) -T 3 -f b -t /out/RAxML_bestTree.pinB.tre -z /out/RAxML_bootstrap.pinR.tre -m GTRGAMMA --HKY85 -O -n pin.tre -s /in/a.fasta -w /out +" +`; + +exports[`command and settings file > RAxML-NG > command 1`] = `"raxml-ng --all --msa /in/a.fasta --model /in/parts.txt --prefix /out/pin --seed 123 --outgroup t1,t2 --bs-metric tbe --tree rand{10} --bs-trees autoMRE --tree-constraint /in/backbone.tre --tree-constraint /in/multifurcating.tre"`; + +exports[`command and settings file > RAxML-NG > settingsFileContent 1`] = ` +"The analysis was run using raxmlGUI 2.0 (version 2.0.0) as follows: +Analysis: ML + transfer bootstrap expectation + consensus +Binary: raxml-ng version 1.2.2 +Results saved to: /out +RAxML was called with these arguments: +1.) --all --msa /in/a.fasta --model /in/parts.txt --prefix /out/pin --seed 123 --outgroup t1,t2 --bs-metric tbe --tree rand{10} --bs-trees autoMRE --tree-constraint /in/backbone.tre --tree-constraint /in/multifurcating.tre +" +`; diff --git a/src/app/store/__snapshots__/Run.pins.windows.test.ts.snap b/src/app/store/__snapshots__/Run.pins.windows.test.ts.snap new file mode 100644 index 00000000..9e1f8eed --- /dev/null +++ b/src/app/store/__snapshots__/Run.pins.windows.test.ts.snap @@ -0,0 +1,1516 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +exports[`ASTRAL args > with a loaded tree 1`] = ` +[ + [ + "-i", + ""C:\\in\\genes.tre"", + "-o", + ""C:\\out\\ASTRAL_pin.tre"", + ], +] +`; + +exports[`ASTRAL args > without a tree 1`] = ` +[ + [ + "-o", + ""C:\\out\\ASTRAL_pin.tre"", + ], +] +`; + +exports[`ModelTest-NG args > binary 1`] = ` +[ + [ + "-i", + ""C:\\in\\a.fasta"", + "-o", + ""C:\\out\\RAxML_GUI_ModelTest_pin"", + "--force", + "-p", + 3, + ], +] +`; + +exports[`ModelTest-NG args > nucleotide 1`] = ` +[ + [ + "-d", + "nt", + "-i", + ""C:\\in\\a.fasta"", + "-o", + ""C:\\out\\RAxML_GUI_ModelTest_pin"", + "--force", + "-p", + 3, + ], +] +`; + +exports[`ModelTest-NG args > protein 1`] = ` +[ + [ + "-d", + "aa", + "-i", + ""C:\\in\\a.fasta"", + "-o", + ""C:\\out\\RAxML_GUI_ModelTest_pin"", + "--force", + "-p", + 3, + ], +] +`; + +exports[`RAxML args > AS alternate 1`] = ` +[ + [ + "-f", + "A", + "-t", + """", + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\RAxML_pin.part.txt"", + ], +] +`; + +exports[`RAxML args > AS bare 1`] = ` +[ + [ + "-f", + "A", + "-t", + """", + "-m", + "GTRGAMMA", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + ], +] +`; + +exports[`RAxML args > AS full 1`] = ` +[ + [ + "-T", + 3, + "-f", + "A", + "-t", + ""C:\\in\\start.tre"", + "-m", + "GTRGAMMA", + "--HKY85", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\parts.txt"", + ], +] +`; + +exports[`RAxML args > BS+con alternate 1`] = ` +[ + [ + "-x", + 123, + "-p", + 123, + "-N", + 100, + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-O", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\RAxML_pin.part.txt"", + ], + [ + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-J", + "MR", + "-w", + ""C:\\out"", + "-z", + ""C:\\out\\RAxML_bootstrap.pin.tre"", + "-n", + "consensus.pin.tre", + ], +] +`; + +exports[`RAxML args > BS+con bare 1`] = ` +[ + [ + "-x", + 123, + "-p", + 123, + "-N", + 100, + "-m", + "GTRGAMMA", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + ], + [ + "-m", + "GTRGAMMA", + "-J", + "MR", + "-w", + ""C:\\out"", + "-z", + ""C:\\out\\RAxML_bootstrap.pin.tre"", + "-n", + "consensus.pin.tre", + ], +] +`; + +exports[`RAxML args > BS+con full 1`] = ` +[ + [ + "-T", + 3, + "-k", + "-x", + 123, + "-p", + 123, + "-N", + 200, + "-m", + "GTRGAMMA", + "--HKY85", + "-O", + "-o", + "t1,t2", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\parts.txt"", + "-r", + ""C:\\in\\backbone.tre"", + "-g", + ""C:\\in\\multifurcating.tre"", + ], + [ + "-T", + 3, + "-m", + "GTRGAMMA", + "--HKY85", + "-J", + "MR", + "-w", + ""C:\\out"", + "-z", + ""C:\\out\\RAxML_bootstrap.pin.tre"", + "-n", + "consensus.pin.tre", + "-r", + ""C:\\in\\backbone.tre"", + "-g", + ""C:\\in\\multifurcating.tre"", + ], +] +`; + +exports[`RAxML args > FT alternate 1`] = ` +[ + [ + "-f", + "E", + "-p", + 123, + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-O", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\RAxML_pin.part.txt"", + ], + [ + "-f", + "e", + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-t", + ""C:\\out\\RAxML_fastTree.pin.tre"", + "-n", + "sh.pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\RAxML_pin.part.txt"", + ], +] +`; + +exports[`RAxML args > FT bare 1`] = ` +[ + [ + "-f", + "E", + "-p", + 123, + "-m", + "GTRGAMMA", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + ], +] +`; + +exports[`RAxML args > FT full 1`] = ` +[ + [ + "-T", + 3, + "-f", + "E", + "-p", + 123, + "-m", + "GTRGAMMA", + "--HKY85", + "-O", + "-o", + "t1,t2", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\parts.txt"", + ], + [ + "-T", + 3, + "-f", + "e", + "-m", + "GTRGAMMA", + "--HKY85", + "-t", + ""C:\\out\\RAxML_fastTree.pin.tre"", + "-n", + "brL.pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\parts.txt"", + ], + [ + "-T", + 3, + "-f", + "e", + "-m", + "GTRGAMMA", + "--HKY85", + "-t", + ""C:\\out\\RAxML_result.brL.pin.tre"", + "-n", + "sh.pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\parts.txt"", + ], +] +`; + +exports[`RAxML args > ML alternate 1`] = ` +[ + [ + "-f", + "d", + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-N", + 1, + "-O", + "-p", + 123, + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\RAxML_pin.part.txt"", + ], + [ + "-f", + "e", + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-t", + ""C:\\out\\RAxML_bestTree.pin.tre"", + "-n", + "sh.pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\RAxML_pin.part.txt"", + ], +] +`; + +exports[`RAxML args > ML bare 1`] = ` +[ + [ + "-f", + "d", + "-m", + "GTRGAMMA", + "-N", + 1, + "-p", + 123, + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + ], +] +`; + +exports[`RAxML args > ML full 1`] = ` +[ + [ + "-T", + 3, + "-f", + "d", + "-m", + "GTRGAMMA", + "--HKY85", + "-N", + 10, + "-O", + "-p", + 123, + "-n", + "pin.tre", + "-o", + "t1,t2", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\parts.txt"", + "-r", + ""C:\\in\\backbone.tre"", + "-g", + ""C:\\in\\multifurcating.tre"", + ], + [ + "-T", + 3, + "-f", + "e", + "-m", + "GTRGAMMA", + "--HKY85", + "-t", + ""C:\\out\\RAxML_bestTree.pin.tre"", + "-n", + "sh.pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\parts.txt"", + ], +] +`; + +exports[`RAxML args > ML+rBS alternate 1`] = ` +[ + [ + "-f", + "a", + "-x", + 123, + "-p", + 123, + "-N", + 100, + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-O", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\RAxML_pin.part.txt"", + ], +] +`; + +exports[`RAxML args > ML+rBS bare 1`] = ` +[ + [ + "-f", + "a", + "-x", + 123, + "-p", + 123, + "-N", + 100, + "-m", + "GTRGAMMA", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + ], +] +`; + +exports[`RAxML args > ML+rBS full 1`] = ` +[ + [ + "-T", + 3, + "-f", + "a", + "-x", + 123, + "-p", + 123, + "-N", + 200, + "-m", + "GTRGAMMA", + "--HKY85", + "-k", + "-O", + "-o", + "t1,t2", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\parts.txt"", + "-r", + ""C:\\in\\backbone.tre"", + "-g", + ""C:\\in\\multifurcating.tre"", + ], +] +`; + +exports[`RAxML args > ML+tBS alternate 1`] = ` +[ + [ + "-b", + 123, + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-p", + 123, + "-N", + 100, + "-O", + "-n", + "pinR.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\RAxML_pin.part.txt"", + ], + [ + "-f", + "d", + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-p", + 123, + "-N", + 1, + "-O", + "-n", + "pinB.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\RAxML_pin.part.txt"", + ], + [ + "-f", + "b", + "-t", + ""C:\\out\\RAxML_bestTree.pinB.tre"", + "-z", + ""C:\\out\\RAxML_bootstrap.pinR.tre"", + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-O", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + ], +] +`; + +exports[`RAxML args > ML+tBS bare 1`] = ` +[ + [ + "-b", + 123, + "-m", + "GTRGAMMA", + "-p", + 123, + "-N", + 100, + "-n", + "pinR.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + ], + [ + "-f", + "d", + "-m", + "GTRGAMMA", + "-p", + 123, + "-N", + 1, + "-n", + "pinB.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + ], + [ + "-f", + "b", + "-t", + ""C:\\out\\RAxML_bestTree.pinB.tre"", + "-z", + ""C:\\out\\RAxML_bootstrap.pinR.tre"", + "-m", + "GTRGAMMA", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + ], +] +`; + +exports[`RAxML args > ML+tBS full 1`] = ` +[ + [ + "-T", + 3, + "-b", + 123, + "-m", + "GTRGAMMA", + "--HKY85", + "-k", + "-p", + 123, + "-N", + 200, + "-O", + "-o", + "t1,t2", + "-n", + "pinR.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\parts.txt"", + "-r", + ""C:\\in\\backbone.tre"", + "-g", + ""C:\\in\\multifurcating.tre"", + ], + [ + "-T", + 3, + "-f", + "d", + "-m", + "GTRGAMMA", + "--HKY85", + "-p", + 123, + "-N", + 10, + "-O", + "-o", + "t1,t2", + "-n", + "pinB.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\parts.txt"", + "-r", + ""C:\\in\\backbone.tre"", + "-g", + ""C:\\in\\multifurcating.tre"", + ], + [ + "-T", + 3, + "-f", + "b", + "-t", + ""C:\\out\\RAxML_bestTree.pinB.tre"", + "-z", + ""C:\\out\\RAxML_bootstrap.pinR.tre"", + "-m", + "GTRGAMMA", + "--HKY85", + "-O", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + ], +] +`; + +exports[`RAxML args > PD alternate 1`] = ` +[ + [ + "-f", + "x", + "-p", + 123, + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-O", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\RAxML_pin.part.txt"", + ], +] +`; + +exports[`RAxML args > PD bare 1`] = ` +[ + [ + "-f", + "x", + "-p", + 123, + "-m", + "GTRGAMMA", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + ], +] +`; + +exports[`RAxML args > PD full 1`] = ` +[ + [ + "-T", + 3, + "-f", + "x", + "-p", + 123, + "-m", + "GTRGAMMA", + "--HKY85", + "-O", + "-t", + ""C:\\in\\start.tre"", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\parts.txt"", + ], +] +`; + +exports[`RAxML args > RBS alternate 1`] = ` +[ + [ + "-f", + "D", + "-p", + 123, + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-O", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\RAxML_pin.part.txt"", + ], +] +`; + +exports[`RAxML args > RBS bare 1`] = ` +[ + [ + "-f", + "D", + "-p", + 123, + "-m", + "GTRGAMMA", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + ], +] +`; + +exports[`RAxML args > RBS full 1`] = ` +[ + [ + "-T", + 3, + "-f", + "D", + "-p", + 123, + "-m", + "GTRGAMMA", + "--HKY85", + "-k", + "-o", + "t1,t2", + "-O", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\parts.txt"", + "-r", + ""C:\\in\\backbone.tre"", + "-g", + ""C:\\in\\multifurcating.tre"", + ], +] +`; + +exports[`RAxML-NG args > AS alternate 1`] = ` +[ + [ + "--ancestral", + "--msa", + ""C:\\in\\a.fasta"", + "--model", + "GTR+G", + "--prefix", + ""C:\\out\\pin"", + "--tree", + """", + ], +] +`; + +exports[`RAxML-NG args > AS bare 1`] = ` +[ + [ + "--ancestral", + "--msa", + ""C:\\in\\a.fasta"", + "--model", + "GTR+G", + "--prefix", + ""C:\\out\\pin"", + "--tree", + """", + ], +] +`; + +exports[`RAxML-NG args > AS full 1`] = ` +[ + [ + "--ancestral", + "--msa", + ""C:\\in\\a.fasta"", + "--model", + ""C:\\in\\parts.txt"", + "--prefix", + ""C:\\out\\pin"", + "--tree", + ""C:\\in\\start.tre"", + ], +] +`; + +exports[`RAxML-NG args > CC alternate 1`] = ` +[ + [ + "--parse", + "--model", + ""C:\\in\\RAxML_pin.part.txt"", + "--prefix", + ""C:\\out\\pin"", + "--msa", + ""C:\\in\\a.fasta"", + ], +] +`; + +exports[`RAxML-NG args > CC bare 1`] = ` +[ + [ + "--parse", + "--model", + "GTR+G", + "--prefix", + ""C:\\out\\pin"", + "--msa", + ""C:\\in\\a.fasta"", + ], +] +`; + +exports[`RAxML-NG args > CC full 1`] = ` +[ + [ + "--parse", + "--model", + ""C:\\in\\parts.txt"", + "--prefix", + ""C:\\out\\pin"", + "--msa", + ""C:\\in\\a.fasta"", + "--tree-constraint", + ""C:\\in\\backbone.tre"", + "--tree-constraint", + ""C:\\in\\multifurcating.tre"", + ], +] +`; + +exports[`RAxML-NG args > ML+TBE+con alternate 1`] = ` +[ + [ + "--all", + "--msa", + ""C:\\in\\a.fasta"", + "--model", + ""C:\\in\\RAxML_pin.part.txt"", + "--prefix", + ""C:\\out\\pin"", + "--seed", + 123, + "--bs-metric", + "tbe", + "--tree", + "rand{1}", + "--bs-trees", + 100, + ], +] +`; + +exports[`RAxML-NG args > ML+TBE+con bare 1`] = ` +[ + [ + "--all", + "--msa", + ""C:\\in\\a.fasta"", + "--model", + "GTR+G", + "--prefix", + ""C:\\out\\pin"", + "--seed", + 123, + "--bs-metric", + "tbe", + "--tree", + "rand{1}", + "--bs-trees", + 100, + ], +] +`; + +exports[`RAxML-NG args > ML+TBE+con full 1`] = ` +[ + [ + "--all", + "--msa", + ""C:\\in\\a.fasta"", + "--model", + ""C:\\in\\parts.txt"", + "--prefix", + ""C:\\out\\pin"", + "--seed", + 123, + "--threads", + 3, + "--outgroup", + "t1,t2", + "--bs-metric", + "tbe", + "--tree", + "rand{10}", + "--bs-trees", + "autoMRE", + "--tree-constraint", + ""C:\\in\\backbone.tre"", + "--tree-constraint", + ""C:\\in\\multifurcating.tre"", + ], +] +`; + +exports[`RAxML-NG args > ML+tBS+con alternate 1`] = ` +[ + [ + "--all", + "--msa", + ""C:\\in\\a.fasta"", + "--model", + ""C:\\in\\RAxML_pin.part.txt"", + "--prefix", + ""C:\\out\\pin"", + "--seed", + 123, + "--bs-metric", + "fbp", + "--tree", + "rand{1}", + "--bs-trees", + 100, + ], +] +`; + +exports[`RAxML-NG args > ML+tBS+con bare 1`] = ` +[ + [ + "--all", + "--msa", + ""C:\\in\\a.fasta"", + "--model", + "GTR+G", + "--prefix", + ""C:\\out\\pin"", + "--seed", + 123, + "--bs-metric", + "fbp", + "--tree", + "rand{1}", + "--bs-trees", + 100, + ], +] +`; + +exports[`RAxML-NG args > ML+tBS+con full 1`] = ` +[ + [ + "--all", + "--msa", + ""C:\\in\\a.fasta"", + "--model", + ""C:\\in\\parts.txt"", + "--prefix", + ""C:\\out\\pin"", + "--seed", + 123, + "--threads", + 3, + "--outgroup", + "t1,t2", + "--bs-metric", + "fbp", + "--tree", + "rand{10}", + "--bs-trees", + "autoMRE", + "--tree-constraint", + ""C:\\in\\backbone.tre"", + "--tree-constraint", + ""C:\\in\\multifurcating.tre"", + ], +] +`; + +exports[`RAxML-NG args > SC alternate 1`] = ` +[ + [ + "--check", + "--model", + ""C:\\in\\RAxML_pin.part.txt"", + "--prefix", + ""C:\\out\\pin"", + "--msa", + ""C:\\in\\a.fasta"", + ], +] +`; + +exports[`RAxML-NG args > SC bare 1`] = ` +[ + [ + "--check", + "--model", + "GTR+G", + "--prefix", + ""C:\\out\\pin"", + "--msa", + ""C:\\in\\a.fasta"", + ], +] +`; + +exports[`RAxML-NG args > SC full 1`] = ` +[ + [ + "--check", + "--model", + ""C:\\in\\parts.txt"", + "--prefix", + ""C:\\out\\pin"", + "--msa", + ""C:\\in\\a.fasta"", + "--tree-constraint", + ""C:\\in\\backbone.tre"", + "--tree-constraint", + ""C:\\in\\multifurcating.tre"", + ], +] +`; + +exports[`RAxML-NG args > TI alternate 1`] = ` +[ + [ + "--msa", + ""C:\\in\\a.fasta"", + "--model", + ""C:\\in\\RAxML_pin.part.txt"", + "--prefix", + ""C:\\out\\pin"", + "--seed", + 123, + "--tree", + "rand{1}", + ], +] +`; + +exports[`RAxML-NG args > TI bare 1`] = ` +[ + [ + "--msa", + ""C:\\in\\a.fasta"", + "--model", + "GTR+G", + "--prefix", + ""C:\\out\\pin"", + "--seed", + 123, + "--tree", + "rand{1}", + ], +] +`; + +exports[`RAxML-NG args > TI full 1`] = ` +[ + [ + "--msa", + ""C:\\in\\a.fasta"", + "--model", + ""C:\\in\\parts.txt"", + "--prefix", + ""C:\\out\\pin"", + "--threads", + 3, + "--seed", + 123, + "--outgroup", + "t1,t2", + "--tree", + "rand{10}", + "--tree-constraint", + ""C:\\in\\backbone.tre"", + "--tree-constraint", + ""C:\\in\\multifurcating.tre"", + ], +] +`; + +exports[`args for an analysis the builder does not know > RAxML 1`] = `[]`; + +exports[`args for an analysis the builder does not know > RAxML-NG 1`] = `[]`; + +exports[`args, branches the three variants miss > RAxML FT alternate with branch lengths 1`] = ` +[ + [ + "-f", + "E", + "-p", + 123, + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-O", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\RAxML_pin.part.txt"", + ], + [ + "-f", + "e", + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-t", + ""C:\\out\\RAxML_fastTree.pin.tre"", + "-n", + "brL.pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\RAxML_pin.part.txt"", + ], + [ + "-f", + "e", + "-m", + "ASC_MULTIGAMMA", + "--asc-corr=lewis", + "-K", + "MK", + "-t", + ""C:\\out\\RAxML_result.brL.pin.tre"", + "-n", + "sh.pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + "-q", + ""C:\\in\\RAxML_pin.part.txt"", + ], +] +`; + +exports[`args, branches the three variants miss > RAxML FT with branch lengths and SH-like values on a default partition 1`] = ` +[ + [ + "-f", + "E", + "-p", + 123, + "-m", + "GTRGAMMA", + "-O", + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + ], + [ + "-f", + "e", + "-m", + "GTRGAMMA", + "-t", + ""C:\\out\\RAxML_fastTree.pin.tre"", + "-n", + "brL.pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + ], + [ + "-f", + "e", + "-m", + "GTRGAMMA", + "-t", + ""C:\\out\\RAxML_result.brL.pin.tre"", + "-n", + "sh.pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + ], +] +`; + +exports[`args, branches the three variants miss > RAxML ML with SH-like values on a default partition 1`] = ` +[ + [ + "-f", + "d", + "-m", + "GTRGAMMA", + "-N", + 1, + "-O", + "-p", + 123, + "-n", + "pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + ], + [ + "-f", + "e", + "-m", + "GTRGAMMA", + "-t", + ""C:\\out\\RAxML_bestTree.pin.tre"", + "-n", + "sh.pin.tre", + "-s", + ""C:\\in\\a.fasta"", + "-w", + ""C:\\out"", + ], +] +`; + +exports[`args, branches the three variants miss > RAxML-NG AS with two alignments 1`] = ` +[ + [ + "--ancestral", + "--msa", + ""C:\\out\\RAxML_pin_concat.txt"", + "--model", + ""C:\\out\\RAxML_pin_concat.part.txt"", + "--prefix", + ""C:\\out\\pin"", + "--tree", + """", + ], +] +`; + +exports[`command and settings file > ASTRAL > command 1`] = `"java -jar astral.5.7.8.jar -i "C:\\in\\genes.tre" -o "C:\\out\\ASTRAL_pin.tre""`; + +exports[`command and settings file > ASTRAL > settingsFileContent 1`] = ` +"The analysis was run using raxmlGUI 2.0 (version 2.0.0) as follows: +Analysis: ML + rapid bootstrap +Binary: astral.5.7.8.jar version 5.7.8 +Results saved to: C:\\out +RAxML was called with these arguments: +1.) -i "C:\\in\\genes.tre" -o "C:\\out\\ASTRAL_pin.tre" +" +`; + +exports[`command and settings file > ModelTest-NG > command 1`] = `"modeltest-ng.exe -d nt -i "C:\\in\\a.fasta" -o "C:\\out\\RAxML_GUI_ModelTest_pin" --force -p 3"`; + +exports[`command and settings file > ModelTest-NG > settingsFileContent 1`] = ` +"The analysis was run using raxmlGUI 2.0 (version 2.0.0) as follows: +Analysis: ML + rapid bootstrap +Binary: modeltest-ng.exe version 0.1.7 +Results saved to: C:\\out +RAxML was called with these arguments: +1.) -d nt -i "C:\\in\\a.fasta" -o "C:\\out\\RAxML_GUI_ModelTest_pin" --force -p 3 +" +`; + +exports[`command and settings file > RAxML > command 1`] = ` +"raxmlHPC-PTHREADS-SSE3.exe -T 3 -b 123 -m GTRGAMMA --HKY85 -k -p 123 -N 200 -O -o t1,t2 -n pinR.tre -s "C:\\in\\a.fasta" -w "C:\\out" -q "C:\\in\\parts.txt" -r "C:\\in\\backbone.tre" -g "C:\\in\\multifurcating.tre" &&\\ +raxmlHPC-PTHREADS-SSE3.exe -T 3 -f d -m GTRGAMMA --HKY85 -p 123 -N 10 -O -o t1,t2 -n pinB.tre -s "C:\\in\\a.fasta" -w "C:\\out" -q "C:\\in\\parts.txt" -r "C:\\in\\backbone.tre" -g "C:\\in\\multifurcating.tre" &&\\ +raxmlHPC-PTHREADS-SSE3.exe -T 3 -f b -t "C:\\out\\RAxML_bestTree.pinB.tre" -z "C:\\out\\RAxML_bootstrap.pinR.tre" -m GTRGAMMA --HKY85 -O -n pin.tre -s "C:\\in\\a.fasta" -w "C:\\out"" +`; + +exports[`command and settings file > RAxML > settingsFileContent 1`] = ` +"The analysis was run using raxmlGUI 2.0 (version 2.0.0) as follows: +Analysis: ML + thorough bootstrap +Binary: raxmlHPC-PTHREADS-SSE3.exe version 8.2.12 +Results saved to: C:\\out +RAxML was called with these arguments: +1.) -T 3 -b 123 -m GTRGAMMA --HKY85 -k -p 123 -N 200 -O -o t1,t2 -n pinR.tre -s "C:\\in\\a.fasta" -w "C:\\out" -q "C:\\in\\parts.txt" -r "C:\\in\\backbone.tre" -g "C:\\in\\multifurcating.tre" +2.) -T 3 -f d -m GTRGAMMA --HKY85 -p 123 -N 10 -O -o t1,t2 -n pinB.tre -s "C:\\in\\a.fasta" -w "C:\\out" -q "C:\\in\\parts.txt" -r "C:\\in\\backbone.tre" -g "C:\\in\\multifurcating.tre" +3.) -T 3 -f b -t "C:\\out\\RAxML_bestTree.pinB.tre" -z "C:\\out\\RAxML_bootstrap.pinR.tre" -m GTRGAMMA --HKY85 -O -n pin.tre -s "C:\\in\\a.fasta" -w "C:\\out" +" +`; + +exports[`command and settings file > RAxML-NG > command 1`] = `"raxml-ng.exe --all --msa "C:\\in\\a.fasta" --model "C:\\in\\parts.txt" --prefix "C:\\out\\pin" --seed 123 --outgroup t1,t2 --bs-metric tbe --tree rand{10} --bs-trees autoMRE --tree-constraint "C:\\in\\backbone.tre" --tree-constraint "C:\\in\\multifurcating.tre""`; + +exports[`command and settings file > RAxML-NG > settingsFileContent 1`] = ` +"The analysis was run using raxmlGUI 2.0 (version 2.0.0) as follows: +Analysis: ML + transfer bootstrap expectation + consensus +Binary: raxml-ng.exe version 1.2.2 +Results saved to: C:\\out +RAxML was called with these arguments: +1.) --all --msa "C:\\in\\a.fasta" --model "C:\\in\\parts.txt" --prefix "C:\\out\\pin" --seed 123 --outgroup t1,t2 --bs-metric tbe --tree rand{10} --bs-trees autoMRE --tree-constraint "C:\\in\\backbone.tre" --tree-constraint "C:\\in\\multifurcating.tre" +" +`; diff --git a/src/test/commandPins.ts b/src/test/commandPins.ts new file mode 100644 index 00000000..4f220199 --- /dev/null +++ b/src/test/commandPins.ts @@ -0,0 +1,251 @@ +// The command pins: the exact argument lists today's Run builds, one table for both platform test files. +// The store is imported inside pinCommands, so the Windows file can set the host first. +// This file must not import ./setup: after vi.resetModules that would install a second default bridge. +import { afterEach, describe, expect, it } from 'vitest'; + +import type Alignment from '../app/store/Alignment'; +import type AstralTree from '../app/store/AstralTree'; +import type Run from '../app/store/Run'; +import type { RendererBridge } from '../common/rendererBridge'; + +type RunParent = ConstructorParameters[0]; +type Variant = 'bare' | 'full' | 'alternate'; + +// The output name check resolves to the name it was asked for, and the app version is fixed. +export const pinBridge: Partial = { + checkOutput: ( { outputDir, outputName } ) => + Promise.resolve( { outputDir, outputName, ok: true, notice: '', outputNameUnused: outputName, resultFilenames: [] } ), + getVersion: () => Promise.resolve( '2.0.0' ), +}; + +export async function pinCommands( { windows }: { windows: boolean } ): Promise { + const { autorun, runInAction } = await import( 'mobx' ); + const { default: RunStore } = await import( '../app/store/Run' ); + const { analysisOptions, raxmlNgAnalysisOptions, binaries } = await import( '../app/store/RunOptions' ); + + const file = ( ...parts: string[] ): string => ( windows + ? `C:\\${parts.join( '\\' )}` + : `/${parts.join( '/' )}` ); + const exe = ( name: string ): string => ( windows + ? `${name}.exe` + : name ); + // The binary list depends on the host's platform, arch and CPU count, and ASTRAL is commented out of it. + // A binary the list lacks is added, so every pin runs on every machine. + const binary = ( name: string, type: string, version: string ): string => { + if ( !binaries.some( ( b ) => b.name === name ) ) { + binaries.push( { name, type, version } ); + } + return name; + }; + const names = { + raxml: binary( exe( 'raxmlHPC' ), 'raxml', '8.2.12' ), + raxmlThreads: binary( exe( 'raxmlHPC-PTHREADS-SSE3' ), 'raxml', '8.2.12' ), + raxmlNg: binary( exe( 'raxml-ng' ), 'raxml', '1.2.2' ), + // No shipped RAxML-NG binary has PTHREADS in its name, so only this stand-in reaches the --threads branch. + raxmlNgThreads: binary( exe( 'raxml-ng-PTHREADS' ), 'raxml', '1.2.2' ), + modeltest: binary( exe( 'modeltest-ng' ), 'modeltest', '0.1.7' ), + astral: binary( 'astral.5.7.8.jar', 'astral', '5.7.8' ), + }; + + const alignment = ( dataType = 'nucleotide', over: Record = {} ): Alignment => ( { + name: 'a', + path: file( 'in', 'a.fasta' ), + filename: 'a.fasta', + dir: file( 'in' ), + taxons: ['t1', 't2', 't3', 't4'], + length: 10, + dataType, + hasInvariantSites: false, + modeltestLoading: false, + ngSubstitutionModelCmd: 'GTR+G', + aaMatrixName: 'BLOSUM62', + partition: { isDefault: true, isComplete: true }, + ...over, + } as unknown as Alignment ); + + const variants: Record Alignment[]; set: ( run: Run ) => void }> = { + bare: { + alignments: () => [alignment()], + set: ( run ) => { + run.disableCheckUndeterminedSequence = false; + }, + }, + full: { + alignments: () => [alignment()], + set: ( run ) => { + run.partitionFile = file( 'in', 'parts.txt' ); + run.outGroup.setValue( ['t1', 't2'] ); + run.useBackboneConstraint = true; + run.useMultifurcatingConstraint = true; + run.backboneConstraint.setFilePath( file( 'in', 'backbone.tre' ) ); + run.multifurcatingConstraint.setFilePath( file( 'in', 'multifurcating.tre' ) ); + run.branchLength.setValue( true ); + run.sHlike.setValue( true ); + run.startingTree.setValue( 'User defined' ); + run.tree.setFilePath( file( 'in', 'start.tre' ) ); + run.substitutionMatrix.setValue( 'HKY' ); + run.numRuns.setValue( 10 ); + run.numRepetitions.setValue( 200 ); + run.numRepetitionsNg.setValue( 'autoMRE' ); + }, + }, + alternate: { + alignments: () => [alignment( 'multistate', { partition: { isDefault: false, isComplete: true } } )], + set: ( run ) => { + run.sHlike.setValue( true ); + run.multistateModel.setValue( 'MK' ); + run.substitutionAscertainment.setValue( "Lewis' method" ); + }, + }, + }; + + const stops: ( () => void )[] = []; + afterEach( () => { + while ( stops.length ) { + stops.pop()?.(); + } + } ); + + async function build( + binaryName: string, + analysis: string | undefined, + alignments: Alignment[], + set?: ( run: Run ) => void, + ): Promise { + const run = new RunStore( {} as RunParent, 1 ); + runInAction( () => { + run.binary.value = binaryName; + run.outputDir = file( 'out' ); + run.outputName = 'pin'; + run.alignments = alignments; + } ); + // analysis is a computed that builds its option; keep it observed so a set value sticks. + stops.push( autorun( () => run.analysis ) ); + // The output name check is async and only computes while observed. + stops.push( autorun( () => run.outputNameAvailable.get() ) ); + runInAction( () => { + if ( analysis ) { + run.analysis.setValue( analysis ); + } + run.setRandomSeed( 123 ); + run.numThreads.setValue( 3 ); + set?.( run ); + } ); + // Lets the output name check and the app version settle. + await new Promise( ( resolve ) => setTimeout( resolve, 0 ) ); + return run; + } + + // The output name only reads as settled inside a reaction. + function read( fn: () => T ): T { + let value!: T; + autorun( () => { + value = fn(); + } )(); + return value; + } + + const families = [ + { title: 'RAxML', options: analysisOptions, plain: names.raxml, threaded: names.raxmlThreads }, + { title: 'RAxML-NG', options: raxmlNgAnalysisOptions, plain: names.raxmlNg, threaded: names.raxmlNgThreads }, + ]; + for ( const { title, options, plain, threaded } of families ) { + describe( `${title} args`, () => { + for ( const { value } of options ) { + for ( const variant of ['bare', 'full', 'alternate'] as const ) { + it( `${value} ${variant}`, async () => { + const { alignments, set } = variants[variant]; + const run = await build( variant === 'full' + ? threaded + : plain, value, alignments(), set ); + expect( read( () => run.args ) ).toMatchSnapshot(); + } ); + } + } + } ); + } + + describe( 'args, branches the three variants miss', () => { + // The follow-up commands of fast tree search and ML search copy the first command's branches. + it( 'RAxML FT alternate with branch lengths', async () => { + const run = await build( names.raxml, 'FT', variants.alternate.alignments(), ( r ) => { + variants.alternate.set( r ); + r.branchLength.setValue( true ); + } ); + expect( read( () => run.args ) ).toMatchSnapshot(); + } ); + + it( 'RAxML FT with branch lengths and SH-like values on a default partition', async () => { + const run = await build( names.raxml, 'FT', [alignment()], ( r ) => { + r.branchLength.setValue( true ); + r.sHlike.setValue( true ); + } ); + expect( read( () => run.args ) ).toMatchSnapshot(); + } ); + + it( 'RAxML ML with SH-like values on a default partition', async () => { + const run = await build( names.raxml, 'ML', [alignment()], ( r ) => r.sHlike.setValue( true ) ); + expect( read( () => run.args ) ).toMatchSnapshot(); + } ); + + // RAxML-NG ancestral states chooses its partition by "more than one alignment", not by a non-default partition. + it( 'RAxML-NG AS with two alignments', async () => { + const second = alignment( 'nucleotide', { path: file( 'in', 'b.fasta' ), filename: 'b.fasta' } ); + const run = await build( names.raxmlNg, 'AS', [alignment(), second] ); + expect( read( () => run.args ) ).toMatchSnapshot(); + } ); + } ); + + // The empty default arm of each builder's switch. + describe( 'args for an analysis the builder does not know', () => { + for ( const [title, binaryName] of [['RAxML', names.raxml], ['RAxML-NG', names.raxmlNg]] ) { + it( title, async () => { + const run = await build( binaryName, 'unknown', [alignment()] ); + expect( read( () => run.args ) ).toMatchSnapshot(); + } ); + } + } ); + + describe( 'ModelTest-NG args', () => { + for ( const dataType of ['nucleotide', 'protein', 'binary'] ) { + it( dataType, async () => { + const run = await build( names.modeltest, undefined, [alignment( dataType )] ); + expect( read( () => run.args ) ).toMatchSnapshot(); + } ); + } + } ); + + const withAstralTree = ( run: Run ): void => { + run.astralTree = { path: file( 'in', 'genes.tre' ) } as AstralTree; + }; + + describe( 'ASTRAL args', () => { + it( 'with a loaded tree', async () => { + const run = await build( names.astral, undefined, [], withAstralTree ); + expect( read( () => run.args ) ).toMatchSnapshot(); + } ); + + it( 'without a tree', async () => { + const run = await build( names.astral, undefined, [] ); + expect( read( () => run.args ) ).toMatchSnapshot(); + } ); + } ); + + describe( 'command and settings file', () => { + const cases: [string, () => Promise][] = [ + // Thorough bootstrap is three commands, so the pin shows how they are joined. + ['RAxML', () => build( names.raxmlThreads, 'ML+tBS', variants.full.alignments(), variants.full.set )], + // The shipped binary: the full variant's stand-in name would be pinned into the command text. + ['RAxML-NG', () => build( names.raxmlNg, 'ML+TBE+con', variants.full.alignments(), variants.full.set )], + ['ModelTest-NG', () => build( names.modeltest, undefined, [alignment()] )], + ['ASTRAL', () => build( names.astral, undefined, [], withAstralTree )], + ]; + for ( const [title, make] of cases ) { + it( title, async () => { + const run = await make(); + expect( read( () => run.command ) ).toMatchSnapshot( 'command' ); + expect( read( () => run.settingsFileContent ) ).toMatchSnapshot( 'settingsFileContent' ); + } ); + } + } ); +}