RabbitCD-HIT is a scalable greedy incremental clustering tool designed for massive protein sequences. It supports running on distributed clusters to efficiently process massive protein sequence datasets. RabbitCD-HIT combines inter-node MPI parallelism with intra-node multithreading to achieve superior speed and scalability while maintaining full compatibility with the CD-HIT output format.
RabbitCD-HIT requires an MPI implementation for distributed parallel execution.
- MPI: required for compiling and running
cdhit-mpi.- Intel MPI is recommended when using
mpiicpx. - OpenMPI or MPICH can also be used through
mpicxx.
- Intel MPI is recommended when using
- TBB (Threading Building Blocks): optional.
- TBB can be enabled to accelerate some intra-node operations, such as parallel sorting.
- By default, RabbitCD-HIT is built without TBB.
- To enable TBB support, both
tbb=yesandTBB_ROOTmust be specified during compilation.
Please make sure that an MPI implementation is installed and available in your build environment before compiling RabbitCD-HIT.
Clone the repository and build RabbitCD-HIT with the default configuration:
git clone --recursive https://github.com/RabbitBio/RabbitCDHIT.git
cd RabbitCDHIT
makeBy default, the project uses mpiicpx as the MPI C++ compiler.
If mpiicpx is not available on your machine, you can build with mpicxx:
make CC=mpicxxWhen using mpicxx, it is recommended to use -O2 instead of aggressive optimization flags such as -Ofast, which may cause potential correctness issues on some platforms.
TBB support is disabled by default. To enable TBB, the TBB installation path must be specified explicitly through TBB_ROOT:
make tbb=yes TBB_ROOT=/path/to/your/tbbFor example, when using Intel oneAPI TBB:
make tbb=yes TBB_ROOT=/opt/intel/oneapi/tbb/latestUsing only make tbb=yes without specifying TBB_ROOT is not supported.
If your CPU supports AVX512, compile with:
make AVX512=yesAVX512 support can also be combined with other build options:
make AVX512=yes tbb=yes TBB_ROOT=/opt/intel/oneapi/tbb/latestor:
make CC=mpicxx AVX512=yesmake cleanFor single-node runs, use the provided run_single.sh script to complete both stages in one command:
bash run_single.sh -i DB.fa -o resultThe script automatically detects the machine's CPU topology (nproc, lscpu) and sets -NT (total cores) and -T (cores per NUMA node) accordingly; both can also be specified manually. It also reads info.json produced by the preprocess stage and passes the correct -np and -T to cdhit-mpi.
| Option | Default | Description |
|---|---|---|
-i |
(required) | Input FASTA file (supports .gz) |
-o |
(required) | Output file prefix |
-c |
0.9 |
Sequence identity threshold |
Any additional cdhit-mpi options can be appended directly:
bash run_single.sh -i DB.fa -o result -c 0.9 -g 1 -fo 1 -load_all 1| Option | Default | Description |
|---|---|---|
-g |
0 |
1: accurate mode — assign to the most similar cluster. 0: fast mode — assign to the first qualifying cluster. |
-fo |
0 |
1: enforce strict input file order when comparing sequences of equal length. |
-load_all |
0 |
0 (default): double-buffered streaming, minimises peak memory. 1: load all sequences into RAM. |
When running on a cluster (multi-node), this manual workflow must be used.
The two stages below must be run in order.
./cdhit-preprocess -i DB.fa -N 1 -NT 128 -T 64 -tmp /absolute/path/to/tmp_runs -pre_out /absolute/path/to/preprocess_output| Argument | Description |
|---|---|
-i |
Input FASTA file (supports .gz) |
-N |
Number of nodes |
-NT |
Total threads per node for the MPI workflow |
-T |
Threads used by cdhit-preprocess itself (one NUMA node recommended) |
-tmp |
Temp run-file directory |
-pre_out |
Preprocess output directory |
Read total_mpi_num and threads_per_rank from the generated info.json, then run:
mpirun -np <total_mpi_num> ./cdhit-mpi -i /absolute/path/to/preprocess_output -o DB_output -T <threads_per_rank>
**mpirun -npandcdhit-mpi -TMUST matchinfo.json, otherwise the run may fail.**
*.txt: representative sequence names and sequences*.clstr: cluster membership information