Skip to content

Add --view flag to launch StrucTTY viewer after easy-search#579

Open
LunaJang wants to merge 4 commits intosteineggerlab:masterfrom
LunaJang:Foldseek-StrucTTY
Open

Add --view flag to launch StrucTTY viewer after easy-search#579
LunaJang wants to merge 4 commits intosteineggerlab:masterfrom
LunaJang:Foldseek-StrucTTY

Conversation

@LunaJang
Copy link
Copy Markdown

@LunaJang LunaJang commented Apr 6, 2026

Summary

  • Add --view boolean flag to easy-search workflow (default: off)
  • When enabled, automatically launches StrucTTY with query structure, result file, and target DB after search completion
  • If StrucTTY is not found in PATH, prints a warning and exits normally — search results are always preserved

Changed files

  • LocalParameters.h/cpp — register --view parameter
  • EasyStructureSearch.cpp — pass VIEW_RESULTS and QUERY_INPUT to shell script
  • easystructuresearch.sh — StrucTTY invocation logic (before REMOVE_TMP)

Test plan

  • easy-search without --view: no behavior change
  • easy-search --view 1 without StrucTTY in PATH: warning message, results preserved
  • easy-search --view 1 with StrucTTY in PATH: viewer launches with correct arguments

🤖 Generated with Claude Code

@LunaJang
Copy link
Copy Markdown
Author

LunaJang commented Apr 9, 2026

@milot-mirdita
Hi, sorry to tag you directly...

This PR adds a --view flag to invoke StrucTTY for terminal visualization of Foldseek hits.
It builds cleanly locally, but CI is failing with -Werror promotions coming from existing submodule code (lib/mmseqs/src/commons/CSProfile.cpp, lib/foldcomp/src/database_writer.cpp, and a few others) — files my PR doesn't touch.
The last successful master build was in March, so... I suspect the CI toolchain may have picked up new warnings since then, but I'd really appreciate a second pair of eyes before I rule out my own changes....!

Happy to rebase/update submodules/adjust anything on my end if you can point me in the right direction. Thanks!!!!

@LunaJang
Copy link
Copy Markdown
Author

LunaJang commented Apr 13, 2026

Summary

  • Add --view boolean flag to easy-search, search, easy-rbh, iterative-search,
    and profile workflows (default: off) to launch StrucTTY after the search
    completes
  • Add --structty parameter for specifying the StrucTTY binary outside of
    PATH; passing it implicitly enables view mode
  • Add standalone foldseek view command that launches StrucTTY directly against
    an existing .m8 file without re-running a search (foldseek view <i:queryFile> <i:resultM8> [<i:targetDB>] )
  • Extract the StrucTTY invocation logic into a shared helper script
    structty_viewer.sh, embedded into the binary and emitted to tmpDir at runtime,
    so every workflow shares the same binary-resolution and command-assembly logic
  • For search-style workflows that produce alignment DBs (not .m8), automatically
    run convertalis (29-col format) before invoking the viewer so StrucTTY can
    consume the output
  • If StrucTTY is not found on PATH and --structty is unset, print a warning and
    exit normally — search results are always preserved; if --structty points to a
    missing or non-executable path, error out explicitly

Changed files

  • src/commons/LocalParameters.h/cpp — register PARAM_VIEW_RESULTS and
    PARAM_STRUCTTY_PATH; add viewworkflow parameter set; promote --view to
    structuresearchworkflow in addition to easystructuresearchworkflow
  • src/FoldseekBase.cpp + src/LocalCommandDeclarations.h — register the new view
    command
  • src/workflow/StructTTYView.cpp (new) + src/workflow/CMakeLists.txt —
    implementation of the standalone foldseek view workflow
  • src/workflow/EasyStructureSearch.cpp — pass VIEW_RESULTS, STRUCTTY_PATH,
    QUERY_INPUT to the shell script and emit structty_viewer.sh to tmpDir
  • src/workflow/StructureSearch.cpp — same wiring for the search workflow plus
    convertalis parameter handling
  • src/workflow/EasyStructureRbh.cpp — post-process StrucTTY invocation in C++
    since easyrbh.sh lives in the mmseqs library and cannot be modified
  • data/structty_viewer.sh (new) + data/CMakeLists.txt — shared helper that
    resolves the StrucTTY binary (explicit path → PATH → warning) and assembles
    StrucTTY --foldseek --db
  • data/easystructuresearch.sh — replace inline StrucTTY block with a call to
    structty_viewer.sh
  • data/structuresearch.sh, data/structureiterativesearch.sh,
    data/structureprofile.sh — run convertalis to a temp .m8 then invoke
    structty_viewer.sh before REMOVE_TMP
  • data/easystructurerbh.sh — viewer hook for the easy-rbh path

LunaJang and others added 2 commits April 15, 2026 15:22
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@LunaJang
Copy link
Copy Markdown
Author

Summary

  • Add StrucTTY viewer integration to launch an interactive terminal-based
    structure viewer directly from Foldseek search results.

  • Add --view flag to easy-search, search, and easy-rbh to automatically launch
    StrucTTY after a search

  • Add --structty flag to specify a custom StrucTTY binary path (also implicitly
    activates the viewer)

  • Add foldseek structty subcommand to view existing result files independently

Usage:

  • Launch viewer after search
    foldseek easy-search query.pdb target/ result.m8 tmp --view 1

  • Specify custom StrucTTY binary path
    foldseek easy-search query.pdb target/ result.m8 tmp --structty
    /path/to/StrucTTY

  • View existing results
    foldseek structty query.pdb result.m8 [targetDB]

Changed Files

  • src/commons/LocalParameters.h/.cpp — Add --view and --structty parameters;
    register them to structuresearchworkflow, easystructuresearchworkflow, and
    structtyworkflow
  • src/workflow/StructTTYView.cpp — New file; implements the structty subcommand
    that writes and executes structty_viewer.sh at runtime
  • src/FoldseekBase.cpp — Register structty as a new COMMAND_EASY subcommand
  • src/LocalCommandDeclarations.h — Declare structtyview function
  • data/structty_viewer.sh — Shell script that handles StrucTTY invocation logic
  • data/easystructuresearch.sh, data/easystructurerbh.sh,
    data/structuresearch.sh, data/structureiterativesearch.sh,
    data/structureprofile.sh — Add --view / --structty handling to trigger the
    viewer after search completion
  • data/CMakeLists.txt, src/workflow/CMakeLists.txt — Add new files to the build
  • README.md — Add "Visualize Results with StrucTTY" section and structty to the
    command list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant