Skip to content

feat/diamond cluster - #137

Merged
alpae merged 6 commits into
devfrom
feat/diamond-cluster
Dec 2, 2026
Merged

alpae merged 6 commits into
devfrom
feat/diamond-cluster

Conversation

@alpae

@alpae alpae commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

add diamond cluster as an alternative cluster method for the --denovo flag.

alpae and others added 5 commits November 30, 2026 11:27
…f mmseqs

The unmapped proteins and singletons (with --denovo: all proteins) can now be
clustered with diamond (diamond-cluster / diamond-deepclust) to compare against
mmseqs easy-cluster (still the default). New params diamond_approx_id,
diamond_member_cover and diamond_mutual_cover; diamond gets the task threads and
the same memory budget as mmseqs (-M). The subprocess/error handling and cluster
parsing shared by both wrappers moved to clusterers/_common.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the per-tool options (--mmseqs-coverage/-cov-mode/-min-seq-id/-threads/
-split-memory-limit, --diamond-*) by generic ones that both wrappers translate:
--cluster-threads, --cluster-memory-limit, --cluster-coverage (0-1),
--cluster-cov-mode (bidirectional|member) and --cluster-min-seq-id (0-1).
--mmseqs-sensitivity stays mmseqs-only. In mmseqs clustering the target is the
member, so --cov-mode 1 == diamond --member-cover and --cov-mode 0 ==
--mutual-cover (checked with a fragment of DNAK_AQUAE, now a test). Unset, each
tool keeps its default. The Nextflow params are renamed accordingly (unreleased).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Debian ships mmseqs 15 and diamond 2.1.11; a micromamba stage now installs
pinned mmseqs2 20.ae60e and diamond 2.2.9 from bioconda (amd64 and arm64) into
/opt/tools, which is appended to PATH so its conda dependencies don't shadow
system tools. environment-conda.yml pins the same versions, so docker,
singularity and conda cluster identically. The image checks both binaries run.
With diamond 2.2.9 in all environments, --cluster-min-seq-id is passed to
diamond as --id, the identity of the alignment like mmseqs --min-seq-id,
instead of --approx-id (estimated from the bitscore). --id replaces the default
approx-id cutoff of diamond cluster (50%); unset, that default still applies.
Requires diamond >= 2.2.1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alpae
alpae changed the base branch from main to dev December 1, 2026 14:48
@alpae alpae closed this Dec 1, 2026
@alpae alpae reopened this Dec 1, 2026
Comment thread tests/test_mmseqs_wrapper.py Resolved
Comment thread tests/test_check_input.py Resolved
Comment thread FastOMA/infer_roothogs.py Resolved
- A --clusterer diamond-* that is not installed now stops the run in
  check_input and infer_roothogs, also without --denovo. Before, the
  proteins without OMAmer placement and the singletons were silently
  left unclustered. A missing default mmseqs still only skips this
  clustering with a warning, as before.
- read_clusters puts the representative first in each cluster. diamond
  writes its lines in member order, so the representative could come
  later, contrary to the docstrings.
- cluster_sequences (mmseqs) checks cov_mode before looking for the
  binary, so test_unknown_cov_mode passes without mmseqs installed.
- The tests that hide mmseqs/diamond now use an empty PATH. The
  interpreter's own folder also holds mmseqs and diamond in the conda
  env.
- The protein trace records the clusterer that was used
  (source=<clusterer>) instead of source=linclust. The --denovo memory
  comment in base.config mentions diamond too.
@alpae
alpae merged commit 52f0886 into dev Dec 2, 2026
26 checks passed
@alpae
alpae deleted the feat/diamond-cluster branch December 2, 2026 11:44
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