Skip to content

Write the _modified alignment beside the original when a parent folder contains its base name #340

Done

Description

@jtklein-agents

Upstream reports (11): 194, 199, 200, 233, 248, 250, 274, 293, 312, 359, 379

Most-reported file error upstream (11 reports, 2021 to 2025, Windows and macOS): loading an alignment fails with a raw ENOENT: no such file or directory, open '<dir>/<name>_modified/<name>.fas'.

In every report the failing path has _modified on a folder, not on the file: .../r3_modified/r3.fas, .../Allobates_modified ML/Allobates.fasta, ...\leptomafft3000_modified.fasta\leptomafft3000.fasta.

Cause (confirmed in this fork's code)

src/main/parseAlignment.ts:98:

newFilePath = actualPath.replace( baseName, `${baseName}_modified` );

String.replace changes the first match. When a parent folder name contains the file's base name (/data/r3/r3.fas), the folder part is rewritten and the write goes to a folder that does not exist.

Fix

Build the new path from the directory and the file name, not by replacing inside the full path.

Acceptance

  • An alignment that needs renaming (duplicate or illegal taxon names) at <tmp>/abc/abc.fas is written to <tmp>/abc/abc_modified.fas.
  • Same for a folder that only contains the base name (abc ML/abc.fas).
  • A test covers both.

Source: issues filed through the in-app "Report to GitHub" button on the upstream tracker. Read one with gh issue view <n> --repo AntonelliLab/raxmlGUI. Upstream numbers are in code spans on purpose, so this ticket does not post a back-reference on each upstream issue. Not reproduced on this fork unless stated above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions