How daehwankimlab/hisat2 works
Project type and purpose
• Project type: A high-performance, command-line bioinformatics tool written in C++ (with some Python, Perl, Java JNI, and website assets).
• Purpose: Build and query a Hierarchical Graph FM index (HGFM) of a reference genome (hisat2-build), then align sequencing reads (hisat2, hisat2-inspect, hisat2_repeat, etc.) against that index, producing SAM/BAM output. It also offers library bindings (Python, Java) and numerous utility scripts and evaluation pipelines.
File structure
Top-level directories:
• Core C++ sources and headers: aligner_*.cpp/.h, *.cpp/.h (e.g., bit_packed_array, sse_util, dp_framer, etc.), hisat2*.cpp, hisat2lib/, third_party/, threading, etc.
• Build & config: Makefile, CMakeLists.txt, msvcc/ Visual Studio projects.
• Scripts: scripts/ (Perl, shell), evaluation/ (Python-driven test suites), extract_*.py, hisat2_extract_*.py.
• Documentation & website: docs/, docs_jhu/, MANUAL.markdown, README.md, TUTORIAL.
• Example data: example/index, example/reads, example/reference.
• License, AUTHORS, NEWS, VERSION.
Architectural patterns:
• Separation of concerns (index building vs. alignment).
• Modular core “engine” (seed generation, BWT search, dynamic-programming alignment).
• Plugin/binding layers (Java JNI, Python module) in hisat2lib/.
• Scripting orchestration for evaluations and data preparation.
Key insights from README
• Describes two main commands: hisat2-build (indexer) and hisat2 (aligner).
• Highlights the HGFM strategy: one global GFM index + many small local GFM indexes.
• Mentions external dependencies (Python scripts for evaluation, Java JNI, Python modules).
Detail level
• Essential modules (seed, BWT, SW, index builder, I/O).
• Third-party/utility code as supporting blocks (tinythread, cpuid, etc.).
• Separate the pipeline into discrete steps: preprocess → index → align → postprocess/evaluate.