pax_global_header 0000666 0000000 0000000 00000000064 15234073120 0014507 g ustar 00root root 0000000 0000000 52 comment=6dc57174369ba131d35a21db9735a48ac01e6610
bbuchfink-diamond-6dc5717/ 0000775 0000000 0000000 00000000000 15234073120 0015415 5 ustar 00root root 0000000 0000000 bbuchfink-diamond-6dc5717/.cirrus.yml 0000664 0000000 0000000 00000000554 15234073120 0017531 0 ustar 00root root 0000000 0000000 task:
name: build
arm_container:
image: gcc:latest
cpu: 1
memory: 4G
install_script: |
apt-get update && apt-get install cmake zlib1g-dev --yes --force-yes --no-install-suggests --no-install-recommends
compile_script: |
mkdir bin && cd bin
cmake -DCMAKE_BUILD_TYPE=Release ..
make
test_script: |
cd bin && ctest -C Release bbuchfink-diamond-6dc5717/.dockerignore 0000664 0000000 0000000 00000000105 15234073120 0020065 0 ustar 00root root 0000000 0000000 .git
.vs
out
build/
cmake-build-*/
CMakeCache.txt
CMakeFiles/
*.cmake bbuchfink-diamond-6dc5717/.gitattributes 0000664 0000000 0000000 00000000572 15234073120 0020314 0 ustar 00root root 0000000 0000000 # Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
bbuchfink-diamond-6dc5717/.github/ 0000775 0000000 0000000 00000000000 15234073120 0016755 5 ustar 00root root 0000000 0000000 bbuchfink-diamond-6dc5717/.github/FUNDING.yml 0000664 0000000 0000000 00000000101 15234073120 0020562 0 ustar 00root root 0000000 0000000 # These are supported funding model platforms
github: bbuchfink
bbuchfink-diamond-6dc5717/.github/workflows/ 0000775 0000000 0000000 00000000000 15234073120 0021012 5 ustar 00root root 0000000 0000000 bbuchfink-diamond-6dc5717/.github/workflows/cmake.yml 0000664 0000000 0000000 00000003417 15234073120 0022622 0 ustar 00root root 0000000 0000000 name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
permissions:
contents: read
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ${{ matrix.os }}
strategy:
matrix:
# runner image list, https://github.com/actions/runner-images
os: [ ubuntu-latest, macos-latest, ubuntu-24.04-arm, macos-15-intel ]
steps:
- uses: actions/checkout@v2
- name: apt
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y g++ automake cmake zlib1g-dev git libzstd-dev libsqlite3-dev
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j $(nproc --all)
- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}}
bbuchfink-diamond-6dc5717/.github/workflows/codeql.yml 0000664 0000000 0000000 00000002621 15234073120 0023005 0 ustar 00root root 0000000 0000000 name: "Code Scanning - Action"
on:
pull_request:
jobs:
CodeQL-Build:
# CodeQL runs on ubuntu-latest, windows-latest, and macos-latest
runs-on: ubuntu-latest
permissions:
# required for all workflows
security-events: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below).
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# âšī¸ Command-line programs to run using the OS shell.
# đ See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# âī¸ If the Autobuild fails above, remove it and uncomment the following
# three lines and modify them (or add more) to build your code if your
# project uses a compiled language
#- run: |
# make bootstrap
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
bbuchfink-diamond-6dc5717/.gitignore 0000664 0000000 0000000 00000001534 15234073120 0017410 0 ustar 00root root 0000000 0000000 # Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msm
*.msp
# Windows shortcuts
*.lnk
# =========================
# Operating System Files
# =========================
# OSX
# =========================
.DS_Store
.AppleDouble
.LSOverride
# Thumbnails
._*
# Files that might appear on external disk
.Spotlight-V100
.Trashes
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# CMake files
CMakeCache.txt
CMakeFiles
cmake_install.cmake
install_manifest.txt
build/
.idea
Makefile
diamond
src/extra/
.vs/
.unison
/CMakeSettings.json
/out/install/x64-Debug/bin/diamond.exe
/src/test/test.ps1
/src/test/out
/src/test/data.dmnd
/CMakePresets.json
/Testing/Temporary bbuchfink-diamond-6dc5717/CITATION.cff 0000664 0000000 0000000 00000000653 15234073120 0017313 0 ustar 00root root 0000000 0000000 cff-version: "1.1.0"
authors:
-
family-names: Buchfink
given-names: "Benjamin J."
-
family-names: Reuter
given-names: Klaus
-
family-names: Drost
given-names: "Hajk-Georg"
date-released: 2021-04-07
doi: "10.1038/s41592-021-01101-x"
message: "If you use this software, please cite it using these metadata."
title: "Sensitive protein alignments at tree-of-life scale using DIAMOND"
version: "2.2.5" bbuchfink-diamond-6dc5717/CMakeLists.txt 0000664 0000000 0000000 00000060575 15234073120 0020172 0 ustar 00root root 0000000 0000000 # DIAMOND protein sequence aligner
# Copyright (C) 2012-2026 Benjamin J. Buchfink
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# SPDX-License-Identifier: GPL-3.0-or-later
cmake_minimum_required (VERSION 2.6...3.5)
project (DIAMOND)
include(CheckCXXCompilerFlag)
include(CheckSymbolExists)
include(CheckTypeSize)
option(BUILD_STATIC "BUILD_STATIC" OFF)
option(STATIC_LIBGCC "STATIC_LIBGCC" OFF)
option(STATIC_LIBSTDC++ "STATIC_LIBSTDC++" OFF)
option(X86 "X86" ON)
option(ARM "ARM" OFF)
option(AARCH64 "AARCH64" OFF)
option(WITH_ZSTD "WITH_ZSTD" OFF)
option(CROSS_COMPILE "CROSS_COMPILE" OFF)
# experimental options not suitable for deployment purposes
option(EXTRA "EXTRA" OFF)
option(STRICT_BAND "STRICT_BAND" ON)
option(LEFTMOST_SEED_FILTER "LEFTMOST_SEED_FILTER" ON)
option(SEQ_MASK "SEQ_MASK" ON)
option(DP_STAT "DP_STAT" OFF)
option(HIT_KEEP_TARGET_ID "HIT_KEEP_TARGET_ID" OFF)
option(LONG_SEEDS "LONG_SEEDS" OFF)
option(WITH_AVX512 "WITH_AVX512" OFF)
option(WITH_DNA "WITH_DNA" OFF)
option(WITH_MCL "WITH_MCL" OFF)
option(USE_TLS "USE_TLS" OFF)
set(MAX_SHAPE_LEN 19)
if(NOT CROSS_COMPILE AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64.*|AARCH64.*|arm64.*)")
set(X86 OFF)
set(AARCH64 ON)
elseif(NOT CROSS_COMPILE AND CMAKE_SYSTEM_PROCESSOR MATCHES "^(arm.*|ARM.*)")
set(X86 OFF)
set(ARM ON)
elseif(NOT CROSS_COMPILE AND CMAKE_SYSTEM_PROCESSOR MATCHES "PPC64*|ppc64*|powerpc64*")
set(X86 OFF)
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -maltivec")
elseif(NOT CROSS_COMPILE AND CMAKE_SYSTEM_PROCESSOR MATCHES "^s390|sparc")
set(X86 OFF)
endif()
if(STATIC_LIBSTDC++)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libstdc++")
endif()
if(STRICT_BAND)
add_definitions(-DSTRICT_BAND)
endif()
if(USE_TLS)
add_definitions(-DUSE_TLS)
endif()
if(SEQ_MASK)
add_definitions(-DSEQ_MASK)
endif()
if(LEFTMOST_SEED_FILTER)
add_definitions(-DLEFTMOST_SEED_FILTER)
endif()
if(DP_STAT)
add_definitions(-DDP_STAT)
endif()
if(EXTRA)
add_definitions(-DEXTRA)
endif()
if(HIT_KEEP_TARGET_ID)
add_definitions(-DHIT_KEEP_TARGET_ID)
endif()
if(LONG_SEEDS)
add_definitions(-DLONG_SEEDS)
endif()
if(WITH_AVX512)
add_definitions(-DWITH_AVX512)
endif()
if(WITH_DNA)
add_definitions(-DWITH_DNA)
endif()
if(WITH_MCL)
add_definitions(-DWITH_MCL)
endif()
if(WITH_FAMSA)
add_definitions(-DWITH_FAMSA)
endif()
add_definitions(-DMAX_SHAPE_LEN=${MAX_SHAPE_LEN})
add_definitions(-D_ITERATOR_DEBUG_LEVEL=0)
IF(STATIC_LIBGCC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc")
endif()
if(BUILD_STATIC)
set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
set(BUILD_SHARED_LIBRARIES OFF)
set(CMAKE_EXE_LINKER_FLAGS "-static")
endif()
function(set_cxx_standard std flag)
if(${CMAKE_VERSION} VERSION_LESS "3.1.0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}" PARENT_SCOPE)
else()
set(CMAKE_CXX_STANDARD ${std} PARENT_SCOPE)
endif()
endfunction(set_cxx_standard)
check_type_size(ptrdiff_t SIZEOF_PTRDIFF_T)
check_type_size(int SIZEOF_INT)
check_cxx_compiler_flag("-std=gnu++14" HAS_GNUPP14)
check_cxx_compiler_flag("-std=gnu++17" HAS_GNUPP17)
check_cxx_compiler_flag("-std=gnu++20" HAS_GNUPP20)
check_cxx_compiler_flag("-std=gnu++23" HAS_GNUPP23)
if(HAS_GNUPP23 OR ${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
set_cxx_standard(23 "-std=gnu++23")
elseif(HAS_GNUPP20)
set_cxx_standard(20 "-std=gnu++20")
elseif(HAS_GNUPP17)
set_cxx_standard(17 "-std=gnu++17")
elseif (HAS_GNUPP14)
set_cxx_standard(14 "-std=gnu++14")
else()
set_cxx_standard(11 "-std=gnu++11")
endif()
check_symbol_exists(sysinfo "sys/sysinfo.h" HAVE_SYSINFO)
if(CMAKE_BUILD_MARCH)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=${CMAKE_BUILD_MARCH}")
endif()
find_package(ZLIB REQUIRED)
find_package(Threads REQUIRED)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE Release)
endif()
if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_HAS_STD_BYTE=0)
add_definitions(-D_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS)
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffp-contract=off -Wall -Wextra -Wno-implicit-fallthrough -Wreturn-type -Wno-unused -Wno-unused-parameter -Wno-unused-variable -Wno-uninitialized -Wno-deprecated-copy -Wno-unknown-warning-option ")#-g -fsanitize=address -fno-omit-frame-pointer ")
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-pragma-clang-attribute -Wno-overloaded-virtual -Wno-missing-braces") #-g -fsanitize=thread -fno-omit-frame-pointer" )
endif()
if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fabi-version=7")
message("Setting -fabi-version for GCC 4.x")
endif()
set(DISPATCH_OBJECTS
"src/dp/swipe/banded_3frame_swipe.cpp"
"src/search/hamming/stage1_2.cpp"
"src/search/stage0.cpp"
"src/search/seed_array/seed_array.cpp"
"src/search/seed_array/seed_array_extra.cpp"
"src/tools/benchmark.cpp"
"src/dp/swipe/swipe_wrapper.cpp"
"src/masking/tantan.cpp"
"src/dp/scan_diags.cpp"
"src/dp/ungapped_simd.cpp"
"src/dp/swipe/anchored_wrapper.cpp"
"src/dp/score_profile.cpp"
"src/stats/matrix_adjust/matrix_adjust.cpp"
"src/stats/matrix_adjust/matrix_adjust_scalar.cpp"
"src/align/reseek.cpp"
"src/search/lin_index/scan.cpp"
)
if(EXTRA)
LIST(APPEND DISPATCH_OBJECTS "src/tools/benchmark_swipe.cpp")
endif()
add_library(arch_generic OBJECT ${DISPATCH_OBJECTS})
target_compile_options(arch_generic PUBLIC -DDISPATCH_ARCH=ARCH_GENERIC -DARCH_ID=0)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
target_compile_options(arch_generic PUBLIC /Zc:__cplusplus)
else()
include(CheckCXXCompilerFlag)
set(ARCH_GENERIC_CXX_FLAGS
-mtune=generic
-fno-stack-protector
)
check_cxx_compiler_flag("-fcf-protection=none"
HAVE_CXX_FLAG_FCF_PROTECTION_NONE)
if(HAVE_CXX_FLAG_FCF_PROTECTION_NONE)
list(APPEND ARCH_GENERIC_CXX_FLAGS -fcf-protection=none)
endif()
target_compile_options(arch_generic PUBLIC ${ARCH_GENERIC_CXX_FLAGS})
endif()
if(X86)
add_library(arch_sse4_1 OBJECT ${DISPATCH_OBJECTS})
add_library(arch_avx2 OBJECT ${DISPATCH_OBJECTS})
if(WITH_AVX512)
add_library(arch_avx512 OBJECT ${DISPATCH_OBJECTS})
endif()
add_definitions(-DWITH_AVX2)
add_definitions(-DWITH_SSE4_1)
if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
target_compile_options(arch_sse4_1 PUBLIC -DDISPATCH_ARCH=ARCH_SSE4_1 -DARCH_ID=1 -D__SSSE3__ -D__SSE4_1__ -D__POPCNT__ /Zc:__cplusplus)
target_compile_options(arch_avx2 PUBLIC -DDISPATCH_ARCH=ARCH_AVX2 -DARCH_ID=2 /arch:AVX2 -D__SSSE3__ -D__SSE4_1__ -D__POPCNT__ /Zc:__cplusplus)
if(WITH_AVX512)
target_compile_options(arch_avx512 PUBLIC -DDISPATCH_ARCH=ARCH_AVX512 -DARCH_ID=3 /arch:AVX512 -D__SSSE3__ -D__SSE4_1__ -D__POPCNT__)
endif()
else()
target_compile_options(arch_sse4_1 PUBLIC -DDISPATCH_ARCH=ARCH_SSE4_1 -DARCH_ID=1 -mssse3 -mpopcnt -msse4.1)
target_compile_options(arch_avx2 PUBLIC -DDISPATCH_ARCH=ARCH_AVX2 -DARCH_ID=2 -mssse3 -mpopcnt -msse4.1 -msse4.2 -mavx -mavx2 -mfma)
if(WITH_AVX512)
target_compile_options(arch_avx512 PUBLIC -DDISPATCH_ARCH=ARCH_AVX512 -DARCH_ID=3 -mssse3 -mpopcnt -msse4.1 -msse4.2 -mavx -mavx2 -mavx512f -mavx512bw)
endif()
endif()
endif(X86)
# NEON is mandatory on Aarch64
#if(AARCH64)
# add_definitions(-DWITH_NEON)
# add_library(arch_neon OBJECT ${DISPATCH_OBJECTS})
# target_compile_options(arch_neon PUBLIC -DDISPATCH_ARCH=ARCH_NEON -DARCH_ID=4 -D__ARM_NEON -D__aarch64__)
#endif(AARCH64)
# NEON is optional on Armv7, so we need to check for compiler support,
# and for the header used for runtime detection.
#if(ARM)
#check_symbol_exists(getauxval "sys/auxv.h" HAVE_GETAUXVAL)
#check_cxx_compiler_flag("-mfpu=neon" HAVE_MFPU_NEON)
#if(HAVE_MFPU_NEON)
# message(STATUS "Compiler supports NEON architecture")
# add_definitions(-DWITH_NEON)
# add_definitions(-DHAVE_MFPU_NEON)
# add_library(arch_neon OBJECT ${DISPATCH_OBJECTS})
# target_compile_options(arch_neon PUBLIC -DDISPATCH_ARCH=ARCH_NEON -DARCH_ID=4 -D__ARM_NEON -mfpu=neon)
# endif()
# if(HAVE_GETAUXVAL)
# add_definitions(-DHAVE_GETAUXVAL)
# endif()
#endif(ARM)
check_symbol_exists(getauxval "sys/auxv.h" HAVE_GETAUXVAL)
if(AARCH64)
add_definitions(-DWITH_NEON)
add_library(arch_neon OBJECT ${DISPATCH_OBJECTS})
target_compile_options(arch_neon PUBLIC -DDISPATCH_ARCH=ARCH_NEON -DARCH_ID=4 -D__ARM_NEON -D__aarch64__)
elseif(ARM)
check_cxx_compiler_flag("-mfpu=neon" HAVE_MFPU_NEON)
if(HAVE_MFPU_NEON)
add_definitions(-DWITH_NEON)
add_definitions(-DHAVE_MFPU_NEON)
add_library(arch_neon OBJECT ${DISPATCH_OBJECTS})
target_compile_options(arch_neon PUBLIC -DDISPATCH_ARCH=ARCH_NEON -DARCH_ID=4 -D__ARM_NEON -mfpu=neon)
endif()
if(HAVE_GETAUXVAL)
add_definitions(-DHAVE_GETAUXVAL)
endif()
endif()
set(OBJECTS
src/run/main.cpp
src/basic/config.cpp
src/stats/score_matrix.cpp
src/data/queries.cpp
src/search/seed_array/seed_histogram.cpp
src/legacy/daa/daa_record.cpp
src/util/command_line_parser.cpp
src/util/util.cpp
src/basic/basic.cpp
src/basic/hssp.cpp
src/dp/ungapped_align.cpp
src/run/tools.cpp
src/chaining/greedy_align.cpp
src/output/output_format.cpp
src/output/join_blocks.cpp
src/data/frequent_seeds.cpp
src/align/legacy/query_mapper.cpp
src/output/blast_tab_format.cpp
src/output/blast_pairwise_format.cpp
src/run/double_indexed.cpp
src/output/sam_format.cpp
src/align/align.cpp
src/search/setup.cpp
src/data/taxonomy.cpp
src/masking/masking.cpp
src/data/seed_set.cpp
src/util/simd.cpp
src/output/taxon_format.cpp
src/legacy/daa/view.cpp
src/output/output_sink.cpp
src/output/target_culling.cpp
src/align/legacy/banded_swipe_pipeline.cpp
src/util/io/compressed_buffer.cpp
src/util/io/file.cpp
src/data/taxon_list.cpp
src/data/taxonomy_nodes.cpp
src/lib/murmurhash/MurmurHash3.cpp
src/output/paf_format.cpp
src/util/system/system.cpp
src/util/sequence/sequence.cpp
src/tools/tools.cpp
src/tools/composition_matrix.cpp
src/util/system/getRSS.cpp
src/lib/tantan/LambdaCalculator.cc
src/util/string/string.cpp
src/align/extend.cpp
src/test/test.cpp
src/align/ungapped.cpp
src/align/gapped_score.cpp
src/align/gapped_final.cpp
src/align/full_db.cpp
src/align/culling.cpp
src/align/output.cpp
src/chaining/smith_waterman.cpp
src/output/xml_format.cpp
src/align/gapped_filter.cpp
src/util/parallel/filestack.cpp
src/util/parallel/parallelizer.cpp
src/util/parallel/multiprocessing.cpp
src/lib/alp/njn_dynprogprob.cpp
src/lib/alp/njn_dynprogproblim.cpp
src/lib/alp/njn_dynprogprobproto.cpp
src/lib/alp/njn_ioutil.cpp
src/lib/alp/njn_localmaxstat.cpp
src/lib/alp/njn_localmaxstatmatrix.cpp
src/lib/alp/njn_localmaxstatutil.cpp
src/lib/alp/njn_random.cpp
src/lib/alp/sls_alignment_evaluer.cpp
src/lib/alp/sls_alp.cpp
src/lib/alp/sls_alp_data.cpp
src/lib/alp/sls_alp_regression.cpp
src/lib/alp/sls_alp_sim.cpp
src/lib/alp/sls_basic.cpp
src/lib/alp/sls_pvalues.cpp
src/align/global_ranking/global_ranking.cpp
src/align/global_ranking/extend.cpp
src/lib/blast/blast_seg.cpp
src/lib/blast/blast_filter.cpp
src/lib/blast/nlm_linear_algebra.cpp
src/stats/stats.cpp
src/stats/cbs.cpp
src/stats/comp_based_stats.cpp
src/stats/hauser_correction.cpp
src/stats/matrix_adjust/matrix_adjust_wrapper.cpp
src/data/index.cpp
src/legacy/dmnd/dmnd.cpp
src/data/sequence_file.cpp
src/data/block/block.cpp
src/data/block/block_wrapper.cpp
src/run/config.cpp
src/data/sequence_set.cpp
src/align/global_ranking/table.cpp
src/legacy/daa/daa_write.cpp
src/search/seed_complexity.cpp
src/basic/value.cpp
src/masking/motifs.cpp
src/align/alt_hsp.cpp
src/data/fasta/fasta_file.cpp
src/cluster/output.cpp
src/cluster/realign.cpp
src/cluster/reassign.cpp
src/util/io/read_text_mt.cpp
src/tools/greedy_vertex_cover.cpp
#src/cluster/cascaded/recluster.cpp
src/cluster/helpers.cpp
src/search/kmer_ranking.cpp
src/chaining/hamming_ext.cpp
src/lib/blast/blast_message.cpp
src/lib/blast/blast_stat.cpp
src/lib/blast/blastn_score.cpp
src/lib/blast/ncbi_std.cpp
src/legacy/daa/merge.cpp
src/chaining/backtrace.cpp
src/dp/scalar/smith_waterman.cpp
#src/util/algo/mcl.cpp
src/stats/matrix_adjust/ncbi.cpp
src/search/hit_buffer.cpp
src/data/blastdb/phr.cpp
src/data/blastdb/psq.cpp
src/data/blastdb/pin.cpp
src/data/blastdb/pal.cpp
src/data/blastdb/asn1.cpp
src/data/blastdb/blastdb.cpp
src/test/queue.cpp
src/test/hit_buffer_stress.cpp
src/cluster/multinode.cpp
src/cluster/data.cpp
src/cluster/len_sort.cpp
src/cluster/make_blocks.cpp
src/cluster/merge.cpp
src/cluster/search.cpp
src/cluster/lin_index.cpp
src/search/lin_index/lin_index.cpp
src/util/io/zlib_bridge.cpp
src/util/sequence/seqindex.cpp
)
if(WITH_DNA)
list(APPEND OBJECTS
src/contrib/dna/smith_watermann.cpp
src/contrib/dna/dna_index.cpp
src/contrib/dna/seed_set_dna.cpp
src/contrib/dna/extension.cpp
src/contrib/dna/chain.cpp
src/contrib/dna/extension_chain.cpp
src/contrib/dna/alignment.cpp
src/contrib/dna/extension_seed_matches.cpp
src/contrib/dna/smith_watermann.cpp
src/lib/ksw2/ksw2_extz2_sse.c
src/lib/ksw2/ksw2_extz.c
src/lib/WFA2-lib.diamond/bindings/cpp/WFAligner.cpp
src/contrib/dna/build_score.cpp
)
endif()
if(WITH_MCL)
list(APPEND OBJECTS src/contrib/mcl/mcl.cpp
src/contrib/mcl/clustering_variables.cpp
src/contrib/mcl/clustering_format.cpp)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
if(WITH_ZSTD)
set(ZSTD_OBJ "src/util/io/zstd_bridge.cpp")
endif()
if(X86)
if(WITH_AVX512)
add_executable(diamond $ $ $ $ ${OBJECTS} ${ZSTD_OBJ})
else()
add_executable(diamond $ $ $ ${OBJECTS} ${ZSTD_OBJ})
endif()
elseif(ARM OR AARCH64)
if(AARCH64 OR HAVE_MFPU_NEON)
add_executable(diamond $ $ ${OBJECTS} ${ZSTD_OBJ})
else()
add_executable(diamond $ ${OBJECTS} ${ZSTD_OBJ})
endif()
else()
add_executable(diamond $ ${OBJECTS} ${ZSTD_OBJ})
endif()
if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
target_compile_options(diamond PUBLIC /Zc:__cplusplus)
endif()
include_directories("${CMAKE_SOURCE_DIR}/src/" "${ZLIB_INCLUDE_DIR}" "${CMAKE_SOURCE_DIR}/src/lib")
#find_package(SQLite3)
#target_link_libraries(diamond SQLite::SQLite3 ${CMAKE_DL_LIBS})
find_path(${SQLite3_INCLUDE_DIR} NAMES sqlite3.h PATHS ${SQLite3_INCLUDE_DIR})
find_library(SQLite3_LIBRARY NAMES libsqlite3.a libsqlite3.so libsqlite3.so.0 sqlite3 HINTS /opt/homebrew/opt/sqlite/lib /usr/local/opt/sqlite/lib)
message(STATUS "SQLite3 Library: ${SQLite3_LIBRARY}")
target_include_directories(diamond PRIVATE "${SQLite3_INCLUDE_DIR}")
target_link_libraries(diamond ${SQLite3_LIBRARY} ${CMAKE_DL_LIBS})
if(WITH_ZSTD)
find_path(ZSTD_INCLUDE_DIR NAMES zstd.h)
find_library(ZSTD_LIBRARY NAMES zstd libzstd_static libzstd.a)
message(STATUS "Zstd Library: ${ZSTD_LIBRARY}")
message(STATUS "Zstd include: ${ZSTD_INCLUDE_DIR}")
if(NOT ZSTD_INCLUDE_DIR)
message(FATAL_ERROR "Could not find zstd.h")
endif()
if(NOT ZSTD_LIBRARY)
message(FATAL_ERROR "Could not find zstd library")
endif()
#target_include_directories(diamond PRIVATE "${ZSTD_INCLUDE_DIR}")
include_directories("${ZSTD_INCLUDE_DIR}")
target_link_libraries(diamond "${ZSTD_LIBRARY}")
add_definitions(-DWITH_ZSTD)
endif()
if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
find_library(BCRYPT_LIBRARY BCrypt)
find_library(WS2_32_LIBRARY Ws2_32)
target_link_libraries(diamond ${BCRYPT_LIBRARY} ${WS2_32_LIBRARY})
endif()
target_link_libraries(diamond ${ZLIB_LIBRARY} ${CMAKE_THREAD_LIBS_INIT})
install(TARGETS diamond DESTINATION bin)
enable_testing()
SET(TD ${CMAKE_SOURCE_DIR}/src/test)
SET(SP -DTEST_DIR=${CMAKE_SOURCE_DIR}/src/test -P ${CMAKE_SOURCE_DIR}/src/test/test.cmake)
SET(SP_EC -DTEST_DIR=${CMAKE_SOURCE_DIR}/src/test -P ${CMAKE_SOURCE_DIR}/src/test/test_exit_code.cmake)
function(add_diamond_test NAME ARGS)
add_test(NAME ${NAME} COMMAND ${CMAKE_COMMAND} -DNAME=${NAME} "-DARGS=${ARGS}" ${SP})
endfunction()
function(add_diamond_test_exit_code NAME ARGS)
add_test(NAME ${NAME} COMMAND ${CMAKE_COMMAND} -DNAME=${NAME} "-DARGS=${ARGS}" ${SP_EC})
endfunction()
add_diamond_test_exit_code(makedb-nr_10k "makedb --in ${TD}/nr_10k.faa -d nr_10k --taxonmap ${TD}/nr_10k.taxids.tsv --taxonnames ${TD}/mini_names.dmp --taxonnodes ${TD}/mini_nodes.dmp")
add_test(NAME blastp COMMAND ${CMAKE_COMMAND} -DNAME=blastp "-DARGS=blastp -q ${TD}/1.faa -d ${TD}/2.faa -p1" ${SP})
add_test(NAME blastp_nr10k COMMAND ${CMAKE_COMMAND} -DNAME=blastp_nr10k "-DARGS=blastp -q ${TD}/nr_10k.faa -d nr_10k.dmnd -p4 -f 6 qseqid sseqid evalue staxids skingdoms sphylums" ${SP})
add_test(NAME blastp-cbs6 COMMAND ${CMAKE_COMMAND} -DNAME=blastp-cbs6 "-DARGS=blastp -q ${TD}/nr_10k.faa -d ${TD}/nr_10k.faa -p4 -c1 -k0 --comp-based-stats 6 --fpu-compat" ${SP})
add_test(NAME blastp_blastdb COMMAND ${CMAKE_COMMAND} -DNAME=blastp_blastdb "-DARGS=blastp -q ${TD}/nr_10k.faa -d ${TD}/blast/nr_10k -p4 -c1 -k0" ${SP})
add_test(NAME blastp_blastaliasdb-seqidlist COMMAND ${CMAKE_COMMAND} -DNAME=blastp_blastaliasdb_seqidlist "-DARGS=blastp -q ${TD}/nr_10k.faa -d ${TD}/blast/nr_10k_filtered -p4 -c1 -k0" ${SP})
add_test(NAME blastp-mid-sens COMMAND ${CMAKE_COMMAND} -DNAME=blastp-mid-sens "-DARGS=blastp -q ${TD}/3.faa -d ${TD}/4.faa --mid-sensitive -p1" ${SP})
add_test(NAME blastp-f0 COMMAND ${CMAKE_COMMAND} -DNAME=blastp-f0 "-DARGS=blastp -q ${TD}/1.faa -d ${TD}/2.faa -f0 -p1" ${SP})
add_test(NAME galaxy_7 COMMAND ${CMAKE_COMMAND} -DNAME=galaxy_7 "-DARGS=blastx --threads 2 --db ${TD}/galaxy/db.dmnd --query ${TD}/galaxy/nucleotide.fasta --query-gencode 1 --strand both --min-orf 1 --outfmt 6 qseqid sseqid pident length mismatch gapopen qstart qend sstart send evalue bitscore --header 0 --compress 0 --matrix BLOSUM62 --comp-based-stats 1 --masking tantan --max-target-seqs 25 --evalue 0.001 --id 0.0 --approx-id 0.0 --query-cover 0.0 --subject-cover 0.0 --block-size 2.0 --motif-masking 0 --soft-masking 0 --swipe --algo 0 --index-chunks 4 --file-buffer-size 67108864" ${SP})
add_test(NAME galaxy_9 COMMAND ${CMAKE_COMMAND} -DNAME=galaxy_9 "-DARGS=blastx --threads 2 --db ${TD}/galaxy/db.dmnd --query ${TD}/galaxy/nucleotide.fasta --query-gencode 1 --strand both --min-orf 1 --outfmt 6 qseqid sseqid pident length mismatch gapopen qstart qend sstart send evalue bitscore --header 0 --compress 0 --matrix BLOSUM62 --comp-based-stats 1 --masking tantan --max-target-seqs 25 --evalue 0.001 --id 0.0 --approx-id 0.0 --query-cover 0.0 --subject-cover 0.0 --block-size 2.0 --motif-masking 0 --soft-masking 0 --algo 0 --global-ranking 10 --index-chunks 4 --file-buffer-size 67108864" ${SP})
add_test(NAME blastx-nanopore COMMAND ${CMAKE_COMMAND} -DNAME=blastx-nanopore "-DARGS=blastx -q ${TD}/SRR14011045_1.fastq -d ${TD}/nr_10k.faa -p4 -c1 -k0" ${SP})
add_test(NAME blastx-nanopore-fna COMMAND ${CMAKE_COMMAND} -DNAME=blastx-nanopore-fna "-DARGS=blastx -q ${TD}/SRR14011045_1.fna.gz -d ${TD}/nr_10k.faa -p4 -c1 -k0" ${SP})
add_test(NAME blastp-global-ranking COMMAND ${CMAKE_COMMAND} -DNAME=blastp-global-ranking "-DARGS=blastp -q ${TD}/nr_10k.faa -d ${TD}/nr_10k.faa -p4 -c1 -k0 --sensitive -s1 -g10 -b0.002" ${SP})
add_test(NAME blastp-blocked COMMAND ${CMAKE_COMMAND} -DNAME=blastp-blocked "-DARGS=blastp -q ${TD}/nr_10k.faa -d ${TD}/nr_10k.faa -p4 -c1 -b0.002" ${SP})
add_test(NAME linclust COMMAND ${CMAKE_COMMAND} -DNAME=linclust "-DARGS=linclust -d ${TD}/nr_10k.faa -p4 --approx-id 0" ${SP})
add_test(NAME deepclust COMMAND ${CMAKE_COMMAND} -DNAME=deepclust "-DARGS=deepclust -d ${TD}/nr_10k.faa -p4 --fpu-compat" ${SP})
add_test(NAME deepclust-multiblock COMMAND ${CMAKE_COMMAND} -DNAME=deepclust-multiblock "-DARGS=deepclust -d ${TD}/nr_10k.faa -p4 --fpu-compat --approx-id 50 -M 0.01G" ${SP})
add_test(NAME realign COMMAND ${CMAKE_COMMAND} -DNAME=realign "-DARGS=realign -d ${TD}/nr_10k.faa -p1 --clusters ${TD}/linclust.out" ${SP})
add_test(NAME blastp-daa COMMAND ${CMAKE_COMMAND} -DNAME=blastp-daa "-DARGS=blastp -q ${TD}/nr_300.faa -d nr_10k.dmnd -p1 -f 100 -c1 --no-auto-append --daa-build-version 179" ${SP})
add_test(NAME view COMMAND ${CMAKE_COMMAND} -DNAME=view "-DARGS=view -a ${TD}/test.daa -p4 -k0" ${SP})
#add_diamond_test(greedy_vertex_cover_numeric "greedy-vertex-cover --edges ${TD}/greedy_vertex_cover_numeric.tsv --edge-format triplet --symmetric --max-id 4 -p1")
add_diamond_test(diamond-test-blastp-default "blastp -q ${TD}/data.faa -d ${TD}/data.faa -p1")
add_diamond_test(diamond-test-blastp-multithreaded "blastp -q ${TD}/data.faa -d ${TD}/data.faa -p4")
add_diamond_test(diamond-test-blastp-blocked "blastp -q ${TD}/data.faa -d ${TD}/data.faa -c1 -b0.00002 -p4")
add_diamond_test(diamond-test-blastp-more-sensitive "blastp -q ${TD}/data.faa -d ${TD}/data.faa --more-sensitive -c1 -p4")
add_diamond_test(diamond-test-blastp-very-sensitive "blastp -q ${TD}/data.faa -d ${TD}/data.faa --very-sensitive -c1 -p4")
add_diamond_test(diamond-test-blastp-ultra-sensitive "blastp -q ${TD}/data.faa -d ${TD}/data.faa --ultra-sensitive -c1 -p4")
add_diamond_test(diamond-test-blastp-max-hsps "blastp -q ${TD}/data.faa -d ${TD}/data.faa --more-sensitive -c1 -p4 --max-hsps 0")
add_diamond_test(diamond-test-blastp-target-parallel "blastp -q ${TD}/data.faa -d ${TD}/data.faa --more-sensitive -c1 -p4 --query-parallel-limit 1")
add_diamond_test(diamond-test-blastp-query-indexed "blastp -q ${TD}/data.faa -d ${TD}/data.faa --more-sensitive -c1 -p4 --algo 1")
add_diamond_test(diamond-test-blastp-comp-based-stats-0 "blastp -q ${TD}/data.faa -d ${TD}/data.faa --more-sensitive -c1 -p4 --comp-based-stats 0")
add_diamond_test(diamond-test-blastp-comp-based-stats-2 "blastp -q ${TD}/data.faa -d ${TD}/data.faa --more-sensitive -c1 -p4 --comp-based-stats 2")
add_diamond_test(diamond-test-blastp-comp-based-stats-3 "blastp -q ${TD}/data.faa -d ${TD}/data.faa --more-sensitive -c1 -p4 --comp-based-stats 3")
add_diamond_test(diamond-test-blastp-comp-based-stats-4 "blastp -q ${TD}/data.faa -d ${TD}/data.faa --more-sensitive -c1 -p4 --comp-based-stats 4")
add_diamond_test(diamond-test-blastp-target-seqs "blastp -q ${TD}/data.faa -d ${TD}/data.faa -k3 -c1 -p4")
add_diamond_test(diamond-test-blastp-top "blastp -q ${TD}/data.faa -d ${TD}/data.faa --top 10 -p4")
add_diamond_test(diamond-test-blastp-evalue "blastp -q ${TD}/data.faa -d ${TD}/data.faa -e10000 --more-sensitive -c1 -p4")
add_diamond_test(diamond-test-blastp-blosum50 "blastp -q ${TD}/data.faa -d ${TD}/data.faa --matrix blosum50 -p4")
add_diamond_test(diamond-test-blastp-pairwise-format "blastp -q ${TD}/data.faa -d ${TD}/data.faa -c1 -f0 -p4")
# add_diamond_test(diamond-test-blastp-xml-format "blastp -q ${TD}/data.faa -d ${TD}/data.faa -c1 -f xml -p4")
add_diamond_test(diamond-test-blastp-paf-format "blastp -q ${TD}/data.faa -d ${TD}/data.faa -c1 -f paf -p1")
bbuchfink-diamond-6dc5717/Dockerfile 0000664 0000000 0000000 00000001016 15234073120 0017405 0 ustar 00root root 0000000 0000000 FROM ubuntu:latest as build-diamond
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Moscow
RUN apt-get update && apt-get install -y g++ automake cmake zlib1g-dev git libzstd-dev libsqlite3-dev
WORKDIR /opt/diamond
ADD . .
WORKDIR /opt/diamond/build
RUN cmake -DCMAKE_BUILD_TYPE=Release ..
RUN make -j $(nproc --all) && make install
FROM ubuntu:latest
LABEL maintainer="Benjamin J. Buchfink "
COPY --from=build-diamond /usr/local/bin/diamond /usr/local/bin/diamond
ENTRYPOINT ["diamond"]
CMD ["help"] bbuchfink-diamond-6dc5717/LICENSE 0000664 0000000 0000000 00000077330 15234073120 0016434 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS bbuchfink-diamond-6dc5717/README.md 0000664 0000000 0000000 00000013630 15234073120 0016677 0 ustar 00root root 0000000 0000000
Introduction
============
DIAMOND is a sequence aligner for protein and translated DNA searches,
designed for high performance analysis of big sequence data. The key
features are:
- Pairwise alignment of proteins and translated DNA at 100x-10,000x
speed of BLAST.
- Clustering protein sequences with high sensitivity and scalability
including linear-time scaling and parallelization across many
compute nodes.
- Frameshift alignments for long read analysis.
- Low resource requirements and suitable for running on standard
desktops or laptops.
- Various output formats, including BLAST pairwise, tabular and XML,
as well as taxonomic classification.
[](https://github.com/bbuchfink/diamond/actions/workflows/cmake.yml)
[](https://github.com/bbuchfink/diamond/releases)
[](https://anaconda.org/bioconda/diamond)
[](https://anaconda.org/bioconda/diamond/files)
[](https://scholar.google.com/citations?user=kjPIF1cAAAAJ)
[](https://discord.gg/ptJnz3GSCy)
[](https://usegalaxy.eu/root?tool_id=bg_diamond)
Documentation
=============
The online documentation is located at the [GitHub Wiki](https://github.com/bbuchfink/diamond/wiki).
Support
=======
DIAMOND is actively supported and developed software. Please use the [issue tracker](https://github.com/bbuchfink/diamond/issues) for malfunctions and the [GitHub discussions](https://github.com/bbuchfink/diamond/discussions) for questions, comments, feature requests, etc. I also provide live support on [Discord](https://discord.gg/ptJnz3GSCy). Don't be too shy to ask!
Contributing
============
See [Contributing](https://github.com/bbuchfink/diamond/wiki/Contributing).
About
=====
DIAMOND is developed by Dr. Benjamin J. Buchfink, independent scientist, TÃŧbingen, Germany,
supported by the Max Planck Society for the Advancement of Science. From 2019-2024,
it was developed by Benjamin J. Buchfink at the Drost lab, Max Planck Institute for Biology
TÃŧbingen. From 2018-2019, its development was supported by the German Federal Ministry
for Economic Affairs and Energy through an EXIST grant. From 2016-2018, it was developed
by Benjamin J. Buchfink as an independent researcher. From 2013-2015, the initial version
was developed by Benjamin J. Buchfink at the Huson lab, University of TÃŧbingen, Germany.
\[[:email:Email](mailto:buchfink@gmail.com)\]
\[[X](https://x.com/bbuchfink)\]
\[[Bluesky](https://bsky.app/profile/bbuchfink.bsky.social)\]
\[[LinkedIn](https://www.linkedin.com/in/benjamin-j-buchfink-875692105/)\]
\[[Google Scholar](https://scholar.google.de/citations?user=kjPIF1cAAAAJ)\]
\[[Drost lab](https://drostlab.com/)\]
\[[MPI-BIO](https://www.bio.mpg.de/)\]
**When using the tool in published research, please cite:**
- Buchfink BJ, Reuter K, Drost HG, \"Sensitive protein alignments at tree-of-life
scale using DIAMOND\", *Nature Methods* **18**, 366â368 (2021).
[doi:10.1038/s41592-021-01101-x](https://doi.org/10.1038/s41592-021-01101-x)
For sequence clustering:
- Buchfink BJ, BarbÊ Ã, Ashkenazy H, Reuter K, Kennedy JA, Drost HG, \"Clustering the protein
universe of life using DIAMOND DeepClust\", *Nature Methods* **23**, 724-727 (2026).
[doi:10.1038/s41592-026-03030-z](https://doi.org/10.1038/s41592-026-03030-z)
Original publication to cite DIAMOND until v0.9.25:
- Buchfink BJ, Xie C, Huson DH, \"Fast and sensitive protein alignment
using DIAMOND\", *Nature Methods* **12**, 59-60 (2015).
[doi:10.1038/nmeth.3176](https://doi.org/10.1038/nmeth.3176)
bbuchfink-diamond-6dc5717/TRADEMARKS 0000664 0000000 0000000 00000002053 15234073120 0016775 0 ustar 00root root 0000000 0000000 This codebase is Copyright Š 2012-2026 Dr. Benjamin J. Buchfink and contributors. You are free
to use it under the terms of the GPL 3 License. This document does not change, limit or supersede
the terms of the GPL 3 License.
It is not permitted to make a fork, copy or derivative work of this project and publicly
represent it as the official and original DIAMOND project developed by Dr. Benjamin J. Buchfink
as published in the respective scientific articles, or to use the name DIAMOND or variations
thereof or associated logos or variations thereof or the names of the authors to create such
a false impression. Forks or other derivative works must give clear notice as such and identify
as not being the official and original DIAMOND project, linking to one of the official project
URLS:
https://github.com/bbuchfink/diamond
https://diamondsearch.org
Logos are Copyright Š Benjamin J. Buchfink, all rights reserved. They may be used to indicate
the use of the tool in a flowchart or similar. Files are available here:
https://github.com/bbuchfink/diamond-data bbuchfink-diamond-6dc5717/src/ 0000775 0000000 0000000 00000000000 15234073120 0016204 5 ustar 00root root 0000000 0000000 bbuchfink-diamond-6dc5717/src/ChangeLog 0000664 0000000 0000000 00000172234 15234073120 0017767 0 ustar 00root root 0000000 0000000 [2.2.5]
- Improved the performance of the clustering workflows.
- Linear-time stages of the clustering workflows now by default use banded instead of full-matrix
extension (set `--ext full` to use full-matrix extension instead).
- Added the option `--reseek-diags` to recompute diagonals prior to chaining.
- Added the options `--reseek-xdrop` to set ungapped x-drop, `--word-threshold` to set the
word threshold in bits for k-mer neighbors and `--double-hit-window` to set the window for double hits
when using `--reseek-diags`.
- Removed the `--linclust-banded-ext` and `--lin-combo` options.
- Fixed a potential issue of increased memory use in the clustering workflows.
- Improved the performance of reading sequence files.
- Fixed a potential inter-toolchain inconsistency in search workflows using sketching.
- Fixed a potential non-determinism in the clustering workflows.
- Fixed a bug causing invalid line breaks in the output file when using the `qtitle` output field
with FASTQ files.
[2.2.4]
- Improved the performance of the clustering workflows.
- Improved the performance of reading FASTA files.
- Added the option `--single-step` to perform one computational step of clustering then exit
when using the `--parallel-tmdir` option, making it easier to orchestrate big clustering
runs in a controlled way.
- Added progress output for sequence loading in clustering workflows.
- Fixed two potential issues of increased memory use in the clustering workflows.
- Added the option `--self` for self-alignment of the database file.
- Fixed a bug that could cause slightly reduced sensitivity on the ARM64 architecture.
- Improved performance of the search and clustering workflows on the ARM64 architecture.
- Fixed a potential `Letter count not set` error in the clustering workflows when run in
parallel across multiple nodes.
[2.2.3]
- Clustering workflows now by default apply BLAST-like compositional matrix adjust,
unconditionally, instead of compositional score correction described by Hauser et al., 2016.
- Clustering workflows now by default no longer apply tantan soft masking but conservative
SEG masking corresponding to BLAST defaults.
- Added the `--comp-based-stats 6` option to enable compositional matrix adjust using
an optimized SinkhornKnopp based algorithm.
- Added the `--relative-entropy-tolerance` option to control the convergence tolerance of
the SinkhornKnopp algorithm when using `--comp-based-stats 6`.
- Added the option `--taxdump` to set search path for NCBI taxdump files other than the
database directory.
- Fixed a non-determinism in the greedy vertex cover workflow and transitively in the
clustering workflows (not affecting correctness of results).
- Fixed a non-determinism in the clustering workflows (not affecting correctness of results).
- Added the option `--masking seg-all` to apply SEG masking to both query and target
sequences.
- Fixed `--comp-based-stats 2-5` not correctly applying SEG masking of targets by default
instead of tantan masking.
- Added the option `--reps` to set output FASTA file for representative sequences for the
clustering workflows (contributed by @bbuschkaemper).
- Fixed a crash in the clustering workflows for large input files with high memory limit
parameter (contributed by @bbuschkaemper).
- Fixed a potential issue in the linear stages of the clustering workflows when using a
very high memory limit parameter (contributed by @bbuschkaemper).
- Fixed a bug that could cause an invalid error message or truncation when reading compressed
files (present since v2.2.2).
- Added the option `--symmetrize-evalue` to maximize the evalue over both combinations
of query and target.
- Fixed asymmetry of evalues in clustering workflows.
- Fixed a potential issue that could cause hanging instead of correct termination in case
of an error.
- Fixed a dash character as file name not being interpreted as stdin or stdout.
- Fixed a wrong `Illegal seek` error message when using a stream as input.
- Added the `--max-oid` option to the `greedy-vertex-cover` workflow to interpret input
edges as ordinal ids and set their maximum.
- Added the option `--fpu-compat` for exact inter-architecture equality of floating point
computations when using `--comp-based-stats 6`.
- Fixed a bug that could cause a crash when using a custom seed shape of weight less than 7.
[2.2.2]
- Fixed a crash in the `view` workflow (present since v2.2.0).
- Fixed a bug that could cause an error clustering a database with a single sequence.
- Fixed a potential error of too many open files in the clustering workflows.
- Fixed a possible inter-platform inconsistency of the `approx_pident` output field caused
by architectural differences in implementing fused multiply-add.
- Using the `--log` option will no longer produce a `diamond.log` file.
- The `--verbose/-v` option is deprecated and has no effect.
- Removed a potential inter-system non-determinism caused by toggling query-indexed mode
by detection of L3 cache size.
- Fixed the `--header` option not correctly working for clustering workflows.
- Removed the `--unaligned-targets` option.
- Fixed an error reading FASTQ files with line breaks in the sequence or quality lines.
- Improved the performance of loading FASTA files containing DNA sequences.
- Fixed an issue of not correctly loading compressed streams on Windows.
- Fixed the Windows release version missing zstd support.
- Fixed query-indexed mode not being correctly triggered when using the `--dbsize`
option in conjunction with a FASTA database.
- Fixed a bug that could cause incorrect ordering in the output file when using the `--dbsize`
option in conjunction with a FASTA database.
- Fixed a crash when using `--mp-init` on Windows.
- Fixed a potential deadlock when using `--multiprocessing`.
- Added the option `--daa-build-version` to overwrite the diamond build version written to
DAA files.
- Disabled suppression of terminal logging output to stderr when requesting output be
written to stdout.
[2.2.1]
- Improved the performance of the search and clustering workflows.
- Fixed an issue of increased memory use in greedy vertex cover computation.
- Fixed a potential `Record count not set` error message during clustering output.
- Removed the `--linclust-chunk-size` and `--connected-component-depth` options.
- Fixed an issue of increased memory use in the clustering workflows.
- Fixed an issue that could cause incorrect parsing of taxonomic nodes and names data when
using a custom-made `nodes.dmp` or `names.dmp` file with non-monotonic taxonomic ids.
- Missing taxonomy node information for a taxid will no longer cause an error but be
accordingly indicated in the output file.
- Added compatibility support of taxonomic rank information for databases built with v2.1.11
or earlier.
- Added support for clustering by traceback sequence identity (`--id`) instead of approximate
sequence identity (`--approx-id`).
- Fixed an issue (present since v2.1.25) that could cause clustering workflows not to correctly
apply the `--comp-based-stats` command line option.
- Added support for clustering with the first clustering round being all-vs-all alignment.
- Temporarily removed the `reassign` workflow.
- Fixed an issue of missing sequence identifiers in the output for BLAST databases built without
using `-parse_seqids`.
- Fixed a bug (present since v2.1.17) that caused BLAST alias databases filtered by sequence
id not to function correctly.
[2.2.0]
- Fixed a potential issue of increased memory use.
- Fixed compiler errors for GCC 4.8.5.
- Fixed an issue that could cause hanging instead of correct termination in case of an error.
- Fixed a potential error when using an output format not containing alignment coordinates.
- Fixed an error when using the `full_sseq` output field with BLAST databases.
- Fixed a potential unclear error message when using a database file with unsupported format.
- Improved the performance of clustering workflows when running in parallel across multiple nodes
using the `--parallel-tmpdir` option, and changed the input format to single database instead
of volumed TSV file.
- Fixed a potential issue of high memory use in the clustering workflows during output generation.
- The `test` workflow is deprecated and has been removed. Unit testing is now available via
CTest.
[2.1.25]
- Improved the performance of the `cluster`, `deepclust` and `linclust` workflows.
- Fixed an issue that could cause an out-of-memory error in the clustering workflows during
output generation.
- Added the option `--ext none` to skip seed extension and output seed hits instead.
- Added the option `--min-len-ratio` to set length ratio filter in mutual coverage searches.
- Improved performance of loading FASTA files, including when used as database.
- Added the option `--hamming-dist-boundary-check` to clip the hamming distance filter against
sequence boundaries.
- Fixed a bug that could cause undefined behaviour in linear-mode searches with mutual coverage
thresholds.
- Added the option `--keep-temp-files` to prevent deletion of temporary files.
- Added support for clustering BLAST databases.
- Temporarily removed the `recluster` workflow.
- Removed the `--qnum-offset` and `--snum-offset` options.
- Fixed an error when using the taxonomic output format with single-block database processing.
[2.1.24]
- Fixed a crash in the `greedy-vertex-cover` workflow.
- Fixed a bug that could cause a crash when using `--swipe`.
- Added the option `--lin-combo` to linearize the search comparing against the longest query
or target sequence for identical seeds.
- Added the options `--qnum-offset` and `--snum-offset` to set non-zero offsets for ordinal
ids (`qnum` and `snum` output fields).
- Fixed a compiler error on the CHERI architecture.
- Clustering workflows now support `--gapopen`, `--gapextend`, `--matrix` and `--custom-matrix`.
- Fixed a potential hanging issue.
[2.1.23]
- Clustering in parallel across multiple nodes using the `--parallel-tmpdir` option now outputs
accessions (separated into volumed files) instead of ordinal ids if not using `--oid-output`,
applies tantan, motif and seed complexity masking during seeding by default consistent with
the regular clustering workflow, and runs faster.
- Added the option `--aln-out` to output alignments for clustering workflows when using
the option `--parallel-tmpdir`.
- Fixed a potential crash (thanks @jchorl).
- Fixed a potential crash in the clustering workflows.
[2.1.22]
- Fixed compiler errors for GCC 4.8.5.
- Improved performance of the computing alignments stage.
- Fixed a bug that caused the `--hit-membuf` option not to function correctly.
- Fixed potential crashes when using the `--parallel-tmpdir` option for clustering.
- Added the option `--linclust-chunk-size` to set database chunk size for clustering
using the `--parallel-tmpdir` option.
- Fixed a potential hanging problem on macOS.
- Fixed a memory leak.
[2.1.21]
- Fixed a potential segmentation fault.
[2.1.22]
- Fixed a crash when using `--swipe`.
- Fixed a crash when using `--global-ranking/-g`
[2.1.21]
- Fixed a potential segmentation fault.
[2.1.20]
- Fixed a bug that could cause filtering by taxonomy to malfunction for BLAST databases
(present since v2.1.18).
- Fixed a memory leak (present since v2.1.19).
- Fixed a potential deadlock.
- Fixed a potential compilation error on arm64 systems.
- Fixed an error when using BLAST databases that were read-only.
- Fixed missing invocation information and a missing newline when using
`--header verbose`.
[2.1.19]
- Improved performance of the searching alignments stage and fixed a potential
performance issue present since v2.1.15.
- Fixed search paths for SQLite3 on Ubuntu.
- Fixed a crash when using the `--parallel-tmpdir` option for clustering.
[2.1.18]
- Improved performance when using BLAST databases.
- BLAST format is now the recommended database format for best performance.
- Fixed missing sequence ids for some BLAST databases.
- Fixed CMake 2.8 errors.
- Fixed compiler errors for GCC 4.8.5.
- Added the `--load-threads` option to set number of CPU threads for file I/O.
- Added the `--minichunk` option to set chunk size for file I/O.
- Fixed a race condition (present since v2.1.15).
- Fixed a memory leak (present since v2.1.15).
- Added deduplication for the `staxids` output field for BLAST databases.
[2.1.17]
- Added (tabular/json) output fields sRANK to print taxonomy nodes of the given rank
associated with the subject sequence, where RANK can be any rank in the NCBI taxonomy,
e.g. sdomain, skingdom, sphylum, sorder, sgenus, sspecies, etc.
- Using BLAST databases is now universally supported (including taxonomy features),
without depending on the NCBI toolkit.
- SQLite3 is now a required dependency for compilation.
- Added line breaks for the `getseq` workflow at 80 letters per line.
- Removed the `BLAST_LIBRARY_DIR` and `BLAST_INCLUDE_DIR` CMake options.
- Fixed a `Missing taxdb` error message when using BLAST databases.
- When filtering a database by taxonomy, the letter count for computing
e-values will now correctly refer to the filtered subset.
- Removed support for BLAST alias databases filtered by GI numbers and filtered using a
binary-formatted seqid list (`.bsl` file extension).
- Added support for soft masking using the SEG algorithm (`--soft-masking seg`).
- Added the output field `hspnum` to print 0-based HSP number within a target
to the tabular and JSON output format.
- Added the output field `normalized_bitscore` to print the bitscore normalized
by the maximum of the self alignment scores of query and target sequence to the tabular
and JSON output format.
- Added the output field `normalized_nident` to print the number of identical
residues normalized by the maximum of the lengths of query and target sequence
to the tabular and JSON output format.
- Fixed the `--swipe` option not producing any output.
[2.1.16]
- Fixed an architecture-dependent inconsistency (present since v2.1.15) of
tantan repeat masking.
- Fixed a crash occuring when clustering at 90% identity or above.
- Fixed a potential crash.
- Added the option `--hit-membuf` for memory buffering of seed hits.
- Fixed a potential crash when using `--comp-based-stats 4`.
- Fixed an issue that caused line breaks in quality string of FASTQ files
to be copied to the output file.
[2.1.15]
- Added support for using the `staxids`, `sscinames`, `sskingdoms`, `skingdoms`,
`sphylums` and `slineages` output fields with BLAST databases.
- Added support for using the taxonomic classification output format
(`--outfmt/-f 102`) with BLAST databases.
- Added support for using the `--taxonlist` and `--taxon-exclude` options
with BLAST databases.
- The `--taxonlist` and `--taxon-exclude` options will by default exclude database
sequences with a missing parent assignment instead of producing an error.
- The `--taxon-exclude` option will only exclude database sequences if all associated
taxids (or their ancestral taxids) are required to be excluded.
- The `slineages` output field will print the (deduplicated) lineages of all taxids
associated with a database sequence, separated by `<>`, instead of only the first taxid.
- The order of the `slineages` output field will be from root to leaf to be consistent
with the NCBI lineage declaration.
- The `slineages` output field will print `N/A` instead of an empty string for
sequences with a missing taxonomic assignment.
- The `slineages` output field will be printed as an array in the JSON output format.
- Removed the trailing semicolon and added spaces for the `slineages` output field.
- Added the option `--comp-based-stats 5` to enable compositional matrix adjustment
conditioned on sequence properties with fallback on composition-based statistics.
- Added the options `--query-match-distance-threshold`, `--length-ratio-threshold` and
`--cbs-angle` to set matrix adjustment conditions.
- Eliminated dependency on Eigen.
- Added option `--linclust-banded-ext` to use banded instead of full-matrix Smith
Waterman extension in linear search and clustering rounds.
- Compilation with BLAST database support no longer requires the zstd library.
- Compilation with BLAST database support requires sqlite3.
- Fixed compiler errors for GCC 4.8.5.
- Fixed an issue that could cause increased memory use and crashes.
- Fixed an error when using compositional matrix adjust.
- Adjusted the convergence parameters for compositional matrix adjust, and
removed the performance optimization for the time being.
- Fixed an error using the global ranking mode.
- Added the option `--min-query-len` to filter queries by minimum length (applies
to the length of the input DNA sequence in blastx mode).
- Now providing multi-platform docker images for platforms linux/amd64 and
linux/arm64.
[2.1.14]
- Improved the performance and sensitivity of the `cluster`, `deepclust` and
`linclust` workflows.
- The `getseq` workflow now supports BLAST databases.
- Disabled clearing of the page cache for mmaped pages when using BLAST
databases.
- Reduced memory use when the `sallseqid` and `staxids` output fields are
used.
- Fixed a bug that could cause a crash when using the JSON output format and
processing the database in multiple blocks.
- Fixed a bug that could cause extra commas in the JSON output format.
- Fixed a bug that could cause extra quotation marks when using the `stitle`
output field for the JSON output format.
- The `prepdb` workflow is deprecated, and no longer needed to use BLAST
databases.
- The `--anchored-swipe` option can be applied to linear mode clustering
rounds and searches.
- The `--anchored-swipe` option can be used without compiling with `-DEXTRA=ON`
(only available on systems that support AVX2).
- Improved the performace of compositional matrix adjustment (only available
when compiled natively on systems that support AVX2).
- Added the option `--short-query-ungapped-bitscore` to set ungapped bitscore
threshold for short queries.
- Fixed two cases of static initialization order fiasco.
- Added support for using the `--parallel-tmpdir` option for the `linclust`
workflow.
- Adjusted the convergence parameters for compositional matrix adjust.
[2.1.13]
- Fixed an invalid error message for the `cluster`, `deepclust` and `linclust`
workflows.
- Added the option `--oid-output` to output OIDs instead of accessions for
the clustering workflows, reducing their memory use.
- Added support for using the `--multiprocessing` feature on Windows.
- Using `--multiprocessing` requires explicitly setting `--parallel-tmpdir`.
- Fixed a bug that could cause a crash when the `--target-indexed` option was
used.
- As of now, a macOS binary is available for the GitHub release, supporting both
x86 and Apple silicon CPUs. Using BLAST databases is also supported.
- Added compatibility with later CMake versions (tested up to v4.0.3).
- Added CMake option `-DCROSS_COMPILE` to disable auto-detection of host
architecture.
- Added compilation script to produce macOS fat binary.
[2.1.12]
- Added support for the new NCBI taxonomic ranks "cellular root",
"acellular root", "domain" and "realm".
- Added support for using BLAST databases to the Bioconda release.
- Fixed compiler errors for Clang 20.
- Enabled transitive closure computation in earlier clustering rounds and
for bi-directional coverage clustering.
- Fixed an issue that could cause hits to be partially lost in frameshift
alignment mode when they occured in both query strands for the same target.
- Fixed an error parsing FASTQ files when quality value lines started with
the @ character.
- Fixed a compiler error on macOS.
[2.1.11]
- Improved the performance and sensitivity of the `cluster`, `deepclust` and
`linclust` workflows.
- The `--faster` mode will by default use a minimizer sketch of fixed size
per sequence instead of window-based minimizers.
- Added the option `--sketch-size` to enable seeding using a minimizer
sketch of the given size per sequence.
- Cascaded clustering and iterated search will by default use the `--fast`
mode with linearization in the second round.
- The `--round-coverage` parameter is now also applied to uni-directional
coverage clustering.
- Cluster output files will correctly contain carriage returns on Windows.
- Fixed generation of the Docker container against the latest version of the
NCBI toolkit.
- Fixed a bug that caused target coordinates not to be reported correctly
in the tabular format in frameshift alignment mode.
- Added the options `--ungapped-evalue` and `--ungapped-evalue-short` to set
e-value thresholds for the ungapped hit filter.
- Linearization of search or clustering rounds is limited to seeds of weight
>= 10.
- Fixed an issue that could cause an `array size overflow` error when using
very large `.dmnd` databases with taxonomic annotation.
- Fixed a bug that caused query letters to be printed as `ARND` instead of
`ACGT` in the `view` workflow.
- Fixed a bug that caused using paired end input files to malfunction with
an error message.
- Fixed a bug that could produce clustering errors when clustering at
sequence identities >= 50% and processing the database in multiple super
blocks.
- Fixed a bug that could cause a crash in global ranking mode.
- Accession parsing rules applied to database sequence accessions for the
purpose of matching them to accessions in the taxonomy mapping file are now
by default also applied to the accessions in the mapping file (disable using
`--no-parse-seqids`).
- Fixed an issue that could cause increased memory use in the hash join stage.
- Added support for FASTA headers containing multiple sequence IDs separated
by blank spaces (so far only the `\1` character was supported as a
separator).
- Fixed an issue that could cause hanging or crashes in the `Computing
alignments` stage.
- `--linsearch` can now be used in conjunction with `--iterate`.
- Fixed a compiler error for GCC 4.8.5.
- Fixed a compiler error on Solaris.
- Fixed compiler errors on systems that do not support the sysinfo function.
- Fixed `Bus error` occuring on Sparc systems.
- Compilation on Sparc systems can be performed without setting `-DX86=OFF`.
- Fixed two issues that could cause increased memory use in the computing
alignments stage.
- Fixed a bug that caused superfluous quote characters in the JSON output
format.
- Linear search modes will by default use full-matrix extension.
- Fixed an issue that could cause reduced performance in the masking sequences
stage.
- Fixed a bug that could cause a crash when using mutual coverage thresholds
in blastx mode.
- Fixed a bug that could cause a crash when the `--include-lineage` option
was used.
- When reading protein sequences that unexpectedly only contain DNA letters,
an error message is only produced if the first 10 sequences in the input
file all exhibit the problem.
- Fixed a bug that caused setting `--top 100` not to function correctly.
- Fixed a bug that caused target coordinates not to be reported correctly in
the output of the `realign` workflow.
- Fixed a bug that did not permit using the `--memory-limit/-M` option for
the `realign` workflow.
- Fixed an issue that could cause non-deterministic output in frameshift
alignment mode.
- Fixed a bug that could cause a crash when using the XML output format in
the `view` workflow.
- Fixed an issue that could cause non-deterministic output for identically-scoring
HSPs in the same target.
- Disabled the default use of increased coverage and identity cutoffs in
earlier clustering rounds.
- Optimized the performance of the extension stage when coverage or approximate
identity filters are used.
- Optimized the performance of the extension stage when not using output fields
that require alignment traceback.
- Fixed an issue that could cause an incorrect order of cascaded clustering
rounds.
[2.1.10]
- Fixed a bug that could cause a crash when using a bi-directional coverage
cutoff in query-indexed mode.
- Fixed a bug that caused the `--include-lineage` option to malfunction for
targets with no taxonomic assignment available.
[2.1.9]
- Corrected the prefix of the query length field for the SAM format.
- Added the size modifiers 'T', 'M' and 'K' for the `--memory-limit`/`-M`
option.
- Added the option `--mutual-cover` to cluster sequences by mutual coverage
percentage of the cluster representative and member sequence.
- Added the option `--symmetric` for computing greedy vertex cover with
symmetric edges.
- Fixed an issue that caused the `--approx-id` option and the `approx_pident`
output field not to work correctly when using the `--anchored-swipe`
option.
- Added the option `--no-reassign` to prevent reassignment to closest
representative for the greedy vertex cover and clustering workflows.
- Added the option `--connected-component-depth` to activate clustering
of connected components at a given maximum depth for the greedy vertex
cover and the clustering workflows.
- Fixed a compiler error for Clang v17.
- Improved search performance when searching with mutual coverage threshold
by filtering for sequence length ratio.
- Added the sensitivity mode `--shapes-30x10` with sensitivity approximately
equivalent to `--mid-sensitive`.
- Added the options `--round-coverage` and `--round-approx-id` to set per
round cutoffs for cascaded clustering.
- The CMake switch `-DKEEP_TARGET_ID` is now obsolete and the corresponding
function is always available.
- Added the option `--include-lineage` to the taxonomic classification format
to include taxonomic lineage in the output.
- Added native support for the ARM NEON instruction set (contributed by
Martin Larralde).
- Added the `slineages` output field to the tabular format to print the
taxonomic lineage of the subject sequence.
[2.1.8]
- Fixed an issue that could cause reduced performance when running in
query-indexed mode.
- Added support for the JSON output format (option `-f json-flat`).
- Added the option `--sam-query-len` to output query length in SAM format.
[2.1.7]
- Fixed a bug that caused taxonomy names not to be loaded correctly for the
`makedb` workflow.
- Fixed a bug that caused a crash when using the `--target-indexed` option.
- Fixed an error when using the `--tmpdir` option for the makedb workflow.
- Added a warning message when sequence accessions are shortened due to parsing
rules for the `makedb` workflow.
- Added the option `--no-parse-seqids` to disable parsing of sequence
accessions.
- Changed the command line help to print options separated by command.
- Fixed an issue that the `--ignore-warnings` option could not be used for
the `makedb` workflow.
[2.1.6]
- Fixed compatibility issues on older systems without support for AVX2.
- Fixed linker errors when compiled with `-DX86=OFF`.
- Fixed a compiler error on macOS systems.
- Fixed a bug that could cause missing tags in the XML output format and
unaligned queries not to be reported correctly.
- Fixed a bug that caused the PAF output format not to work correctly.
[2.1.5]
- Disabled the use of frequency based seed masking when using the linear-time
search feature with respect to the targets.
- Fixed a bug that caused a `Database file is not a BLAST database` error message
for the `prepdb` workflow.
- Fixed a bug that caused a segmentation fault when using BLAST databases.
- Added line numbers for error messages when reading taxonomy mapping files.
- Fixed a bug that could cause a crash when using the `greedy-vertex-cover`
workflow without the `--out` and `--centroid-out` options.
- Fixed a bug that caused the `greedy-vertex-cover` workflow to only produce a
trivial clustering.
- Fixed a bug that caused the last codon of the -2 reading frame to be translated
incorrectly.
- Reduced the memory use of the clustering workflow.
- Updated the bundled NCBI toolkit to the latest version.
[2.1.4]
- Leading spaces are now trimmed and tabulator characters escaped as `\t`
in sequence titles, and a warning message is produced.
- Blank sequence titles are now replaced by `N/A`, and a warning message is
produced.
- Fixed a bug that could cause a `Traceback error` in certain cases.
- Fixed a bug that caused the `qlen` and `score` output fields not to be reported
correctly for the `realign` workflow.
- Added an error message when using unsupported output fields for the `realign`
workflow.
- Fixed an issue that could cause a `Missing fields in input line` error when
clustering.
- Optimized the performance of the `linclust` workflow.
- Reduced the memory use of the clustering workflow.
- Fixed a bug that caused using standard input as the query not to work.
[2.1.3]
- Fixed compiler errors for GCC 4.8.
- Fixed a GCC compiler error.
- Fixed a segfault issue occuring when compiled using GCC 12 on ARM64 systems.
- Fixed an issue that caused missing support for AVX2.
[2.1.2]
- The iterated search mode (option `--iterate`) now uses a linear-time feature as
the first search round.
- Added the `linclust` command to cluster using only a single linear-time search
round.
- Fixed compiler errors on macOS.
- Fixed a bug that caused invalid alignment traceback output for the DAA `view`
workflow.
- Added the `merge-daa` workflow to merge DAA files.
- Fixed an error when using the `--max-target-seqs/-k` option for the DAA `view`
workflow.
- Removed AVX2 support from the Windows release binary to ensure compatibility
with older systems.
- Permitted the `--ignore-warnings` option for the `cluster` and `deepclust`
workflows.
- Use unlinked temporary files for database blocks in clustering workflows.
- Fixed a bug that could cause invalid results when using a clustering step with
linearization as the final round in combination with database processing in
multiple super blocks.
- The `--lin-stage1` option can now be used without compilation using the
`-DEXTRA=ON` cmake option.
- Added the option to specify the `_lin` suffix for sensitivity keywords for the
`--iterate` option to activate linear-time feature.
- Added the option `--linsearch` to activate linear-time feature for the search
workflows.
- Fixed a bug that caused the `ppos` and `positive` output fields not to work
for the `realign` workflow.
- Fixed an issue that caused motif masking not to work when compiled with link
time optimization.
[2.1.1]
- Fixed compilation errors on non-x86 systems and for the clang compiler.
- Fixed an error message when running the `recluster` workflow.
- Fixed a bug that could cause an `invalid varint encoding` error when using the
DAA format.
- Fixed a bug that could cause corrupted DAA output.
- Fixed a bug that caused an error in the `view` workflow.
- Adjusted the hit culling heuristic of the frameshift alignment mode to be less
aggressive.
[2.1.0]
- Added the `cluster` workflow to cluster protein sequences.
- Added the `realign` workflow to generate clustering output.
- Added the `recluster` workflow to correct errors in clusterings.
- Added the `reassign` workflow to reassign cluster members to their closest centroid.
- Added the option `-M/--memory-limit` to set a memory limit for clustering workflows.
- Added the `--approx-id` option to filter alignments by approximate sequence identity
and to set an approximate sequence identity threshold for clustering.
- Added the `--member-cover` option to set the coverage threshold of the cluster
member sequence.
- Added the `--cluster-steps` option to set steps for cascaded clustering.
- Added the `--clusters` option to specify clustering input file.
- The `blastx` mode will now mask any open reading frame below the minimum required
length as specified by `--min-orf`.
- The `blastx` mode will only count unmasked letters towards the block size.
- Fixed a bug that caused an error when using the global ranking mode.
- Added the fast mode as the first round in iterative searches.
- Fixed a bug that caused the program not to function on systems without support
for SSE4.1.
- Improved multi-threaded load balancing of gapped extension computations.
- Improved performance of seed extension stage when HSP filter settings are used.
- Added the option `--soft-masking` with possible values `0` and `tantan` to permit
soft-masking using the tantan algorithm.
- Fixed a bug that could cause an `inflate error` in multiprocessing mode.
- Added the option `--swipe` to compute full Smith Waterman alignments of all
queries against all targets.
- Added the sensitivity mode `--faster`.
- Added the output fields `approx_pident` and `corrected_bitscore` to the tabular
format.
- Added the `--lin-stage1` option to linearize comparisons in the seeding stage
by only considering hits against the longest query sequence for identical seeds
(only supported when compiled with `-DEXTRA=ON`).
- Added the `--kmer-ranking` option to rank sequences when `--lin-stage1` is used
(only supported when compiled with `-DKEEP_TARGET_ID=ON`).
- Added the option `--no-block-size-limit` to deactivate upper limits for the block
size when the `--memory-limit` option is used.
- Added the `greedy-vertex-cover` workflow to compute clustering based on
alignments.
- Added the `--edge-format` option to set edge format for greedy vertex cover.
- Added the `--edges` option to set input file for greedy vertex cover.
- Added the `--centroid-out` option to output centroid sequences for greedy
vertex cover.
- Added the `--unaligned-targets` option to generate an output file of unaligned
targets.
- Fixed an issue that failed compilation using the Intel Compiler.
- Fixed an issue that could cause a segmentation fault in rare cases.
- The `--header` option can now be used with the parameter `simple` to enable
simple headers for the tabular format, or without a parameter to enable
headers for the clustering format.
- Added the option `--mp-self` to optimize self-alignment in multiprocessing
mode.
- Added the option `--query-or-subject-cover` to report alignments if the query
or the subject cover (or both) are above the given threshold.
- Removed support for the `--comp-based-stats 2` option (now equivalent to
`--comp-based-stats 3`).
- Removed hit culling in case of overlapping target ranges in frameshift
alignment mode.
- Added the option `--anchored-swipe` to activate anchored SWIPE extension.
[2.0.15]
- Fixed a bug (present since v2.0.12) that caused the `diamond view` workflow to
report a zero bit score for all alignments.
[2.0.14]
- Fixed a compiler error on Linux systems that do not define `_SC_LEVEL3_CACHE_SIZE`.
- Fixed an error when using `--unal 1` with the `cigar` output field.
- Fixed an `illegal instruction` error on systems that did not support AVX2.
- Fixed a bug (present since v2.0.12) that could cause an error or suboptimal
alignments when HSP filter settings were used.
[2.0.13]
- Fixed a bug that caused invalid bit scores in frameshift alignment mode.
[2.0.12]
- Fixed an error when using HSP filter settings together with a BLAST database.
- Optimized the performance of alignment traceback.
- A non-default setting of `--max-hsps` will now recompute a full-matrix Smith Waterman
alignment with the ranges of the known HSPs masked in the target.
- A non-default setting for `--max-hsps` can now be used together with `--ext full`.
- The sensitivity levels used for iterated searches can now be manually set by
using a space-separated list after the `--iterate` option.
- Seeds are masked based on complexity instead of frequency by default.
- Added the option `--seed-cut` to set a complexity cutoff for indexed seeds.
- Added the option `--freq-masking` to enable masking seeds based on frequency.
- The fast, default, mid-sensitive and sensitive modes will by default softmask
a fixed set of highly abundant sequence motifs.
- Added the option `--motif-masking (0,1)` to enable or disable motif masking.
- Added the option `--masking seg` to enable SEG masking of target sequences (BLAST
default) instead of tantan masking.
- Fixed a bug that caused the `full_sseq` output field to contain invalid information
or to produce an error when using a BLAST database.
- Changed composition based statistics to use BLOSUM62 background frequencies.
- Fixed the zstd dependency in the Dockerfile.
- Added support for gap letters in BLAST databases.
- Fixed a bug that caused the `--custom-matrix` option not to function correctly.
- Changed the overlap for merging adjoining bands to >0.0.
- Use more moderate filtering of HPSs in the chaining stage.
[2.0.11]
- Fixed a bug that could cause invalid output when using `--masking 0` combined with
the global ranking mode.
- Enabled lazy repeat masking in the query-indexed and contiguous seed modes when
using global ranking.
- Added detection of cache size to auto-enable query-indexed mode.
[2.0.10]
- Using BLAST databases now requires a preprocessing step using the command `prepdb`.
- Improved performance of searching small query files.
- Added "iterative" search mode (option `--iterate`) to search the query dataset with
increasing sensitivity, only searching queries at the target sensitivity that fail
to align at a lower sensitivity search.
- Added the "global ranking" mode (option `-g`) to set a limit on the number of
Smith Waterman extensions per query, with the target sequences ranked by their
ungapped extension scores.
- Added the `--fast` sensitivity mode that is faster and less sensitive than the
default mode.
- Reduced the time for loading target sequences from BLAST databases.
- Added the contiguous-seed mode (option `--algo ctg`) to improve performance for
small query files.
- Added support for using `--comp-based-stats (3,4)` in combination with `--ext full`.
- Fixed a bug that could cause a `Traceback error` when using `--comp-based-stats (3,4)`
in rare cases.
- Changed the `full_sseq` output field to always contain unmasked sequences.
- Fixed an issue that could cause target output order to be nondeterministic in case
of identically scoring hits.
- Added support for reading zstd-compressed input files (auto-detected) and writing
zstd-compressed output files (option `--compress zstd`) (requires compilation
using `cmake -DWITH_ZSTD=ON`).
- Compilation with BLAST database support requires the zstd library.
- Added error message when reading protein sequences from FASTA files that only
contain DNA letters (can be disabled using `--ignore-warnings`).
[2.0.9]
- Reduced the memory use of database building with taxonomy mapping.
- Removed the limitation of sequence accession length.
- Fixed a bug that could cause using a BLAST database not to function correctly.
- Added support for using BLAST alias databases (created by `blastdb_aliastool`).
- Reduced the memory use of the seed hit sorting stage.
- Improved the consistency of results when running in query-indexed mode (`--algo 1`).
- Added the option `--skip-missing-seqids` to ignore cases of missing sequences
in the database when using the `--seqidlist` option.
- The `--min-orf` parameter now defaults to 1 in frameshift alignment mode.
[2.0.8]
- Added support for using BLAST database files instead of the Diamond-formatted
`.dmnd` files.
- Added the option `--seqidlist` to filter the database by sequence accession (only
supported for BLAST databases).
- Fixed a bug that caused the `--dbsize` option not to function correctly.
- Added the command `makeidx` and the option `--target-indexed` that provide an
optimisation specialized for small databases (<10 Mb).
- Added the option `--mp-recover` to recover aborted runs in multiprocessing mode.
[2.0.7]
- Added support for computing full-matrix instead of banded Smith Waterman extensions
(command line option `--ext full`).
- Added support for the new `prot.accession2taxid.FULL.gz` taxonomy mapping file from
NCBI.
- Added the option `--gapped-filter-evalue` to set the e-value threshold of the gapped
filter heuristic.
- Added setting the scores of the mask letter according to BLAST rules when a
compositionally adjusted matrix is used.
- Changed formatting of e-values to print two decimals instead of one.
- Added the output field `qseq_translated` to print the translation of the aligned part
of the query sequence.
- Added support for providing two input files to `--query/-q` when running alignment
in blastx mode.
- Added the output field `full_qseq_mate` to print the sequence of the query's mate
(enabled when using two query files in blastx mode).
- Fixed a bug that could cause a crash in blastx mode for very long queries.
[2.0.6]
- Changed the computation of expected values to use the method described in Park, Y.,
Sheetlin, S., Ma, N. et al. New finite-size correction for local alignment score
distributions. *BMC Res Notes* **5**, 286 (2012).
- Enabled the use of a custom scoring matrix without having to specify the statistical
parameters (option `--custom-matrix`).
- Added support for compositional matrix adjust as described in Yi-Kuo Yu, Stephen F.
Altschul, The construction of amino acid substitution matrices for the comparison of
proteins with non-standard compositions, *Bioinformatics*, Volume 21, Issue 7, 1 April
2005, Pages 902911. Three additional modes have been added that can be enabled by
setting `--comp-based-stats (2,3,4)` (*the feature is not enabled by default and does
not support translated searches at the moment*).
- Fixed a bug that could cause incorrect alignment coordinates, gaps counts and sequence
identities being reported by `diamond view`.
- Targets are sorted by bit score instead of e-value in the alignment output when the
`--top` parameter is used.
- Disabled support of custom scoring matrices for the DAA format.
- Fixed a bug that caused the use of a custom scoring matrix not to function correctly.
- Fixed an issue that caused the portable binary not to function on systems that did not
support AVX.
- Added the option `--no-unlink` to prevent unlinking of temporary files.
[2.0.5]
- Fixed an issue that could cause high memory use in frameshift alignment mode.
[2.0.4]
- Fixed a bug that could cause the `--max-target-seqs/-k`, `--ext-chunk-size` and
`--file-buffer-size` options not to function correctly on macOS.
[2.0.3]
- Added a new sensitivity mode that is between the default mode and the sensitive mode
in sensitivity (option `--mid-sensitive`).
- Added counters for total number of reference blocks, shapes and index chunks to
the status messages.
- Fixed a bug (persisting since v2.0.2) that could cause secondary HSPs within one
target not to be reported if the `--max-hsps` option was used with a non-default setting.
- Fixed a bug that could cause an invalid error message with regard to the database
format in certain cases.
- The `--no-self-hits` option is no longer supported in `blastx` mode.
- Changed the semantics of the `--no-self-hits` option to check for equality of both
sequence and sequence id, independent of the computed alignment.
- The selection of the top hit when using `--top` will respect the identity, coverage
and no-self-hits filter settings (does not apply when frameshift alignment is
enabled).
- The inclusion criterion for `--top` is applied to the bit score instead of the raw
score and is no longer affected by integer rounding (does not apply when frameshift
alignment is enabled).
- Improved the accuracy of the ranking heuristic.
- Added the options `--ext-chunk-size` and `--no-ranking` to control the ranking
heuristic.
[2.0.2]
- Fixed a bug (persisting since v2.0.0) that could cause incomplete results in `blastx` mode.
- Reduced the use of temporary disk space.
- Fixed an issue that could cause long runtimes when using the `--taxon-list` option.
[2.0.1]
- Added feature for using the tool in a distributed computing environment.
- Fixed an issue that could cause increased memory usage and runtimes for very long queries.
- Fixed a bug that could cause a crash when using `--comp-based-stats 0`.
- Fixed a bug that could cause a crash for small input files in certain cases.
- Fixed a bug that could cause filtering hits for identity or range cover not to function correctly when using
the tabular format without traceback being enabled.
- Added warning messages to recommend block size parameters based on system RAM.
[2.0.0]
- Added the sensitivity modes `--very-sensitive` and `--ultra-sensitive`.
- The `--block-size`/`-b` parameter is set to 0.4 and the `--index-chunks`/`-c` parameter is set to 1 by default
in the new sensitivity modes.
- Improved performance.
- Added the option `--ext` with possible values `banded-fast` and `banded-slow` to adjust band setup for Smith
Waterman extensions (new default is `banded-fast` for the default and sensitive mode, and `banded-slow` otherwise).
- Added automatic disabling of alignment traceback if not required by the user-defined output fields in tabular
output format.
- Changed the default value of the `--max-hsps` parameter to 1.
- Changed the default value of the `--freq-sd` parameter from 10 to 20 for the sensitive mode.
- Fixed a compiler error on FreeBSD.
[0.9.36]
- Fixed a bug that could cause `makedb` to produce invalid database files when using taxonomy features.
- Fixed a bug that could cause a crash when running in query-indexed mode.
[0.9.35]
- Fixed a bug in `diamond view` that would cause high memory usage and erroneous output.
- Reduced the use of temporary disk space.
- Fixed a database compatibility issue with big endian architectures.
- Fixed a bug that would cause a crash for query sequences shorter than 5 letters in blastx mode.
- Fixed a bug that would cause a crash when using a FASTA file as database parameter in blastx mode.
- Added support for the following new ranks in the NCBI taxonomy: biotype, clade, forma specialis, genotype, isolate, morph, pathogroup, serogroup, serotype, strain, subvariety.
[0.9.34]
- Fixed a compiler error for native builds.
- Fixed a compiler error for GCC 4.8.
- Fixed a compiler error when support for SSSE3 was enabled without support for SSE4.1.
- Implemented asynchronous loading of seed hits.
[0.9.33]
- Improved performance and sensitivity.
- Increased use of temporary disk space.
- Implemented support for the AVX2 instruction set.
- Fixed a bug on big-endian architectures.
- Fixed bugs for compilers with unsigned char.
- Fixed compiler errors for generic builds.
- Added compatibility of database files between little and big endian architectures.
- Fixed various issues related to `Illegal instruction` errors on macOS.
- Added option `--file-buffer-size` to set the size of the I/O buffers and set the default value to 64 MB.
[0.9.32]
- Fixed a bug that would generate an incorrect count of positive scoring letters in all output formats.
- Fixed a compiler error on macOS.
- Fixed an `illegal instruction` error on macOS.
[0.9.31]
- Improved performance.
- Composition based statistics use integer scoring.
- Option `--quiet` will suppress startup message.
- Added output field `scovhsp` to print the subject coverage per HSP to the tabular format.
- Added option `--culling-overlap` to set the minimum overlap with a higher scoring hit for a hit to be deleted and changed the
default value from 90% to 50%.
- Added command `diamond test` to run a series of regression tests.
- Fixed an off-by-one error of the query end position in the XML output format.
- (Update 2020/06/08) Due to a bug, since this version DAA files are not backward compatible with previous versions when using frameshift alignment (option `-F`).
[0.9.30]
- Added support for output field `cigar` to the tabular format.
- Changed the maximum repeat period to 50 for tantan masking.
- Changed the tantan masking to ungapped mode.
- Improved the performance of repeat masking.
- Added output fields sskingdoms, skingdoms, and sphylums to print subject super kingdoms, subject kingdoms, and subject phylums.
[0.9.29]
- Fixed a bug that could cause taxonomy features to function incorrectly for databases created by versions 0.9.27 and 0.9.28.
[0.9.28]
- Fixed a bug that could cause alignment score overflows for scores > 65535 in frameshift alignment mode.
- Fixed a clang compiler error.
[0.9.27]
- Improved performance of the seed matching stage.
- Seed frequency counts are computed based on hit seeds.
- Added option `--taxon-exclude` to exclude list of taxon ids from search.
- Compiling from source will no longer perform a native build. Instead, a portable binary that contains code paths
for multiple architectures will be produced, with dispatch logic that is invoked at runtime.
[0.9.26]
- Fixed a bug that could cause undefined behaviour when using a database file of format version < 2.
- Fixed a compiler error when compiled as generic C++.
- Program will no longer terminate with an error if unlink system call fails.
- Added option `--tantan-minMaskProb` to set minimum repeat probability for tantan masking and changed the default value to 0.9.
- Added option `--tantan-maxRepeatOffset` to set maximum tandem repeat period to consider and changed the default value to 15.
- Added option `--tantan-ungapped` to use tantan in ungapped mode and changed the default to gapped mode.
- Changed score matrix lambda calculation for tantan masking.
- Reference masking is recomputed during alignment runs.
[0.9.25]
- Added support for the `sscinames` output field to print subject scientific names to the tabular output format.
- Fixed a compiler error for GCC 8.2.
- Added option `--stop-match-score` to set the match score of stop codons.
- Fixed a bug that caused the `qqual` output field to not be correctly clipped to the aligned part of the query.
- Added output fields `qseq_gapped` and `sseq_gapped` to the tabular format.
- Raised compiler requirement to GCC 4.8.
- Fixed a bug that caused the final sequence positions to not be printed in the pairwise format.
- Allow using `--min-score` instead of `--top` for the LCA computation of the taxonomy output format.
- Reduced the number of temporary files.
- Added output field `qstrand` to the tabular format.
- Database format version changed to 3.
- Fixed a bug in the `--range-culling` mode that could cause undefined behaviour.
[0.9.24]
- Fixed a compiler error on macOS.
- Added --header option to output header for tabular output format.
- The quality string output in tabular format (qqual field) is clipped to the aligned part of the query.
- Print '*' as quality string if quality values are not available in tabular output format.
- Added field 'full_qqual' to print unclipped query quality values to the tabular format.
- Added field 'full_qseq' to print unclipped query sequence to the tabular format.
- Added support for using the hyphen character '-' to denote the standard input for input file parameters.
- Status messages are written to stderr.
- Fixed a bug that could incorrectly report queries as unaligned in the output of the --un option.
- Added option '--al' to write aligned queries to file.
- Added options '--alfmt' and '--unfmt' to set the format of the aligned/unaligned query file (supported values: fasta, fastq).
[0.9.23]
- Fixed an issue that could cause too high memory usage.
- Added output field 'qqual' to print query FASTQ quality values to the tabular format.
- Changed license to GPL.
- Raised compiler requirement to GCC 4.6.
- Added option to use the DAA output format for diamond view.
- Added support for using a FASTA file as the --db parameter in alignment workflows.
- Added CL (command line) and VN (version) fields to the @PG SAM format header line.
- Fixed a performance issue for very long query sequences.
- Added shortcut --long-reads for --range-culling --top 10 -F 15.
[0.9.22]
- Added output field full_sseq to tabular output format.
- Database sequences that exceed the maximum accession length will no longer cause an error.
- Added support for PAF output format.
- Optimized performance of database taxonomy filtering.
[0.9.21]
- Fixed compiler errors on some systems.
[0.9.20]
- Added Bioconda installation instructions to manual.
- Added official docker release: https://hub.docker.com/r/buchfink/diamond/
- Fixed a bug that could cause corrupted output if compression was activated.
- Fixed an issue that could cause high memory usage by automatic use of the query-indexed algorithm.
[0.9.19]
- Fixed a bug in the --un function to write unaligned reads.
- Fixed an issue in the LCA algorithm that could cause an assignment to a higher node.
- --taxonmap and --taxonnodes parameters now apply exclusively to the makedb command.
- Added option --taxonlist to filter searches by subject taxonomic id.
- Changed database format; rebuilding is required.
[0.9.18]
- Optimized output writing performance.
- Fixed a bug in the XML output format.
[0.9.17]
- Fixed a compiler error on FreeBSD.
- Added option --range-culling.
- Fixed escape sequences in XML output.
[0.9.16]
- Fixed a bug that caused an error for non-SSSE3 builds.
[0.9.15]
- Improved performance of frameshift alignment mode.
[0.9.14]
- Added support for frameshift alignments.
[0.9.13]
- Fixed query positions in pairwise format for translated searches.
- Changed default behaviour of --max-hsps option to report unlimited number of HSPs.
[0.9.12]
- Fixed dbinfo command to be able to read older database formats.
- Adjusted XML format for better compatibility with Blast2Go.
- Fixed a potential error when running multiple instances of Diamond.
[0.9.11]
- Added option --xml-blord-format for alternative-style XML format.
- Fixed a bug that could cause a crash when writing compressed output files.
[0.9.10]
- added --strand option to choose query strand
- added dbinfo command
[0.9.9]
- Added taxonomic classification format.
- Fixed a bug in getseq printing masked residues.
- Fixed parsing of UniRef100_ sequence id prefixes.
- Added support for using the staxids output field in diamond view.
[0.9.8]
- Fixed a compiler error.
[0.9.7]
- Fixed compiler errors.
- Changed XML format to print accessions in the Hit_id and Hit_accession fields.
[0.9.6]
- Fixed compiler errors.
[0.9.5]
- Added support for named pipes.
- Added support for reading input files from stdin.
- Added more elaborate file I/O error messages.
[0.9.4]
- Improved performance.
- Fixed a bug in the query-indexed algorithm.
- Empty sequences are ignored instead of generating an error.
[0.9.3]
- Fixed a bug that could cause hanging.
- Fixed a bug that could cause an error when using the staxids output field and the --unal option.
[0.9.2]
- Fixed a compiler error.
- Improved performance for very small query files.
[0.9.1]
- fixed a performance issue
[0.9.0]
- improved performance
- improved support for alignments with long gaps
- removed SEG masking
- added low complexity masking using tantan
- changed license to AGPL
[0.8.38]
- fixed std::exception error messages
- fixed sequence titles in XML format
- XML and pairwise format contain full length titles by default
[0.8.37]
- fixed a bug that would cause an error message for empty DAA files
- all scoring matrices use the respective default gap penalties from BLAST
- added check for SSSE3 instruction set
- added diamond-sse2 to the binary package
- added staxids field to the tabular format
[0.8.36]
- fixed a compiler error
[0.8.35]
- added a check to detect incomplete database files
- database files will be deleted in case database building fails
- fixed a compiler error on 32 bit systems
[0.8.34]
- fixed a compiler error
[0.8.33]
- modified option --no-self-hits to also require matching sequence titles for filtering of a self hit
- fixed a bug that could cause a crash in the `joining output blocks` stage
[0.8.32]
- improved speed and sensitivity
- fixed an issue that could cause too high memory usage in certain cases
[0.8.31]
- renamed option --run-len to --min-orf
- added compositional score adjustments (option --comp-based-stats (0,1), enabled by default)
- removed --single-domain option and replaced by --max-hsps
- added option --no-self-hits
[0.8.30]
- slightly improved sensitivity
- added option to report unaligned queries (--unal)
- pairwise, XML and SAM format will report unaligned queries by default
- added option to filter alignments by subject cover (--subject-cover)
[0.8.29]
- fixed an issue that could cause a crash when using view on incomplete DAA files
[0.8.28]
- slightly improved sensitivity
- added support for the BLAST pairwise format (option -f 0)
[0.8.27]
- added support for gzip compressed files containing multiple gzip streams
[0.8.26]
- fixed a compiler error
- now compiles as generic C++ code without SSE being available
- added option to write unaligned queries to file (--un)
[0.8.25]
- fixed a bug with the qseq field in the blast tabular format
- added qtitle and btop fields to the blast tabular format
- fixed a bug that could cause a crash when passing a nonexistant input file
- fixed an issue that could cause unexpectedly long runtimes in certain cases
[0.8.24]
- error messages when reading sequence files include line numbers
[0.8.23]
- added option to change the genetic code used for translation in blastx mode
[0.8.22]
- the Hit_id and Hit_accession fields are now filled for the BLAST XML format
[0.8.21]
- fixed an error of 'diamond view' when using a custom scoring matrix
[0.8.20]
- added support for customizing the BLAST tabular output format
[0.8.19]
- ungapped xdrop score and ungapped and gapped filter scores are now set in bits
- added support for custom scoring matrices
[0.8.18]
- fixed a crash bug
- implemented getseq command to retrieve sequences from database files
[0.8.17]
- slightly improved sensitivity of fast and sensitive mode
- added new alignment mode (option --more-sensitive)
- the scoring matrix parameter will accept upper case spelling
[0.8.16]
- optimized performance
[0.8.15]
- fixed a compiler error on Mac
- fixed a crash on some systems
[0.8.14]
- fixed a memory leak
[0.8.13]
- fixed a compiler error for GCC 4.1 and 4.2
[0.8.12]
- changed database format
- block size parameter is set only for the alignment commands
- the program will accept databases created by later versions if the format is compatible
- improved sensitivity of sensitive mode with some loss in performance
[0.8.11]
- fixed a compiler error
[0.8.10]
- added option to directly generate all output formats
- fixed some GCC 6.1 compiler errors
[0.8.9]
- optimized performance
- improved local alignment accuracy
- fixed some fields in the XML format
[0.8.8]
- fixed a clang compiler error
[0.8.7]
- added support for BLAST XML format
- fixed the gzip compressed output option
[0.8.6]
- fixed a problem of the Windows version that could cause errors for larger files
- optimized performance
[0.8.5]
- optimized performance
[0.8.4]
- fixed a problem that could cause very long runtimes for highly repetitive sequences
- optimized performance
- fixed a bug that could cause too high memory usage in blastp mode
[0.8.3]
- fixed a problem that could sometimes cause alignments to be missed
- suppressed reporting of alignments that are enveloped by better alignments
[0.8.2]
- use parameter -k0 to report unlimited number of alignments
- fixed a crash bug on Mac OS X
- fixed a crash when view was used with terminal output
[0.8.1]
- added option to disable auto appending of DAA and DMND file extensions (--no-auto-append)
- fixed some compiler errors for GCC 4.6
[0.8.0]
- fixed a bug that would sometimes cause alignments to be missed
- fixed a bug that would cause alignments on the reverse strand to be missed in blastx mode
- temporary directory now defaults to output directory
- removed dependency on Boost
- fixed a bug that would cause stop codons to be translated into 'X'
[0.7.12]
- fixed header string in SAM output to correctly identify the blastp alignment mode
- added option to filter alignments for a given query cover (option --query-cover)
- added option to print full subject titles in output files (option --salltitles)
[0.7.11]
- added --version switch
- added static build option for CMake build
- fixed a bug that would cause a return code of 1 without an error
[0.7.10]
- --log option works on OS X
- added option to set effective database size (--dbsize)
- added CMake build option
- fixed a Clang compiler warning
- dash characters (-) are ignored (treated as X) in protein sequences
[0.7.9]
- added --single-domain option
- fixed a bug that could cause the program not to use all available threads
- optimized performance
[0.7.8]
- fixed a bug that could produce an incorrect sort order of HSPs
[0.7.7]
- fixed a number formatting error in the SAM output format
[0.7.6]
- fixed a formatting error in CIGAR strings
[0.7.5]
- fixed a compiler error for Clang
- compiles on OS X
- fixed a bug that would not produce the correct sort order for HSPs with e-value 0
- option --run-len defaults to 1 for sequences shorter than 30 letters
[0.7.4]
- removed OpenMP dependency
- using explicit Makefile instead of autoconf
- file extensions can be named explicitly for DAA and database files
- HSPs are grouped by target sequence
- fixed a bug that could produce incorrect output for view
- fixed a bug that could report an incorrect number of alignments
- fixed a compiler error for GCC 4.1.2
[0.7.3]
- changed database format (makedb required)
- optimized multithreading load balancing
- removed a non-determinism in alignment computation
- IUPAC nucleotide ambiguity codes in DNA sequences are accepted and converted into N's
- SEG masking is disabled by default for blastp mode
- fixed a memory leak
- reduced database file sizes
[0.7.2]
- fixed a bug that could create invalid DAA files when using the --id option
- added integrity check of DAA files to view command
- fixed a bug that could cause segmentation fault or file seek errors
[0.7.1]
- fixed a race condition for opening temporary files
- temporary files are deleted on ungraceful termination of the program
- blank lines in FASTA files are tolerated
- fixed a compiler error for GCC 4.4.7
- view command can write to standard output
[0.7.0]
- introduced DAA format
- reduced usage of temporary disk space and memory
- fixed a compiler error for GCC 4.1.2
- fixed a bug that could cause the program to hang when running out of temporary space or memory
- added --forwardonly option to view command bbuchfink-diamond-6dc5717/src/align/ 0000775 0000000 0000000 00000000000 15234073120 0017276 5 ustar 00root root 0000000 0000000 bbuchfink-diamond-6dc5717/src/align/align.cpp 0000664 0000000 0000000 00000023302 15234073120 0021074 0 ustar 00root root 0000000 0000000 /****
DIAMOND protein sequence aligner
Copyright (C) 2012-2026 Benjamin J. Buchfink
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
****/
// SPDX-License-Identifier: GPL-3.0-or-later
#include
#include
#include "basic/value.h"
#include "align.h"
#include "output/output_format.h"
#include "output/output.h"
#include "legacy/pipeline.h"
#include "search/hit_buffer.h"
#include "util/parallel/thread_pool.h"
#include "extend.h"
#include "util/util.h"
#ifdef WITH_DNA
#include "../dna/extension.h"
#endif
#include "util/util.h"
#define _REENTRANT
#include "ips4o/ips4o.hpp"
#include "data/queries.h"
#include "data/sequence_file.h"
#include "search/hit_buffer.h"
using std::get;
using std::tuple;
using std::unique_ptr;
using std::thread;
using std::lock_guard;
using std::mutex;
using std::pair;
using std::vector;
DpStat dp_stat;
static vector make_partition(Search::Hit* begin, Search::Hit* end) {
vector partition;
partition.reserve(div_up(end - begin, (ptrdiff_t)config.min_task_trace_pts) + 1);
Search::Hit* p = begin;
partition.push_back(0);
const BlockId c = align_mode.query_contexts;
while (p < end) {
Search::Hit* q = std::min(p + config.min_task_trace_pts, end - 1);
const BlockId query = q->query_ / c;
do {
++q;
} while (q < end && q->query_ / c == query);
partition.push_back(q - begin);
p = q;
}
return partition;
}
struct HitIterator {
static bool single_query() {
return config.swipe_all || align_mode.mode == AlignMode::blastn;
}
HitIterator(BlockId qbegin, BlockId qend, Search::Hit* begin, Search::Hit* end, vector::const_iterator partition, int64_t parts):
partition(partition),
parts(parts),
data(begin),
query_begin(qbegin),
query_end(qend)
{}
struct Hits {
BlockId query;
Search::Hit* begin, * end;
};
vector fetch(int64_t i) {
vector r;
if (single_query()) {
r.push_back(Hits{ (BlockId)i,nullptr,nullptr });
return r;
}
assert(i >= 0 && i < parts);
const BlockId c = align_mode.query_contexts;
Search::Hit* begin = data + partition[i], * end = data + partition[i + 1];
BlockId last_query = begin > data ? (begin - 1)->query_/c + 1 : query_begin;
const int64_t query_count = (end - 1)->query_/c + 1 - last_query;
r.reserve(query_count);
for (; last_query < begin->query_/c; ++last_query)
r.push_back(Hits{ last_query, nullptr,nullptr });
auto it = merge_keys(begin, end, [c](const Search::Hit& h) { return h.query_/c; });
while (it.good()) {
for (; last_query < it.key(); ++last_query)
r.push_back(Hits{ last_query, nullptr,nullptr });
r.push_back(Hits{ (BlockId)it.key(), it.begin(), it.end() });
++it;
++last_query;
}
if (i == parts - 1) {
r.reserve(r.size() + query_end - (r.back().query + 1));
for (BlockId j = r.back().query + 1; j < query_end; ++j)
r.push_back(Hits{ j, nullptr,nullptr });
}
return r;
}
const vector::const_iterator partition;
const int64_t parts;
Search::Hit* data;
const BlockId query_begin, query_end;
};
static TextBuffer* legacy_pipeline(const HitIterator::Hits& hits, Search::Config& cfg, Statistics &stat) {
if (hits.end == hits.begin) {
TextBuffer *buf = nullptr;
if (!cfg.blocked_processing && *cfg.output_format != OutputFormat::daa && cfg.output_format->report_unaligned()) {
buf = new TextBuffer;
Output::Info info{ cfg.query->seq_info(hits.query), true, cfg.db.get(), *buf, Util::Seq::AccessionParsing(), cfg.db->sequence_count(), cfg.db->letters() };
cfg.output_format->print_query_intro(info);
cfg.output_format->print_query_epilog(info);
}
return buf;
}
QueryMapper *mapper = new ExtensionPipeline::BandedSwipe::Pipeline(hits.query, hits.begin, hits.end, dp_stat, cfg);
TaskTimer timer("Initializing mapper", UINT_MAX);
mapper->init();
timer.finish();
mapper->run(stat, cfg);
timer.go("Generating output");
TextBuffer *buf = nullptr;
if (*cfg.output_format != OutputFormat::null) {
buf = new TextBuffer;
const bool aligned = mapper->generate_output(*buf, stat, cfg);
if (aligned && cfg.track_aligned_queries) {
query_aligned_mtx.lock();
if (!query_aligned[hits.query]) {
query_aligned[hits.query] = true;
++cfg.iteration_query_aligned;
}
query_aligned_mtx.unlock();
}
}
delete mapper;
return buf;
}
static void align_worker(HitIterator* hit_it, Search::Config* cfg, int64_t next)
{
try {
std::pmr::monotonic_buffer_resource pool;
const vector hits = hit_it->fetch(next);
assert(!hits.empty());
Statistics stat;
DpStat dp_stat;
const bool parallel = config.swipe_all && (cfg->target->seqs().size() >= cfg->query->seqs().size());
for (auto h = hits.cbegin(); h < hits.cend(); ++h) {
pool.release();
if (config.frame_shift != 0) {
TextBuffer* buf = legacy_pipeline(*h, *cfg, stat);
output_sink->push(h->query, buf);
continue;
}
if (h->begin == nullptr && !HitIterator::single_query()) {
output_sink->push(h->query, nullptr);
continue;
}
vector matches =
#ifdef WITH_DNA
align_mode.mode == AlignMode::blastn ? Dna::extend(*cfg, cfg->query->seqs()[h->query]) :
#endif
Extension::extend(h->query, h->begin, h->end, *cfg, stat, parallel ? DP::Flags::PARALLEL : DP::Flags::NONE, pool);
TextBuffer* buf = cfg->blocked_processing ? Extension::generate_intermediate_output(matches, h->query, *cfg) : Extension::generate_output(matches, h->query, stat, *cfg);
if (!matches.empty() && cfg->track_aligned_queries) {
std::lock_guard lock(query_aligned_mtx);
if (!query_aligned[h->query]) {
query_aligned[h->query] = true;
++cfg->iteration_query_aligned;
}
}
output_sink->push(h->query, buf);
}
statistics += stat;
::dp_stat += dp_stat;
}
catch (std::exception& e) {
std::cerr << "Error: " << e.what() << std::endl;
exit(EXIT_FAILURE);
}
}
void align_queries(File* output_file, Search::Config& cfg)
{
const uint64_t mem_limit = Util::String::interpret_number(config.memory_limit.get("16G"));
pair query_range;
TaskTimer timer("Allocating memory", 3);
if (!cfg.blocked_processing && !cfg.iterated())
cfg.db->init_random_access(cfg.current_query_block, 0, false);
uint64_t res_size = cfg.query->mem_size() + cfg.target->mem_size();
cfg.seed_hit_buf->alloc_buffer();
cfg.seed_hit_buf->load(std::min(mem_limit - res_size - cfg.seed_hit_buf->next_bin_size() * (uint64_t)sizeof(Search::Hit), config.trace_pt_fetch_size));
bool goon = true;
while (goon) {
timer.go("Loading trace points");
tuple input = cfg.seed_hit_buf->retrieve();
statistics.inc(Statistics::TIME_LOAD_SEED_HITS, timer.microseconds());
goon = cfg.seed_hit_buf->load(std::min(mem_limit - res_size - cfg.seed_hit_buf->next_bin_size() * (int64_t)sizeof(Search::Hit), config.trace_pt_fetch_size));
timer.finish();
Search::Hit* hit_buf = get<0>(input);
const int64_t hit_count = get<1>(input);
*log_stream << "Processing " << hit_count << " trace points (" << Util::String::format(int64_t(hit_count * sizeof(Search::Hit))) << ")." << std::endl;
res_size += hit_count * sizeof(Search::Hit);
query_range = { get<2>(input), get<3>(input) };
timer.go("Sorting trace points");
#ifdef NDEBUG
//sort::sort_parallel_blocked_inplace(hit_buf, hit_buf + hit_count, std::less(), config.threads_);
ips4o::parallel::sort(hit_buf, hit_buf + hit_count, std::less(), config.threads_);
#else
std::sort(hit_buf, hit_buf + hit_count);
#endif
statistics.inc(Statistics::TIME_SORT_SEED_HITS, timer.microseconds());
timer.go("Computing partition");
const vector partition = make_partition(hit_buf, hit_buf + hit_count);
timer.go("Computing alignments");
HitIterator hit_it(query_range.first, query_range.second, hit_buf, hit_buf + hit_count, partition.begin(), (int64_t)partition.size() - 1);
OutputWriter writer{output_file, cfg.blocked_processing ? '\0' : cfg.output_format->query_separator };
output_sink.reset(new ReorderQueue(query_range.first, writer));
unique_ptr heartbeat;
if (config.verbosity >= 3 && config.load_balancing == Config::query_parallel && !config.swipe_all && config.heartbeat)
heartbeat.reset(new thread(heartbeat_worker, query_range.second, &cfg));
const int threads = config.load_balancing == Config::target_parallel || (config.swipe_all && (cfg.target->seqs().size() >= cfg.query->seqs().size())) ? 1
: (config.threads_align == 0 ? config.threads_ : config.threads_align);
auto task = [&hit_it, &cfg](ThreadPool& tp, int64_t i) { return align_worker(&hit_it, &cfg, i); };
cfg.thread_pool.reset(config.swipe_all ? new ThreadPool(task, query_range.first, query_range.second) : new ThreadPool(task, 0, (int64_t)partition.size() - 1));
cfg.thread_pool->run(threads);
cfg.thread_pool->join();
if (heartbeat)
heartbeat->join();
statistics.inc(Statistics::TIME_EXT, timer.microseconds());
timer.go("Deallocating buffers");
cfg.thread_pool.reset();
output_sink.reset();
}
statistics.max(Statistics::SEARCH_TEMP_SPACE, cfg.seed_hit_buf->total_disk_size());
timer.go("Freeing memory");
cfg.seed_hit_buf->free_buffer();
if (!cfg.blocked_processing && !cfg.iterated())
cfg.db->end_random_access(false);
} bbuchfink-diamond-6dc5717/src/align/align.h 0000664 0000000 0000000 00000001550 15234073120 0020542 0 ustar 00root root 0000000 0000000 /****
DIAMOND protein sequence aligner
Copyright (C) 2012-2026 Benjamin J. Buchfink
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
****/
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include "util/io/file.h"
#include "run/config.h"
void align_queries(File* output_file, Search::Config &cfg); bbuchfink-diamond-6dc5717/src/align/alt_hsp.cpp 0000664 0000000 0000000 00000010743 15234073120 0021441 0 ustar 00root root 0000000 0000000 /****
DIAMOND protein sequence aligner
Copyright (C) 2012-2026 Benjamin J. Buchfink
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
****/
// SPDX-License-Identifier: GPL-3.0-or-later
#include "dp/dp.h"
#include "extend.h"
#include "util/sequence/sequence.h"
#include "stats/hauser_correction.h"
using std::list;
using std::array;
using std::vector;
namespace Extension {
struct ActiveTarget {
ActiveTarget(vector::iterator match, SequenceSet& dst) :
match(match),
active(0)
{
masked_seq.fill(nullptr);
uint32_t active = 0;
const auto l = match->seq.length();
for (const Hsp& h : match->hsp) {
if (!(active & (1 << h.frame))) {
dst.reserve(l);
active |= 1 << h.frame;
}
}
}
ActiveTarget(const ActiveTarget& t):
match(t.match),
masked_seq(t.masked_seq),
active(0)
{
for (int32_t i = 0; i < align_mode.query_contexts; ++i)
if (!(t.active & (1 << i)))
masked_seq[i] = nullptr;
}
void copy_seq(SequenceSet& dst, int64_t& i) {
for (const Hsp& h : match->hsp) {
if (!masked_seq[h.frame]) {
dst.assign(i, match->seq.data(), match->seq.end());
masked_seq[h.frame] = dst.ptr(i++);
}
Letter* seq = masked_seq[h.frame];
std::fill(seq + h.subject_range.begin_, seq + h.subject_range.end_, SUPER_HARD_MASK);
}
}
Sequence masked(int32_t context) const {
return Sequence(masked_seq[context], match->seq.length());
}
int32_t check_fully_masked() {
int32_t n = 0;
for (int32_t i = 0; i < align_mode.query_contexts; ++i)
if (active & (1 << i)) {
if (Util::Seq::is_fully_masked(masked(i)))
active &= ~(1 << i);
else
++n;
}
return n;
}
const vector::iterator match;
array masked_seq;
uint32_t active;
};
using TargetVec = vector;
static TargetVec recompute_alt_hsps(const Query& query, TargetVec& targets, const HspValues v, Statistics& stats) {
array dp_targets;
const Loc qlen = query.sequence[0].length();
for (auto it = targets.begin(); it != targets.end(); ++it) {
const int64_t dp_size = (int64_t)qlen * (int64_t)it->match->seq.length();
const ::Stats::TargetMatrix* matrix = it->match->matrix.get();
const int bin = DP::BandedSwipe::bin(v, qlen, 0, 0, dp_size, matrix ? matrix->score_width() : 0, 0);
for (int32_t context = 0; context < align_mode.query_contexts; ++context) {
if (it->masked_seq[context]) {
const Sequence target = it->masked(context);
dp_targets[context][bin].emplace_back(target, target.length(), BlockId(it - targets.begin()), matrix);
}
}
}
for (int32_t context = 0; context < align_mode.query_contexts; ++context) {
DP::Params params{ query.sequence[context], "", Frame(context), query.source_length, query.composition_bias(context), DP::Flags::FULL_MATRIX, false, 0, -1,
v, stats, nullptr };
list hsp = DP::BandedSwipe::swipe(dp_targets[context], params);
while (!hsp.empty()) {
ActiveTarget& t = targets[hsp.front().swipe_target];
list& l = t.match->hsp;
l.splice(l.end(), hsp, hsp.begin());
std::fill(t.masked_seq[context] + l.back().subject_range.begin_, t.masked_seq[context] + l.back().subject_range.end_, SUPER_HARD_MASK);
t.active |= 1 << context;
}
}
TargetVec out;
for (ActiveTarget& t : targets) {
if (t.active) {
t.match->inner_culling();
if (t.check_fully_masked() > 0 && (t.match->hsp.size() < config.max_hsps || config.max_hsps == 0))
out.emplace_back(t);
}
}
return out;
}
void recompute_alt_hsps(vector::iterator begin, vector::iterator end, const Query& query, const HspValues v, Statistics& stats) {
if (config.max_hsps == 1)
return;
TargetVec targets;
targets.reserve(end - begin);
SequenceSet target_seqs;
for (auto i = begin; i != end; ++i)
targets.emplace_back(i, target_seqs);
target_seqs.finish_reserve();
int64_t i = 0;
for (ActiveTarget& t : targets)
t.copy_seq(target_seqs, i);
while(!targets.empty())
targets = recompute_alt_hsps(query, targets, v, stats);
}
}
bbuchfink-diamond-6dc5717/src/align/culling.cpp 0000664 0000000 0000000 00000016063 15234073120 0021445 0 ustar 00root root 0000000 0000000 /****
DIAMOND protein sequence aligner
Copyright (C) 2012-2026 Benjamin J. Buchfink
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
****/
// SPDX-License-Identifier: GPL-3.0-or-later
#include
#include "target.h"
#include "basic/config.h"
#ifdef WITH_MCL
#include "contrib/mcl/recursive_parser.h"
#endif
#include "output/output_format.h"
#include "culling.h"
using std::vector;
using std::list;
namespace Extension {
static void max_hsp_culling(list& hsps) {
if (config.max_hsps > 0 && hsps.size() > config.max_hsps)
hsps.resize(config.max_hsps);
}
static void inner_culling(list& hsps) {
if (hsps.size() <= 1)
return;
hsps.sort();
if (config.max_hsps == 1) {
hsps.resize(1);
return;
}
const double overlap = config.inner_culling_overlap / 100.0;
for (list::iterator i = hsps.begin(); i != hsps.end();) {
if (i->is_enveloped_by(hsps.begin(), i, overlap))
i = hsps.erase(i);
else
++i;
}
if (config.max_hsps > 0)
max_hsp_culling(hsps);
}
void Target::inner_culling() {
if (config.max_hsps == 1) {
for (int i = 0; i < MAX_CONTEXT; ++i)
if (i == best_context) {
hsp[i].sort();
hsp[i].resize(1);
}
else
hsp[i].clear();
return;
}
list hsps;
for (int frame = 0; frame < align_mode.query_contexts; ++frame)
hsps.splice(hsps.end(), hsp[frame]);
Extension::inner_culling(hsps);
while (!hsps.empty()) {
auto& l = hsp[hsps.front().frame];
l.splice(l.end(), hsps, hsps.begin());
}
}
void Match::inner_culling()
{
Extension::inner_culling(hsp);
if (!hsp.empty()) {
filter_evalue = hsp.front().evalue;
filter_score = hsp.front().score;
}
}
void Match::max_hsp_culling() {
Extension::max_hsp_culling(hsp);
}
static void sort_targets(vector& targets) {
std::sort(targets.begin(), targets.end(), config.toppercent.present() ? Target::comp_score : Target::comp_evalue);
}
template
static It output_range(const It begin, const It end, const Search::Config& cfg) {
if (end <= begin)
return begin;
It i = begin;
if (i->filter_evalue == DBL_MAX)
return begin;
if (config.toppercent.present()) {
const double cutoff = std::max(top_cutoff_score(score_matrix.bitscore(begin->filter_score)), 1.0);
while (i < end && (score_matrix.bitscore(i->filter_score) >= cutoff))
++i;
}
else {
i += std::min((ptrdiff_t)cfg.max_target_seqs, end - begin);
while (--i > begin && i->filter_evalue == DBL_MAX);
++i;
}
return i;
}
bool append_hits(vector& targets, vector::iterator begin, vector::iterator end, bool with_culling, const Search::Config& cfg) {
if (end <= begin)
return false;
bool new_hits = config.toppercent.blank() && (int64_t)targets.size() < cfg.max_target_seqs;
bool append = !with_culling || new_hits;
culling(targets, append, cfg);
int max_score = 0;
double min_evalue = DBL_MAX;
for (auto i = begin; i < end; ++i) {
max_score = std::max(max_score, i->filter_score);
min_evalue = std::min(min_evalue, i->filter_evalue);
}
vector::const_iterator range_end = output_range(targets.begin(), targets.end(), cfg);
if (targets.empty()
|| (config.toppercent.blank() && min_evalue <= (range_end - 1)->filter_evalue)
|| (config.toppercent.present() && max_score >= top_cutoff_score((range_end - 1)->filter_score))) {
append = true;
new_hits = true;
}
if(append)
targets.insert(targets.end(), std::make_move_iterator(begin), std::make_move_iterator(end));
return new_hits;
}
bool filter_hsp(Hsp& hsp, int source_query_len, const char *query_title, int subject_len, const char* subject_title, const Sequence& query_seq, const Sequence& subject_seq, const double query_self_aln_score, const double target_self_aln_score, const OutputFormat* output_format) {
bool cluster_threshold = true;
#ifdef WITH_MCL
if (config.cluster_threshold.present()) {
HspContext context(hsp, 0, 0, TranslatedSequence(query_seq), query_title, 0, subject_len, subject_title, 0, 0, subject_seq, 0, query_self_aln_score, target_self_aln_score);
RecursiveParser rp(&context, dynamic_cast(output_format)->format.c_str());
cluster_threshold = rp.evaluate() >= config.cluster_threshold;
}
#endif
const double qcov = hsp.query_cover_percent(source_query_len),
tcov = hsp.subject_cover_percent(subject_len),
approx_min_id = config.approx_min_id.get(0.0);
//const bool filter_uncov = std::max(hsp.query_range.begin_, source_query_len - hsp.query_range.end_) > config.uncov_cap || std::max(hsp.subject_range.begin_, subject_len - hsp.subject_range.end_) > config.uncov_cap;
return !cluster_threshold
|| hsp.id_percent() < config.min_id
|| (approx_min_id > 0 && hsp.approx_id < approx_min_id)
|| qcov < config.query_cover
|| tcov < config.subject_cover
//|| filter_uncov
|| (qcov < config.query_or_target_cover && tcov < config.query_or_target_cover)
|| (config.no_self_hits
&& query_seq == subject_seq
&& strcmp(query_title, subject_title) == 0);
}
void Match::apply_filters(const Query& query, const Block& targets, const OutputFormat* output_format)
{
const char* title = config.no_self_hits ? targets.ids()[target_block_id] : nullptr;
const Sequence seq = targets.seqs()[target_block_id];
const int len = seq.length();
const double self_aln = targets.has_self_aln() ? targets.self_aln_score(target_block_id) : 0.0;
for (list::iterator i = hsp.begin(); i != hsp.end();) {
if (filter_hsp(*i, query.source_length, query.title, len, title, query.sequence[0], seq, query.self_alignment_score, self_aln, output_format))
i = hsp.erase(i);
else
++i;
}
filter_evalue = hsp.empty() ? DBL_MAX : hsp.front().evalue;
filter_score = hsp.empty() ? 0 : hsp.front().score;
}
void culling(std::vector& targets, bool sort_only, const Search::Config& cfg) {
sort_targets(targets);
if (!sort_only)
targets.erase(output_range(targets.begin(), targets.end(), cfg), targets.end());
}
void apply_filters(std::vector::iterator begin, std::vector::iterator end, const Query& query, const Search::Config& cfg) {
if (config.min_id > 0 || config.approx_min_id.get(0.0) > 0 || config.query_cover > 0 || config.subject_cover > 0 || config.query_or_target_cover > 0 || config.no_self_hits || config.cluster_threshold.present())
for (auto i = begin; i < end; ++i)
i->apply_filters(query, *cfg.target, cfg.output_format.get());
}
void culling(std::vector& targets, const Search::Config& cfg) {
std::sort(targets.begin(), targets.end(), config.toppercent.present() ? Match::cmp_score : Match::cmp_evalue);
targets.erase(output_range(targets.begin(), targets.end(), cfg), targets.end());
}
}
bbuchfink-diamond-6dc5717/src/align/culling.h 0000664 0000000 0000000 00000002160 15234073120 0021103 0 ustar 00root root 0000000 0000000 /****
DIAMOND protein sequence aligner
Copyright (C) 2012-2026 Benjamin J. Buchfink
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
****/
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include "basic/match.h"
#include "output/output_format.h"
namespace Extension {
bool filter_hsp(Hsp& hsp,
int source_query_len,
const char *query_title,
int subject_len,
const char* subject_title,
const Sequence& query_seq,
const Sequence& subject_seq,
const double query_self_aln_score,
const double target_self_aln_score,
const OutputFormat* output_format);
} bbuchfink-diamond-6dc5717/src/align/def.h 0000664 0000000 0000000 00000002027 15234073120 0020206 0 ustar 00root root 0000000 0000000 /****
DIAMOND protein sequence aligner
Copyright (C) 2012-2026 Benjamin J. Buchfink
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
****/
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include "dp/flags.h"
namespace Extension {
enum class Mode {
BANDED_FAST, BANDED_SLOW, FULL, GLOBAL, NONE
};
int band(int len, const Mode mode);
HspValues filter_hspvalues();
}
template<>
struct EnumTraits {
static const SEMap from_string;
};
bbuchfink-diamond-6dc5717/src/align/extend.cpp 0000664 0000000 0000000 00000040777 15234073120 0021310 0 ustar 00root root 0000000 0000000 /****
DIAMOND protein sequence aligner
Copyright (C) 2012-2026 Benjamin J. Buchfink
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
****/
// SPDX-License-Identifier: GPL-3.0-or-later
#include
#include
#include
#include
#include
#include "extend.h"
#include "data/block/block.h"
#include "data/sequence_set.h"
#include "data/string_set.h"
#include "util/options/option.h"
#include "basic/config.h"
#include "target.h"
#include "util/log_stream.h"
#include "util/util.h"
#include "global_ranking/global_ranking.h"
#include "search/hit.h"
#include "load_hits.h"
#include "def.h"
using std::accumulate;
using std::vector;
using std::list;
using std::array;
using std::pair;
using std::endl;
using std::make_move_iterator;
using std::any_of;
using std::numeric_limits;
using std::runtime_error;
using std::tie;
using std::min;
const SEMap EnumTraits::from_string = {
{ "banded-fast", Extension::Mode::BANDED_FAST},
{ "banded-slow", Extension::Mode::BANDED_SLOW},
{ "full", Extension::Mode::FULL},
{ "none", Extension::Mode::NONE},
{ "global", Extension::Mode::GLOBAL}
};
namespace Extension {
Query::Query(BlockId block_id, Statistics& stats, const Search::Config& cfg, std::pmr::monotonic_buffer_resource& pool) :
block_id(block_id),
title(cfg.query->ids()[block_id]),
source_length(align_mode.query_translated ? (int)cfg.query->source_seqs()[block_id].length() : (int)cfg.query->seqs()[block_id].length()),
true_aa_length(0),
self_alignment_score(cfg.query->has_self_aln() ? cfg.query->self_aln_score(block_id) : 0.0)
{
const unsigned contexts = align_mode.query_contexts;
sequence.reserve(contexts);
for (unsigned i = 0; i < contexts; ++i)
sequence.push_back(cfg.query->seqs()[block_id * contexts + i]);
true_aa_length = ::Stats::count_true_aa(sequence.front());
const Loc qlen = sequence.front().length();
if (qlen <= config.short_query_max_len)
ungapped_cutoff = score_matrix.rawscore(config.short_query_ungapped_bitscore);
else if (cfg.ungapped_evalue > 0.0)
ungapped_cutoff = score_matrix.rawscore(score_matrix.bitscore_norm(cfg.ungapped_evalue, qlen));
else
ungapped_cutoff = 1;
ungapped_cutoff = std::max(ungapped_cutoff, 1);
const unsigned cbs = static_cast(config.comp_based_stats_.get(Stats::DEFAULT_CBS));
if (::Stats::CBS::hauser(cbs)) {
hauser_correction.reserve(contexts);
for (const Sequence& seq : sequence)
hauser_correction.emplace_back(seq);
}
if (::Stats::CBS::matrix_adjust(cbs))
composition = ::Stats::composition(sequence.front());
if ((config.reseek_diags || config.lin_stage1_query || config.lin_stage1_target) && (cfg.extension_mode == Extension::Mode::BANDED_FAST || cfg.extension_mode == Extension::Mode::BANDED_SLOW)) {
if (sequence.size() > 1)
throw runtime_error("Reseeking diagonals is not supported for translated queries.");
seqindex.reset(new Seqindex(sequence.front(), cfg.keyword_length, cfg.keyword_threshold, pool, stats));
}
}
const std::map default_ext_mode = {
{ Sensitivity::FASTER, Mode::BANDED_FAST},
{ Sensitivity::FAST, Mode::BANDED_FAST},
{ Sensitivity::SHAPES6x10, Mode::BANDED_FAST},
{ Sensitivity::SHAPES30x10, Mode::BANDED_FAST},
{ Sensitivity::LINCLUST_20, Mode::BANDED_FAST},
{ Sensitivity::LINCLUST_40, Mode::BANDED_FAST},
{ Sensitivity::DEFAULT, Mode::BANDED_FAST},
{ Sensitivity::MID_SENSITIVE, Mode::BANDED_FAST},
{ Sensitivity::SENSITIVE, Mode::BANDED_FAST},
{ Sensitivity::MORE_SENSITIVE, Mode::BANDED_SLOW},
{ Sensitivity::VERY_SENSITIVE, Mode::BANDED_SLOW},
{ Sensitivity::ULTRA_SENSITIVE, Mode::BANDED_SLOW}
};
constexpr int64_t MAX_CHUNK_SIZE = 400, MIN_CHUNK_SIZE = 128, MAPANY_CHUNK_SIZE = 16;
int64_t ranking_chunk_size(int64_t target_count, const int64_t ref_letters, const int64_t max_target_seqs) {
if (config.no_ranking || config.global_ranking_targets > 0)
return target_count;
if (config.ext_chunk_size > 0)
return config.ext_chunk_size;
if (config.mapany)
return MAPANY_CHUNK_SIZE;
const double default_letters = config.sensitivity >= Sensitivity::VERY_SENSITIVE ? 800 * 1e6 : 2 * 1e9;
const int64_t block_mult = std::max(int64_t(std::round((double)ref_letters / default_letters)), (int64_t)1);
if (config.toppercent.present())
return MIN_CHUNK_SIZE * block_mult;
const int64_t size = std::max(MIN_CHUNK_SIZE, std::min(make_multiple(max_target_seqs, (int64_t)32), MAX_CHUNK_SIZE)) * block_mult;
return config.target_hard_cap ? std::min(size, config.target_hard_cap) : size;
}
static bool have_filters(const Search::Config& cfg) {
return config.min_id > 0 || config.approx_min_id.get(0.0) > 0 || config.query_cover > 0 || config.subject_cover > 0 || config.query_or_target_cover > 0;
}
static HspValues first_round_hspv(const Search::Config& cfg) {
HspValues first_round = HspValues::NONE;
if (config.min_id > 0)
first_round |= HspValues::IDENT | HspValues::LENGTH;
if (config.query_cover > 0)
first_round |= HspValues::QUERY_COORDS;
if (config.subject_cover > 0)
first_round |= HspValues::TARGET_COORDS;
if (config.cluster_threshold.present())
first_round |= cfg.output_format->hsp_values;
return first_round;
}
static bool ranking_terminate(bool new_hits, int last_tail_score, int tail_score, int64_t targets_processed, int64_t targets_aligned) {
if (config.target_hard_cap && targets_processed >= config.target_hard_cap)
return true;
if (config.mapany && config.toppercent.blank() && targets_aligned > 0)
return true;
return !new_hits && (last_tail_score == 0
|| double(tail_score) / (double)last_tail_score <= config.ranking_score_drop_factor
|| score_matrix.bitscore(tail_score) < config.ranking_cutoff_bitscore);
}
Match Match::self_match(BlockId query_id, Sequence query_seq) {
Match m(query_id, query_seq, nullptr, 0, numeric_limits::max(), 0.0);
m.hsp.emplace_back();
m.hsp.back().evalue = 0.0;
m.hsp.back().score = numeric_limits::max();
m.hsp.back().bit_score = DBL_MAX;
m.hsp.back().query_range = { 0,query_seq.length() };
m.hsp.back().query_source_range = { 0,query_seq.length() };
m.hsp.back().subject_range = { 0,query_seq.length() };
return m;
}
static bool add_self_aln(const Search::Config& cfg) {
return config.add_self_aln && ((config.self && cfg.current_ref_block == 0) || (!config.self && cfg.current_query_block == cfg.current_ref_block));
}
static Hsp seed_only_hsp(const SeedHit& hit, unsigned query_source_len) {
Hsp hsp;
hsp.seed_only = true;
hsp.score = hit.score;
hsp.evalue = 0.0;
hsp.d_begin = hsp.d_end = hit.diag();
hsp.set_begin(hit.i, hit.j, Frame(hit.frame), query_source_len);
hsp.set_end(hit.i + 1, hit.j + 1, Frame(hit.frame), query_source_len);
hsp.subject_source_range = hsp.subject_range;
return hsp;
}
static vector seed_only_matches(const Query& query, const Search::Config& cfg, SeedHitList& l) {
vector matches;
matches.reserve(l.target_scores.size());
for (const TargetScore& target_score : l.target_scores) {
const BlockId target_block_id = l.target_block_ids[target_score.target];
Match match(target_block_id, cfg.target->seqs()[target_block_id], nullptr, target_score.score, target_score.score, 0.0);
for (auto i = l.seed_hits.begin(target_score.target); i < l.seed_hits.end(target_score.target); ++i)
match.hsp.push_back(seed_only_hsp(*i, query.source_length));
match.hsp.sort();
if (config.max_hsps > 0 && match.hsp.size() > config.max_hsps)
match.hsp.resize(config.max_hsps);
matches.push_back(std::move(match));
}
culling(matches, cfg);
return matches;
}
static size_t lazy_masking(std::vector::const_iterator target_block_ids, vector::const_iterator target_block_ids_end, Block& targets, const MaskingAlgo algo) {
if (algo == MaskingAlgo::NONE)
return 0;
vector seq;
const Masking& masking = Masking::get();
size_t n = 0;
for (auto i = target_block_ids; i != target_block_ids_end; ++i)
if (targets.fetch_seq_if_unmasked(*i, seq)) {
masking(seq.data(), seq.size(), algo, *i);
targets.write_masked_seq(*i, seq);
++n;
}
return n;
}
static vector extend_chunk(const Query& query,
FlatArray::Iterator seed_hits,
FlatArray::Iterator seed_hits_end,
vector::const_iterator target_block_ids,
const Search::Config& cfg,
Statistics& stat,
DP::Flags flags,
const HspValues hsp_values,
std::pmr::monotonic_buffer_resource& pool)
{
static const Loc GAPPED_FILTER_MIN_QLEN = 85;
const int64_t n = seed_hits_end - seed_hits;
stat.inc(Statistics::TARGET_HITS2, n);
TaskTimer timer(flag_any(flags, DP::Flags::PARALLEL) ? config.target_parallel_verbosity : UINT_MAX);
if (cfg.lazy_masking && !config.global_ranking_targets)
stat.inc(Statistics::MASKED_LAZY, lazy_masking(target_block_ids, target_block_ids + n, *cfg.target, cfg.target_masking));
pair, vector> gf;
if (cfg.gapped_filter_evalue > 0.0 && config.global_ranking_targets == 0 && (!align_mode.query_translated || query.sequence[0].length() >= GAPPED_FILTER_MIN_QLEN)) {
timer.go("Computing gapped filter");
gf = gapped_filter(query, seed_hits, seed_hits_end, target_block_ids, stat, flags, cfg);
if (!flag_any(flags, DP::Flags::PARALLEL))
stat.inc(Statistics::TIME_GAPPED_FILTER, timer.microseconds());
seed_hits = gf.first.begin();
seed_hits_end = gf.first.end();
target_block_ids = gf.second.cbegin();
}
stat.inc(Statistics::TARGET_HITS3, seed_hits_end - seed_hits);
timer.go("Computing chaining");
vector targets = ungapped_stage(query, seed_hits, seed_hits_end, target_block_ids, flags, stat, *cfg.target, cfg.extension_mode, pool, cfg);
if (!flag_any(flags, DP::Flags::PARALLEL))
stat.inc(Statistics::TIME_CHAINING, timer.microseconds());
auto ret = align(targets, query, flags, hsp_values, cfg.extension_mode, *cfg.thread_pool, cfg, stat, pool);
return ret;
}
vector extend(
const Query& query,
const Search::Config& cfg,
Statistics& stat,
DP::Flags flags,
SeedHitList& l,
std::pmr::monotonic_buffer_resource& pool)
{
const unsigned UNIFIED_TARGET_LEN = 50;
if (config.log_query || (flag_any(flags, DP::Flags::PARALLEL) && !config.swipe_all))
*log_stream << "Query=" << query.title << " Hits=" << l.seed_hits.data_size() << endl;
const unsigned query_len = (unsigned)query.sequence.front().length();
const size_t target_count = l.target_block_ids.size();
if (cfg.extension_mode == Mode::NONE) { std::sort(l.target_scores.begin(), l.target_scores.end()); return seed_only_matches(query, cfg, l); }
const int64_t chunk_size = ranking_chunk_size(target_count, cfg.target->seqs().letters(), cfg.max_target_seqs);
vector::const_iterator i0 = l.target_scores.cbegin(), i1 = i0 + std::min((ptrdiff_t)chunk_size, l.target_scores.cend() - i0);
if (config.toppercent.blank() && config.min_bit_score == 0.0 && (i1 - i0) < cfg.max_target_seqs && (config.ext_chunk_size == 0 || config.lin_stage1_query))
#ifdef EVAL_TARGET
while (i1 < l.target_scores.cend() && i1->evalue <= config.max_evalue && size_t(i1 - i0) < config.max_alignments) ++i1;
#else
while (i1 < l.target_scores.cend() && score_matrix.evalue(i1->score, query_len, UNIFIED_TARGET_LEN) <= config.max_evalue) i1 += min((ptrdiff_t)16, l.target_scores.cend() - i1);
#endif
const HspValues first_round_hspv = config.anchored_swipe ||
(config.sensitivity <= Sensitivity::SHAPES30x10 && flag_only(cfg.output_format->hsp_values, HspValues::COORDS) && config.toppercent.blank() && (size_t)cfg.max_target_seqs >= l.target_scores.size())
? HspValues::COORDS : HspValues::NONE;
const bool first_round_culling = !have_filters(cfg) || config.toppercent.present();
bool new_hits_ev = false;
int tail_score = 0, previous_tail_score = 0;
FlatArray seed_hits_chunk;
vector target_block_ids_chunk;
vector matches;
do {
vector aligned_targets;
bool new_hits;
do {
const int64_t current_chunk_size = i1 - i0;
const bool multi_chunk = current_chunk_size < (int64_t)l.target_scores.size();
if (multi_chunk) {
target_block_ids_chunk.clear();
seed_hits_chunk.clear();
target_block_ids_chunk.reserve(i1 - i0);
seed_hits_chunk.reserve(i1 - i0, accumulate(i0, i1, (int64_t)0, [&l](int64_t n, const TargetScore& s) { return l.seed_hits.count(s.target) + n; }));
for (vector::const_iterator j = i0; j < i1; ++j) {
target_block_ids_chunk.push_back(l.target_block_ids[j->target]);
seed_hits_chunk.push_back(l.seed_hits.begin(j->target), l.seed_hits.end(j->target));
}
}
vector v = extend_chunk(
query,
multi_chunk ? seed_hits_chunk.begin() : l.seed_hits.begin(),
multi_chunk ? seed_hits_chunk.end() : l.seed_hits.end(),
multi_chunk ? target_block_ids_chunk.cbegin() : l.target_block_ids.cbegin(),
cfg,
stat,
flags,
first_round_hspv,
pool);
stat.inc(Statistics::TARGET_HITS4, v.size());
new_hits = new_hits_ev = v.size() > 0;
if (multi_chunk)
new_hits = append_hits(aligned_targets, v.begin(), v.end(), first_round_culling, cfg);
else
aligned_targets = std::move(v);
i0 = i1;
i1 += std::min((ptrdiff_t)chunk_size, l.target_scores.cend() - i1);
previous_tail_score = tail_score;
if (new_hits)
tail_score = (i1 - 1)->score;
} while (i0 < l.target_scores.cend() && !ranking_terminate(new_hits, previous_tail_score, (i1 - 1)->score, i1 - l.target_scores.cbegin(), aligned_targets.size()));
if (config.swipe_all)
aligned_targets = full_db_align(query, flags, HspValues::NONE, stat, *cfg.target);
culling(aligned_targets, !first_round_culling, cfg);
stat.inc(Statistics::TARGET_HITS5, aligned_targets.size());
vector round_matches = align(aligned_targets, matches.size(), query, flags, first_round_hspv, first_round_culling, stat, cfg);
matches.insert(matches.end(), make_move_iterator(round_matches.begin()), make_move_iterator(round_matches.end()));
} while (config.toppercent.blank() && (int64_t)matches.size() < config.max_target_seqs_.get(DEFAULT_MAX_TARGET_SEQS) && i0 < l.target_scores.cend() && new_hits_ev && (!config.mapany || (config.mapany && matches.empty())));
if (add_self_aln(cfg) && !any_of(matches.cbegin(), matches.cend(), [&query](const Match& m) { return m.target_block_id == query.block_id; }))
matches.push_back(Match::self_match(query.block_id, query.sequence[0]));
culling(matches, cfg);
return matches;
}
vector extend(BlockId query_id, Search::Hit* begin, Search::Hit* end, const Search::Config &cfg, Statistics &stat, DP::Flags flags, std::pmr::monotonic_buffer_resource& pool) {
const Query query(query_id, stat, cfg, pool);
TaskTimer timer(flag_any(flags, DP::Flags::PARALLEL) ? config.target_parallel_verbosity : UINT_MAX);
timer.go("Loading seed hits");
SeedHitList l = load_hits(begin, end, cfg.target->seqs());
stat.inc(Statistics::TARGET_HITS0, l.target_block_ids.size());
if (config.hamming_dist_boundary_check) {
filter_hamming_boundary_crossings(l, query.sequence.data(), query.sequence.front().length(), cfg.target->seqs(), cfg.hamming_filter_id);
stat.inc(Statistics::TARGET_HITS_HDF, l.target_block_ids.size());
}
stat.inc(Statistics::TIME_LOAD_HIT_TARGETS, timer.microseconds());
timer.finish();
const int64_t target_count = (int64_t)l.target_block_ids.size();
if (target_count == 0 && !config.swipe_all) {
if (cfg.extension_mode == Mode::NONE)
return vector();
if (add_self_aln(cfg)) {
vector r;
Match match = Match::self_match(query.block_id, query.sequence[0]);
r.push_back(std::move(match));
return r;
}
return vector();
}
const int64_t chunk_size = ranking_chunk_size(target_count, cfg.target->seqs().letters(), cfg.max_target_seqs);
if (chunk_size < target_count || config.global_ranking_targets > 0) {
timer.go("Sorting targets by score");
std::sort(l.target_scores.begin(), l.target_scores.end());
stat.inc(Statistics::TIME_SORT_TARGETS_BY_SCORE, timer.microseconds());
timer.finish();
if (config.global_ranking_targets > 0)
return GlobalRanking::ranking_list(query_id, l.target_scores.begin(), l.target_scores.end(), l.target_block_ids.begin(), l.seed_hits, cfg);
}
vector r = extend(query, cfg, stat, flags, l, pool);
return r;
}
}
bbuchfink-diamond-6dc5717/src/align/extend.h 0000664 0000000 0000000 00000006760 15234073120 0020747 0 ustar 00root root 0000000 0000000 /****
DIAMOND protein sequence aligner
Copyright (C) 2012-2026 Benjamin J. Buchfink
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
****/
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include
#include
#include
#include
#include "basic/match.h"
#include "basic/statistics.h"
#include "util/text_buffer.h"
#include "run/config.h"
#include "dp/flags.h"
#include "stats/cbs.h"
#include "stats/hauser_correction.h"
#include "basic/const.h"
#include "util/sequence/seqindex.h"
namespace Extension {
extern const std::map default_ext_mode;
struct Query {
Query(BlockId block_id, Statistics& stats, const Search::Config& cfg, std::pmr::monotonic_buffer_resource& pool);
const int8_t* composition_bias(int context) const {
return hauser_correction.empty() ? nullptr : hauser_correction[context].int8.data();
}
BlockId block_id;
std::vector sequence;
std::vector hauser_correction;
::Stats::Composition composition{};
const char* title;
int source_length;
int true_aa_length;
double self_alignment_score;
std::unique_ptr seqindex;
Score ungapped_cutoff;
};
struct Match {
Match(const BlockId target_block_id, const Sequence& seq, std::unique_ptr<::Stats::TargetMatrix>&& matrix, Score ungapped_score, Score filter_score = 0, double filter_evalue = DBL_MAX):
target_block_id(target_block_id),
seq(seq),
matrix(std::move(matrix)),
filter_score(filter_score),
filter_evalue(filter_evalue),
ungapped_score(ungapped_score)
{}
void add_hit(std::list &list, std::list::iterator it) {
hsp.splice(hsp.end(), list, it);
}
static bool cmp_evalue(const Match& m, const Match& n) {
return m.filter_evalue < n.filter_evalue || (m.filter_evalue == n.filter_evalue && cmp_score(m, n));
}
static bool cmp_score(const Match& m, const Match& n) {
return m.filter_score > n.filter_score || (m.filter_score == n.filter_score && m.target_block_id < n.target_block_id);
}
Match(BlockId target_block_id, const Sequence& seq, std::unique_ptr<::Stats::TargetMatrix>&& matrix, std::array, MAX_CONTEXT> &hsp, int ungapped_score);
static Match self_match(BlockId query_id, Sequence query_seq);
void inner_culling();
void max_hsp_culling();
void apply_filters(const Query& query, const Block& targets, const OutputFormat* output_format);
BlockId target_block_id;
Sequence seq;
std::unique_ptr<::Stats::TargetMatrix> matrix;
int filter_score;
double filter_evalue;
int ungapped_score;
std::list hsp;
};
std::vector extend(BlockId query_id, Search::Hit* begin, Search::Hit* end, const Search::Config &cfg, Statistics &stat, DP::Flags flags, std::pmr::monotonic_buffer_resource& pool);
TextBuffer* generate_output(std::vector &targets, BlockId query_block_id, Statistics &stat, const Search::Config& cfg);
TextBuffer* generate_intermediate_output(const std::vector &targets, BlockId query_block_id, const Search::Config& cfg);
}
bbuchfink-diamond-6dc5717/src/align/full_db.cpp 0000664 0000000 0000000 00000003700 15234073120 0021411 0 ustar 00root root 0000000 0000000 /****
DIAMOND protein sequence aligner
Copyright (C) 2012-2026 Benjamin J. Buchfink
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
****/
// SPDX-License-Identifier: GPL-3.0-or-later
#include