### Define installation rules Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/zstd/build/cmake/lib/CMakeLists.txt Specifies the installation paths for header files and library binaries. ```cmake INSTALL(FILES ${LIBRARY_DIR}/zstd.h ${LIBRARY_DIR}/deprecated/zbuff.h ${LIBRARY_DIR}/dictBuilder/zdict.h ${LIBRARY_DIR}/dictBuilder/cover.h ${LIBRARY_DIR}/common/zstd_errors.h DESTINATION "include") IF (ZSTD_BUILD_SHARED) INSTALL(TARGETS libzstd_shared RUNTIME DESTINATION "bin" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") ENDIF() IF (ZSTD_BUILD_STATIC) INSTALL(TARGETS libzstd_static ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") ENDIF (ZSTD_BUILD_STATIC) ``` -------------------------------- ### Build and Install Zstandard with Meson Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/zstd/build/meson/README.md Commands to initialize the build directory, compile the project, and install the resulting library. ```sh meson --buildtype=release -D with-contrib=true -D with-tests=true -D with-contrib=true builddir cd builddir ninja # to build ninja install # to install ``` -------------------------------- ### Example execution output Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/zstd/zlibWrapper/README.md Console output from running the example test file. ```text zlib version 1.2.8 = 0x1280, compile flags = 0x65 uncompress(): hello, hello! gzread(): hello, hello! gzgets() after gzseek: hello! inflate(): hello, hello! large_inflate(): OK after inflateSync(): hello, hello! inflate with dictionary: hello, hello! ``` ```text zlib version 1.2.8 = 0x1280, compile flags = 0x65 uncompress(): hello, hello! gzread(): hello, hello! gzgets() after gzseek: hello! inflate(): hello, hello! large_inflate(): OK inflate with dictionary: hello, hello! ``` -------------------------------- ### Install Python Script Source: https://github.com/steineggerlab/foldseek/blob/master/lib/prostt5/CMakeLists.txt Installs the 'convert_hf_to_gguf.py' script to the binary installation directory with specific file permissions. ```cmake install( FILES convert_hf_to_gguf.py PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION ${CMAKE_INSTALL_BINDIR}) ``` -------------------------------- ### Install Corrosion from Source Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/corrosion/doc/src/setup_corrosion.md Build and install Corrosion manually using CMake commands. ```bash git clone https://github.com/corrosion-rs/corrosion.git # Optionally, specify -DCMAKE_INSTALL_PREFIX= to specify a # custom installation directory cmake -Scorrosion -Bbuild -DCMAKE_BUILD_TYPE=Release cmake --build build --config Release # This next step may require sudo or admin privileges if you're installing to a system location, # which is the default. cmake --install build --config Release ``` -------------------------------- ### Install and Use zstd-adaptive Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/zstd/contrib/adaptive-compression/README.md Build the adapt tool using make. Install it to use 'zstd-adaptive' as a command-line utility. It supports file inputs or standard I/O. ```bash make adapt ``` ```bash make install ``` ```bash zstd-adaptive [options] [file(s)] ``` -------------------------------- ### Install Corrosion via Homebrew Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/corrosion/doc/src/setup_corrosion.md Install the community-maintained Corrosion package using Homebrew. ```bash brew install corrosion ``` -------------------------------- ### Install to Staging Directory Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/zstd/build/meson/README.md Use the DESTDIR environment variable to install the build artifacts into a specific staging directory. ```sh DESTDIR=./staging ninja install ``` -------------------------------- ### Setup main executable Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/src/CMakeLists.txt Defines the main mmseqs executable and includes testing subdirectories if enabled. ```cmake if (NOT FRAMEWORK_ONLY) include(MMseqsSetupDerivedTarget) add_subdirectory(version) set(mmseqs_source_files mmseqs.cpp) add_executable(mmseqs${EXE_SUFFIX} ${mmseqs_source_files}) mmseqs_setup_derived_target(mmseqs${EXE_SUFFIX}) target_link_libraries(mmseqs${EXE_SUFFIX} version) install(TARGETS mmseqs${EXE_SUFFIX} DESTINATION bin) if (HAVE_TESTS) add_subdirectory(test) endif () endif () ``` -------------------------------- ### Install MMseqs2 with Homebrew Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/README.md Use Homebrew to install MMseqs2 on macOS systems. ```bash brew install mmseqs2 ``` -------------------------------- ### Install Google Cloud C++ Client Library via vcpkg Source: https://github.com/steineggerlab/foldseek/wiki/Home Clones the vcpkg repository, bootstraps it, and installs the google-cloud-cpp package, which is required for enabling Google Cloud Storage support in Foldseek. ```bash git clone https://github.com/microsoft/vcpkg.git ./vcpkg/bootstrap-vcpkg.sh ./vcpkg/vcpkg install google-cloud-cpp ``` -------------------------------- ### Global Alignment with SSE Intrinsics Example Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/ksw2/README.md Demonstrates how to perform a global alignment using the ksw_extz function with SSE intrinsics. It includes sequence encoding, scoring matrix setup, and CIGAR string generation. Ensure sequences are encoded to integers before calling. ```c #include #include #include "ksw2.h" void align(const char *tseq, const char *qseq, int sc_mch, int sc_mis, int gapo, int gape) { int i, a = sc_mch, b = sc_mis < 0? sc_mis : -sc_mis; // a>0 and b<0 int8_t mat[25] = { a,b,b,b,0, b,a,b,b,0, b,b,a,b,0, b,b,b,a,0, 0,0,0,0,0 }; int tl = strlen(tseq), ql = strlen(qseq); uint8_t *ts, *qs, c[256]; ksw_extz_t ez; memset(&ez, 0, sizeof(ksw_extz_t)); memset(c, 4, 256); c['A'] = c['a'] = 0; c['C'] = c['c'] = 1; c['G'] = c['g'] = 2; c['T'] = c['t'] = 3; // build the encoding table ts = (uint8_t*)malloc(tl); qs = (uint8_t*)malloc(ql); for (i = 0; i < tl; ++i) ts[i] = c[(uint8_t)tseq[i]]; // encode to 0/1/2/3 for (i = 0; i < ql; ++i) qs[i] = c[(uint8_t)qseq[i]]; ksw_extz(0, ql, qs, tl, ts, 5, mat, gapo, gape, -1, -1, 0, &ez); for (i = 0; i < ez.n_cigar; ++i) // print CIGAR printf("%d%c", ez.cigar[i]>>4, "MID"[ez.cigar[i]&0xf]); putchar('\n'); free(ez.cigar); free(ts); free(qs); } int main(int argc, char *argv[]) { align("ATAGCTAGCTAGCAT", "AGCTAcCGCAT", 1, -2, 2, 1); return 0; } ``` -------------------------------- ### Print Hello World to stdout Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/fmt/README.md Basic example of printing a string to standard output using fmt::print. ```c++ #include int main() { fmt::print("Hello, world!\n"); } ``` -------------------------------- ### Install Rust Target Standard Library Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/corrosion/doc/src/usage.md When cross-compiling, install the standard library for the target Rust triple using rustup. ```bash rustup target add ``` -------------------------------- ### PZstandard Piping Example Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/zstd/contrib/pzstd/README.md Shows how to use PZstandard with standard input/output streams, useful for piping data through compression/decompression. ```bash cat input-file | pzstd -p num-threads -# -c > /dev/null ``` -------------------------------- ### Installing Foldcomp Source: https://github.com/steineggerlab/foldseek/blob/master/lib/foldcomp/README.md Commands to install the Python package or download static binaries for various operating systems. ```bash # Install Foldcomp Python package pip install foldcomp # Download static binaries for Linux wget https://mmseqs.com/foldcomp/foldcomp-linux-x86_64.tar.gz # Download static binaries for Linux (ARM64) wget https://mmseqs.com/foldcomp/foldcomp-linux-arm64.tar.gz # Download binary for macOS wget https://mmseqs.com/foldcomp/foldcomp-macos-universal.tar.gz # Download binary for Windows (x64) wget https://mmseqs.com/foldcomp/foldcomp-windows-x64.zip ``` -------------------------------- ### Install cross-compiler for PowerPC on Linux Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/corrosion/doc/src/usage.md On Ubuntu, install the g++-powerpc64le-linux-gnu package using apt-get to enable cross-compilation for 64-bit Little-Endian PowerPC. ```bash sudo apt install g++-powerpc64le-linux-gnu ``` -------------------------------- ### Install Foldseek via Command Line Source: https://github.com/steineggerlab/foldseek/blob/master/README.md Commands to download and install precompiled binaries for different operating systems or use the Conda package manager. ```bash wget https://mmseqs.com/foldseek/foldseek-linux-avx2.tar.gz; tar xvzf foldseek-linux-avx2.tar.gz; export PATH=$(pwd)/foldseek/bin/:$PATH ``` ```bash wget https://mmseqs.com/foldseek/foldseek-linux-arm64.tar.gz; tar xvzf foldseek-linux-arm64.tar.gz; export PATH=$(pwd)/foldseek/bin/:$PATH ``` ```bash wget https://mmseqs.com/foldseek/foldseek-linux-gpu.tar.gz; tar xvfz foldseek-linux-gpu.tar.gz; export PATH=$(pwd)/foldseek/bin/:$PATH ``` ```bash wget https://mmseqs.com/foldseek/foldseek-osx-universal.tar.gz; tar xvzf foldseek-osx-universal.tar.gz; export PATH=$(pwd)/foldseek/bin/:$PATH ``` ```bash conda install -c conda-forge -c bioconda foldseek ``` -------------------------------- ### FoldSeek Multimercluster Command Example Source: https://github.com/steineggerlab/foldseek/blob/master/README.md Example command for running the easy-multimercluster module with specified thresholds. ```APIDOC ## Running Multimercluster ### Description This command demonstrates how to use the `easy-multimercluster` module for multimer-level structural clustering. It specifies input files, output directories, and various alignment thresholds. ### Command ```bash foldseek easy-multimercluster example/ clu tmp --multimer-tm-threshold 0.65 --chain-tm-threshold 0.5 --interface-lddt-threshold 0.65 ``` ### Parameters - **`example/`**: Path to the input directory containing PDB/mmCIF files. - **`clu`**: Output directory for cluster files. - **`tmp`**: Temporary directory for intermediate files. - **`--multimer-tm-threshold`** (float) - Alignment - Accept alignments with multimer alignment TMscore > thr (default: 0.65). - **`--chain-tm-threshold`** (float) - Alignment - Accept alignments if every single chain TMscore > thr (default: 0.5). - **`--interface-lddt-threshold`** (float) - Alignment - Accept alignments with an interface LDDT score > thr (default: 0.65). ``` -------------------------------- ### Foldcomp Database Setup Commands Source: https://github.com/steineggerlab/foldseek/blob/master/lib/foldcomp/README.md Individual commands to set up various prebuilt protein structure databases. ```python foldcomp.setup('esmatlas') ``` ```python foldcomp.setup('esmatlas_v2023_02') ``` ```python foldcomp.setup('highquality_clust30') ``` ```python foldcomp.setup('afdb_uniprot_v4') ``` ```python foldcomp.setup('afdb_swissprot_v4') ``` ```python foldcomp.setup('h_sapiens') ``` ```python foldcomp.setup('afdb_rep_v4') ``` ```python foldcomp.setup('afdb_rep_dark_v4') ``` -------------------------------- ### Install Foldseek via pre-compiled binaries Source: https://github.com/steineggerlab/foldseek/wiki/Home Download and extract the appropriate static binary for your operating system and architecture. ```bash wget https://mmseqs.com/foldseek/foldseek-linux-avx2.tar.gz tar xvzf foldseek-linux-avx2.tar.gz export PATH=$(pwd)/foldseek/bin/:$PATH ``` ```bash wget https://mmseqs.com/foldseek/foldseek-linux-sse41.tar.gz tar xvzf foldseek-linux-sse41.tar.gz export PATH=$(pwd)/foldseek/bin/:$PATH ``` ```bash wget https://mmseqs.com/foldseek/foldseek-linux-gpu.tar.gz tar xvzf foldseek-linux-gpu.tar.gz export PATH=$(pwd)/foldseek/bin/:$PATH ``` ```bash wget https://mmseqs.com/foldseek/foldseek-osx-universal.tar.gz tar xvzf foldseek-osx-universal.tar.gz export PATH=$(pwd)/foldseek/bin/:$PATH ``` -------------------------------- ### te_interp usage examples Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/tinyexpr/README.md Demonstrates immediate evaluation with and without error tracking. ```C int error; double a = te_interp("(5+5)", 0); /* Returns 10. */ double b = te_interp("(5+5)", &error); /* Returns 10, error is set to 0. */ double c = te_interp("(5+5", &error); /* Returns NaN, error is set to 4. */ ``` -------------------------------- ### Evaluate expression at runtime Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/tinyexpr/README.md A minimal example demonstrating how to evaluate a simple math expression using te_interp. ```C #include "tinyexpr.h" printf("%f\n", te_interp("5*5", 0)); /* Prints 25. */ ``` -------------------------------- ### Generate pkg-config file Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/zstd/build/cmake/lib/CMakeLists.txt Creates and installs a pkg-config file for Unix-based systems to facilitate library discovery. ```cmake IF (UNIX) # pkg-config SET(PREFIX "${CMAKE_INSTALL_PREFIX}") SET(LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") SET(INCLUDEDIR "${CMAKE_INSTALL_PREFIX}/include") SET(VERSION "${LIBVER_MAJOR}.${LIBVER_MINOR}.${LIBVER_RELEASE}") ADD_CUSTOM_TARGET(libzstd.pc ALL ${CMAKE_COMMAND} -DIN="${LIBRARY_DIR}/libzstd.pc.in" -DOUT="libzstd.pc" -DPREFIX="${PREFIX}" -DLIBDIR="${LIBDIR}" -DINCLUDEDIR="${INCLUDEDIR}" -DVERSION="${VERSION}" -P "${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig.cmake" COMMENT "Creating pkg-config file") INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/libzstd.pc" DESTINATION "${LIBDIR}/pkgconfig") ENDIF (UNIX) ``` -------------------------------- ### All Member Fasta Output Source: https://github.com/steineggerlab/foldseek/blob/master/README.md Example of the all-member FASTA file format including cluster markers. ```fasta >Q0KJ32 >Q0KJ32 MAGA....R >C0W539 MVGA....R >D6KVP9 MVGA....R >E3HQM9 >E3HQM9 MCAT...Q >Q223C0 MCAR...Q ``` -------------------------------- ### Execute Block Image Generation Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/block-aligner/vis/block_aligner_accuracy_vis.ipynb Runs the Rust block_img example to generate visualization images from input files. ```python !cd .. && cargo run --example block_img --release --features simd_avx2 --quiet -- vis/block_img1.png vis/block_img2.png ``` ```text Output: path: vis/block_img1.png, img size: 660 x 549 path: vis/block_img2.png, img size: 384 x 428 ``` -------------------------------- ### Configure Pkgconfig File Source: https://github.com/steineggerlab/foldseek/blob/master/lib/prostt5/CMakeLists.txt Configures the 'llama.pc' file for pkgconfig, ensuring it is generated with the correct template and installed to the pkgconfig directory. ```cmake configure_file(cmake/llama.pc.in "${CMAKE_CURRENT_BINARY_DIR}/llama.pc" @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/llama.pc" DESTINATION lib/pkgconfig) ``` -------------------------------- ### Define Corrosion Installation Tests Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/corrosion/test/CMakeLists.txt Configures CMake tests to verify the installation of Corrosion, including setup and cleanup fixtures. ```cmake option(CORROSION_TESTS_INSTALL_CORROSION "Install Corrosion to a test directory and let tests use the installed Corrosion" OFF) if(CORROSION_TESTS_INSTALL_CORROSION) add_test(NAME "install_corrosion_configure" COMMAND ${CMAKE_COMMAND} -S "${CMAKE_CURRENT_SOURCE_DIR}/.." -B "${CMAKE_CURRENT_BINARY_DIR}/build-corrosion" -DCORROSION_VERBOSE_OUTPUT=ON -DCORROSION_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -G${CMAKE_GENERATOR} "-DCMAKE_INSTALL_PREFIX=${test_install_path}" ) add_test(NAME "install_corrosion_build" COMMAND ${CMAKE_COMMAND} --build "${CMAKE_CURRENT_BINARY_DIR}/build-corrosion" --config Release ) add_test(NAME "install_corrosion_install" COMMAND ${CMAKE_COMMAND} --install "${CMAKE_CURRENT_BINARY_DIR}/build-corrosion" --config Release ) set_tests_properties("install_corrosion_configure" PROPERTIES FIXTURES_SETUP "fixture_corrosion_configure") set_tests_properties("install_corrosion_build" PROPERTIES FIXTURES_SETUP "fixture_corrosion_build") set_tests_properties("install_corrosion_build" PROPERTIES FIXTURES_REQUIRED "fixture_corrosion_configure") set_tests_properties("install_corrosion_install" PROPERTIES FIXTURES_REQUIRED "fixture_corrosion_build") set_tests_properties("install_corrosion_install" PROPERTIES FIXTURES_SETUP "fixture_corrosion_install") add_test(NAME "install_corrosion_build_cleanup" COMMAND "${CMAKE_COMMAND}" -E remove_directory "${CMAKE_CURRENT_BINARY_DIR}/build-corrosion") set_tests_properties("install_corrosion_build_cleanup" PROPERTIES FIXTURES_CLEANUP "fixture_corrosion_configure;fixture_corrosion_build" ) add_test(NAME "install_corrosion_cleanup" COMMAND "${CMAKE_COMMAND}" -E remove_directory "${test_install_path}") set_tests_properties("install_corrosion_cleanup" PROPERTIES FIXTURES_CLEANUP "fixture_corrosion_configure;fixture_corrosion_build;fixture_corrosion_install" ) endif() ``` -------------------------------- ### Initialize UI Elements Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/data/resources/krona_prelude.html Sets up the main options container, details panel, and dataset selection controls. ```javascript function addOptionElements(hueName, hueDefault) { options = document.createElement('div'); options.style.position = 'absolute'; options.style.top = '0px'; options.addEventListener('mousedown', function(e) {mouseClick(e)}, false); // options.onmouseup = function(e) {mouseUp(e)} document.body.appendChild(options); document.body.style.font = '11px sans-serif'; var position = 5; details = document.createElement('div'); details.style.position = 'absolute'; details.style.top = '1%'; details.style.right = '2%'; details.style.textAlign = 'right'; document.body.insertBefore(details, canvas); //
details.innerHTML = '\  \
\
'; keyControl = document.createElement('input'); keyControl.type = 'button'; keyControl.value = showKeys ? 'x' : '…'; keyControl.style.position = ''; keyControl.style.position = 'fixed'; keyControl.style.visibility = 'hidden'; document.body.insertBefore(keyControl, canvas); var logoElement = document.getElementById('logo'); if ( logoElement ) { logoImage = logoElement.src; } else { logoImage = 'http://marbl.github.io/Krona/img/logo-med.png'; } // document.getElementById('options').style.fontSize = '9pt'; position = addOptionElement ( position, 'Logo of Krona\ \  Search: \ \ ' ); if ( datasets > 1 ) { var size = datasets < datasetSelectSize ? datasets : datasetSelectSize; var select = '' + '
' + '' + '' + '
'; position = addOptionElement(position + 5, select); datasetDropDown = document.getElementById('datasets'); datasetButtonLast = document.getElementById('lastDataset'); datasetButtonPrev = document.getElementById('prevDataset'); datasetButtonNext = document.getElementById('nextDataset'); position += datasetDropDown.clientHeight; } position = addOptionElement ( position + 5, '\ \   Max depth', 'Maximum depth to display, counted from the top level \ and including collapsed wedges.' ); position = addOptionElement ( position, '\ \   Font size' ); position = addOptionElement ( position, '\ Chart size' ); if ( hueName ) { hueDisplayName = attributes[attri ``` -------------------------------- ### Install Foldseek via Conda Source: https://github.com/steineggerlab/foldseek/blob/master/README.md Install Foldseek using the bioconda channel. This command installs the Foldseek package. ```bash conda install -c bioconda foldseek ``` -------------------------------- ### CMake Project Setup Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/corrosion/test/multitarget/multitarget/CMakeLists.txt Initializes the CMake build system for the project, specifying the minimum version and project details. Includes a common test header. ```cmake cmake_minimum_required(VERSION 3.15) project(test_project VERSION 0.1.0) include(../../test_header.cmake) ``` -------------------------------- ### Install MMseqs2 with Conda Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/README.md Install MMseqs2 using Conda from the conda-forge and bioconda channels. ```bash conda install -c conda-forge -c bioconda mmseqs2 ``` -------------------------------- ### Install Foldseek via Bioconda Source: https://github.com/steineggerlab/foldseek/wiki/Home Install the package using the conda package manager. ```bash conda install -c conda-forge -c bioconda foldseek ``` -------------------------------- ### Build All Configurations with VS2015 Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/zstd/build/VS_scripts/README.md Run this command to build both Release Win32 and Release x64 versions using Visual Studio 2015. ```batch build.VS2015.cmd ``` -------------------------------- ### Build All Configurations with VS2013 Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/zstd/build/VS_scripts/README.md Run this command to build both Release Win32 and Release x64 versions using Visual Studio 2013. ```batch build.VS2013.cmd ``` -------------------------------- ### Find Installed Corrosion Package Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/corrosion/doc/src/setup_corrosion.md Locate the installed Corrosion package within a CMake project. ```cmake find_package(Corrosion REQUIRED) ``` -------------------------------- ### Run Test Suite Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/zstd/contrib/experimental_dict_builders/randomDictBuilder/README.md Execute the project test suite using the make utility. ```bash make test ``` -------------------------------- ### Initialize Environment and Data Transformers Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/block-aligner/vis/block_aligner_bench_vis.ipynb Imports necessary libraries and enables the Altair data server for efficient data handling. ```python import altair as alt from altair_saver import save from altair import datum import pandas as pd from io import StringIO alt.data_transformers.enable("data_server") ``` ```text Result: DataTransformerRegistry.enable('data_server') ``` -------------------------------- ### Clone and Build Benchmarks Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/fmt/README.md Commands to clone the benchmark repository and prepare the build environment using CMake. ```bash $ git clone --recursive https://github.com/fmtlib/format-benchmark.git $ cd format-benchmark $ cmake . ``` -------------------------------- ### Example Multimer Search Output Source: https://github.com/steineggerlab/foldseek/blob/master/README.md This is an example of the default tab-separated output from easy-multimersearch, showing alignment details for different chains of the complexes. ```text 1tim.pdb.gz_A 8tim.pdb.gz_A 0.967 247 8 0 1 247 1 247 5.412E-43 1527 0 1tim.pdb.gz_B 8tim.pdb.gz_B 0.967 247 8 0 1 247 1 247 1.050E-43 1551 0 ``` -------------------------------- ### Install GCC Dependencies for Foldseek on macOS Source: https://github.com/steineggerlab/foldseek/wiki/Home Installs GCC version 11 and other required libraries using Homebrew for compiling Foldseek with GCC on macOS. ```bash brew install cmake gcc@11 zlib bzip2 ``` -------------------------------- ### PZstandard Basic Usage Examples Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/zstd/contrib/pzstd/README.md Demonstrates the fundamental compression and decompression commands for PZstandard. Use the -p option to specify the number of threads. ```bash pzstd input-file -o output-file -p num-threads -# # Compression ``` ```bash pzstd -d input-file -o output-file -p num-threads # Decompression ``` -------------------------------- ### Initialize Visualization Settings Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/data/resources/krona_prelude.html Sets up initial visualization parameters based on parsed URL options and default values. Configures callbacks, sorts the head, selects the initial dataset and node, and sets up interval updates and resize handling. ```javascript addOptionElements(hueName, hueDefault); setCallBacks(); head.sort(); maxAbsoluteDepth = 0; selectDataset(datasetDefault); if ( maxDepthDefault && maxDepthDefault < head.maxDepth ) { maxAbsoluteDepth = maxDepthDefault; } else { maxAbsoluteDepth = head.maxDepth; } selectNode(nodes[nodeDefault]); setInterval(update, 20); window.onresize = handleResize; updateMaxAbsoluteDepth(); updateViewNeeded = true; ``` -------------------------------- ### Create Database with Chain Naming Source: https://context7.com/steineggerlab/foldseek/llms.txt Initializes a structural database with specific chain naming conventions. ```bash foldseek createdb structures/ targetDB --chain-name-mode 1 ``` -------------------------------- ### Install Dependencies for Foldseek on macOS Source: https://github.com/steineggerlab/foldseek/wiki/Home Installs necessary build tools and libraries like CMake, libomp, zlib, and bzip2 using Homebrew for compiling Foldseek on macOS. ```bash brew install cmake libomp zlib bzip2 ``` -------------------------------- ### Run Nanopore Accuracy Example Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/block-aligner/vis/block_aligner_accuracy_vis.ipynb Executes the nanopore_accuracy example using Cargo, enabling AVX2 features for performance. This command is used to generate alignment accuracy data. ```python output = !cd .. && cargo run --example nanopore_accuracy --release --features simd_avx2 --quiet output ``` -------------------------------- ### Construct Database with makedb Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/libmarv/Readme.md Create a database from a FASTA file using the makedb tool. Supports gzipped input files and large numbers of sequences. ```bash mkdir -p dbfolder ./makedb input.fa(.gz) dbfolder/dbname [options] ``` -------------------------------- ### Set ROCm Path in CMake Source: https://github.com/steineggerlab/foldseek/blob/master/lib/prostt5/ggml/src/ggml-hip/CMakeLists.txt Configures the ROCm installation path by checking the ROCM_PATH environment variable or common installation directories. Appends the path to CMAKE_PREFIX_PATH for CMake to find ROCm components. ```cmake if (NOT EXISTS $ENV{ROCM_PATH}) if (NOT EXISTS /opt/rocm) set(ROCM_PATH /usr) else() set(ROCM_PATH /opt/rocm) endif() else() set(ROCM_PATH $ENV{ROCM_PATH}) endif() list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}) list(APPEND CMAKE_PREFIX_PATH "${ROCM_PATH}/lib64/cmake") ``` -------------------------------- ### Pad Database for GPU Search Source: https://github.com/steineggerlab/foldseek/blob/master/README.md Prepares a database with padding for efficient GPU-based searching. ```bash # Prepare the database for GPU search foldseek makepaddedseqdb db db_pad # Perform GPU search foldseek search db db_pad result_dir --gpu 1 ``` -------------------------------- ### Create and Index Custom Databases Source: https://github.com/steineggerlab/foldseek/blob/master/README.md Pre-processes structural files into a database format and optionally creates an on-disk index for faster searching. ```bash foldseek createdb example/ targetDB foldseek createindex targetDB tmp #OPTIONAL generates and stores the index on disk foldseek easy-search example/d1asha_ targetDB aln.m8 tmpFolder ``` -------------------------------- ### Run Uniclust Accuracy Example Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/block-aligner/vis/block_aligner_accuracy_vis.ipynb Executes the `uc_accuracy` example from the Foldseek Cargo project with AVX2 SIMD features enabled and quiet output. This command is used to generate the raw accuracy data. ```bash output = !cd .. && cargo run --example uc_accuracy --release --features simd_avx2 --quiet output ``` -------------------------------- ### Compile Foldseek on Linux with GPU Support Source: https://github.com/steineggerlab/foldseek/wiki/Home Installs CUDA dependencies via Conda, compiles Foldseek with GPU support, and sets up the environment variables. Use -DCMAKE_CUDA_ARCHITECTURES="native" to compile for installed GPUs only. ```bash conda create -n nvcc -c conda-forge cuda-nvcc cuda-cudart-dev libcublas-dev libcublas-static cuda-version=12.6 cmake conda activate nvcc mkdir build && cd build cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX=. -DENABLE_CUDA=1 -DCMAKE_CUDA_ARCHITECTURES="75;80;86;89;90" .. make -j8 make install export PATH=$(pwd)/bin/:$PATH ``` -------------------------------- ### Create Database with Pre-built Index Source: https://context7.com/steineggerlab/foldseek/llms.txt Create a Foldseek database from structure files and then build a pre-built index for faster repeated searches. Specify the input folder, database name, and temporary directory for the index. ```bash foldseek createdb structures/ targetDB foldseek createindex targetDB tmp/ ``` -------------------------------- ### Configure MacOS Shared Library Install Name Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/corrosion/doc/src/common_issues.md Use these CMake commands to set the install name, current version, and compatibility version for a shared library on MacOS. Ensure the library name follows the `lib.dylib` convention. ```cmake corrosion_add_target_local_rustflags(your_crate -Clink-arg=-Wl,-install_name,@rpath/libyour_crate.dylib,-current_version,${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR},-compatibility_version,${PROJECT_VERSION_MAJOR}.0) set_target_properties(your_crate-shared PROPERTIES IMPORTED_NO_SONAME 0) set_target_properties(your_crate-shared PROPERTIES IMPORTED_SONAME libyour_crate.dylib) ``` -------------------------------- ### Reusing Compression Contexts with zlibWrapper Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/zstd/zlibWrapper/README.md Demonstrates the steps for reusing a single compression context to improve performance. Initialize with deflateInit, use deflate for the first file, deflateReset then deflate for the second file, and finally free with deflateEnd. ```text - initialize the context with `deflateInit` - for the 1st file call `deflate`, `...`, `deflate` - for the 2nd file call `deflateReset`, `deflate`, `...`, `deflate` - free the context with `deflateEnd` ``` -------------------------------- ### ZSTD_initCStream Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/zstd/doc/zstd_manual.html Initializes a ZSTD_CStream context to start a new compression operation. ```APIDOC ## ZSTD_initCStream ### Description Initializes a ZSTD_CStream context to start a new compression operation. Variants include ZSTD_initCStream_usingDict and ZSTD_initCStream_usingCDict for dictionary-based compression. ### Method Function Call ``` -------------------------------- ### Train Zstandard Dictionary with Fastcover Algorithm Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/zstd/programs/zstd.1.md Use the fastcover dictionary builder algorithm with specified parameters. Requires 0 < f < 32 and 0 < accel <= 10. d must be 6 or 8. Split defaults to 75, f to 20, and accel to 1 if not specified. ```bash zstd --train-fastcover FILEs ``` ```bash zstd --train-fastcover=d=8,f=15,accel=2 FILEs ``` -------------------------------- ### Representative Fasta Output Source: https://github.com/steineggerlab/foldseek/blob/master/README.md Example of the representative sequence FASTA file format. ```fasta >Q0KJ32 MAGA....R >E3HQM9 MCAT...Q ``` -------------------------------- ### Create Database from FASTA using ProstT5 Source: https://context7.com/steineggerlab/foldseek/llms.txt Create a Foldseek database from FASTA sequences using the ProstT5 model. Ensure ProstT5 model weights are downloaded first. Specify the input FASTA file, database name, and the path to the model weights. ```bash foldseek databases ProstT5 weights tmp/ foldseek createdb sequences.fasta seqDB --prostt5-model weights ``` -------------------------------- ### Create ProstT5 Database Source: https://github.com/steineggerlab/foldseek/blob/master/README.md Initializes a structural database from FASTA files using the ProstT5 model. ```bash foldseek databases ProstT5 weights tmp foldseek createdb db.fasta db --prostt5-model weights ``` -------------------------------- ### Create and Index Database Source: https://context7.com/steineggerlab/foldseek/llms.txt Creates a database and generates an index, optionally excluding Cα coordinates to reduce memory usage. ```bash foldseek createdb structures/ targetDB foldseek createindex targetDB tmp/ --index-exclude 2 ``` -------------------------------- ### GET ZSTD_getDictID_fromFrame Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/zstd/doc/zstd_manual.html Retrieves the dictionary ID required to decompress a Zstandard frame. ```APIDOC ## GET ZSTD_getDictID_fromFrame ### Description Provides the dictID required to decompress the frame stored within `src`. ### Method C Function ### Parameters #### Path Parameters - **src** (const void*) - Required - Pointer to the source frame data. - **srcSize** (size_t) - Required - Size of the source data. ### Response #### Success Response - **return** (unsigned) - The dictID of the frame. Returns 0 if the dictID could not be decoded. ``` -------------------------------- ### Test the Docker container Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/zstd/contrib/docker/README.md Verifies the installation by piping input through the zstd container and decompressing it. ```bash echo foo | docker run -i --rm zstd | docker run -i --rm zstd zstdcat foo ``` -------------------------------- ### Example Output for Complex Report Source: https://github.com/steineggerlab/foldseek/blob/master/README.md Sample output line from the easy-multimersearch report file. ```text 1tim.pdb.gz 8tim.pdb.gz A,B A,B 0.98941 0.98941 0.999983,0.000332,0.005813,-0.000373,0.999976,0.006884,-0.005811,-0.006886,0.999959 0.298992,0.060047,0.565875 0 ``` -------------------------------- ### Evaluate Command-Line Expressions with Error Checking Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/tinyexpr/README.md This example demonstrates compiling and evaluating an expression from the command line, including variable binding and error handling. Ensure the expression is passed as a command-line argument. ```C #include "tinyexpr.h" #include int main(int argc, char *argv[]) { if (argc < 2) { printf("Usage: example2 \"expression\"\n"); return 0; } const char *expression = argv[1]; printf("Evaluating:\n\t%s\n", expression); /* This shows an example where the variables * x and y are bound at eval-time. */ double x, y; te_variable vars[] = {{"x", &x}, {"y", &y}}; /* This will compile the expression and check for errors. */ int err; te_expr *n = te_compile(expression, vars, 2, &err); if (n) { /* The variables can be changed here, and eval can be called as many * times as you like. This is fairly efficient because the parsing has * already been done. */ x = 3; y = 4; const double r = te_eval(n); printf("Result:\n\t%f\n", r); te_free(n); } else { /* Show the user where the error is at. */ printf("\t%*s^\nError near here", err-1, ""); } return 0; } ``` -------------------------------- ### Tab-Separated Cluster Output Source: https://github.com/steineggerlab/foldseek/blob/master/README.md Example of the tab-separated output format mapping representatives to members. ```text Q0KJ32 Q0KJ32 Q0KJ32 C0W539 Q0KJ32 D6KVP9 E3HQM9 E3HQM9 E3HQM9 F0YHT8 ``` -------------------------------- ### Initialize Krona Visualization Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/data/resources/krona_prelude.html Initializes the Krona visualization, setting up the canvas, handling browser compatibility, and parsing configuration from the 'krona' element. ```javascript function load() { document.body.style.overflow = "hidden"; document.body.style.margin = 0; createCanvas(); if ( context == undefined ) { document.body.innerHTML = '\
This browser does not support HTML5 (see \ Browser support).\ '; return; } if ( typeof context.fillText != 'function' ) { document.body.innerHTML = '\
This browser does not support HTML5 canvas text (see \ Browser support).\ '; return; } resize(); var kronaElement = document.getElementsByTagName('krona')[0]; var magnitudeName; var hueName; var hueDefault; var hueStart; var hueEnd; var valueStart; var valueEnd; if ( kronaElement.getAttribute('collapse') != undefined ) { collapse = kronaElement.getAttribute('collapse') == 'true'; } if ( kronaElement.getAttribute('key') != undefined ) { showKeys = kronaElement.getAttribute('key') == 'true'; } for ( var element = getFirstChild(kronaElement); element; element = getNextSibling(element) ) { switch ( element.tagName.toLowerCase() ) { case 'attributes': magnitudeName = element.getAttribute('magnitude'); // for ( var attributeElement = getFirstChild(element); attributeElement; attributeElement = getNextSibling(attributeElement) ) { var tag = attributeElement.tagName.toLowerCase(); if ( tag == 'attribute' ) { var attribute = new Attribute(); attribute.name = attributeElement.firstChild.nodeValue.toLowerCase(); attribute.displayName = attributeElement.getAttribute('display'); if ( attributeElement.getAttribute('hrefBase') ) { attribute.hrefBase = attributeElement.getAttribute('hrefBase'); } if ( attributeElement.getAttribute('target') ) { attribute.target = attributeElement.getAttribute('target'); } if ( attribute.name == magnitudeName ) { magnitudeIndex = attributes.length; } if ( attributeElement.getAttribute('listAll') ) { attribute.listAll = attributeElement.getAttribute('listAll').toLowerCase(); } else if ( attributeElement.getAttribute('listNode') ) { attribute.listNode = attributeElement.getAttribute('listNode').toLowerCase(); } else if ( attributeElement.getAttribute('dataAll') ) { attribute.dataAll = attributeElement.getAttribute('dataAll').toLowerCase(); } else if ( attributeElement.getAttribute('dataNode') ) { attribute.dataNode = attribut ``` -------------------------------- ### Tween Animation Class Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/data/resources/krona_prelude.html Manages interpolation between start and end values for animation frames. ```javascript function Tween(start, end) { this.start = start; this.end = end; this.current = this.start; this.current = function() { if ( progress == 1 || this.start == this.end ) { return this.end; } else { return this.start + tweenFactor * (this.end - this.start); } }; this.setTarget = function(target) { this.start = this.current(); this.end = target; } } ``` -------------------------------- ### Representative Multimer Fasta Output Source: https://github.com/steineggerlab/foldseek/blob/master/README.md Example content of the _rep_seq.fasta file containing representative sequences. ```fasta #5o002 >5o002_A SHGK...R >5o002_B SHGK...R #194l2 >194l2_A0 KVFG...L >194l2_A6 KVFG...L #10mh121 ... ``` -------------------------------- ### Initialize Zstandard Streaming Compression Source: https://github.com/steineggerlab/foldseek/blob/master/lib/mmseqs/lib/zstd/doc/zstd_manual.html Functions to begin a streaming compression session with various configuration options. ```C size_t ZSTD_compressBegin(ZSTD_CCtx* cctx, int compressionLevel); size_t ZSTD_compressBegin_usingDict(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, int compressionLevel); size_t ZSTD_compressBegin_advanced(ZSTD_CCtx* cctx, const void* dict, size_t dictSize, ZSTD_parameters params, unsigned long long pledgedSrcSize); /**< pledgedSrcSize : If srcSize is not known at init time, use ZSTD_CONTENTSIZE_UNKNOWN */ size_t ZSTD_compressBegin_usingCDict(ZSTD_CCtx* cctx, const ZSTD_CDict* cdict); /**< note: fails if cdict==NULL */ size_t ZSTD_compressBegin_usingCDict_advanced(ZSTD_CCtx* const cctx, const ZSTD_CDict* const cdict, ZSTD_frameParameters const fParams, unsigned long long const pledgedSrcSize); /* compression parameters are already set within cdict. pledgedSrcSize must be correct. If srcSize is not known, use macro ZSTD_CONTENTSIZE_UNKNOWN */ size_t ZSTD_copyCCtx(ZSTD_CCtx* cctx, const ZSTD_CCtx* preparedCCtx, unsigned long long pledgedSrcSize); /**< note: if pledgedSrcSize is not known, use ZSTD_CONTENTSIZE_UNKNOWN */ ```