Skip to content

Commit

Permalink
Leiden algorithm included in precompiled macOS binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
agudys authored Oct 13, 2024
1 parent 5503c50 commit 4e2d935
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 151 deletions.
24 changes: 7 additions & 17 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
runs-on: [self-hosted, clusty, '${{ matrix.machine }}']

steps:
- name: clean
run: rm -rf ${{ github.workspace }}/*
- uses: actions/checkout@v4
with:
submodules: recursive
Expand All @@ -36,30 +38,18 @@ jobs:
fail-fast: false
matrix:
machine: [x64_linux]
leiden: [true]
platform: [avx2]
compiler: [g++-13]
compiler: [14]
include:
- machine: arm64_linux
leiden: true
platform: arm8
compiler: g++-12
- machine: x64_mac
leiden: false
platform: avx2
compiler: g++-13
- machine: arm64_mac
leiden: false
platform: m1
compiler: g++-13
- {machine: arm64_linux, platform: arm8, compiler: 12}
- {machine: x64_mac, platform: avx2, compiler: 12}
- {machine: arm64_mac, platform: m1, compiler: 12}

runs-on: [self-hosted, clusty, '${{ matrix.machine }}']

steps:
- name: make
run: |
make clean
make -j32 CXX=${{matrix.compiler}} STATIC_LINK=true LEIDEN=${{ matrix.leiden }} PLATFORM=${{ matrix.platform }}
run: make -j32 CXX=g++-${{matrix.compiler}} CC=gcc-${{matrix.compiler}} PLATFORM=${{ matrix.platform }} LEIDEN=true
- name: tar artifacts
run: tar -cvzf clusty.tar.gz clusty LICENSE

Expand Down
153 changes: 45 additions & 108 deletions .github/workflows/self-hosted.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
runs-on: [self-hosted, clusty, '${{ matrix.machine }}']

steps:
- name: clean
run: rm -rf ${{ github.workspace }}/*
- uses: actions/checkout@v4
with:
submodules: recursive
Expand All @@ -39,26 +41,20 @@ jobs:
fail-fast: false
matrix:
machine: [x64_linux, x64_mac, arm64_linux, arm64_mac]
compiler: [g++-11, g++-12, g++-13]
compiler: [11, 12]
include:
- machine: x64_linux
platform: avx2
- machine: arm64_linux
platform: arm8
- machine: x64_mac
platform: avx2
- machine: arm64_mac
platform: m1
exclude:
- machine: arm64_linux
compiler: g++-13

- {machine: x64_linux, platform: avx2, compiler: 14}
- {machine: x64_linux, platform: avx2}
- {machine: arm64_linux, platform: arm8}
- {machine: x64_mac, platform: avx2}
- {machine: arm64_mac, platform: m1}

runs-on: [self-hosted, clusty, '${{ matrix.machine }}']

steps:
- name: make
run: |
make -j32 CXX=${{matrix.compiler}} PLATFORM=${{ matrix.platform }}
make -j32 CXX=g++-${{matrix.compiler}} CC=gcc-${{matrix.compiler}} PLATFORM=${{ matrix.platform }} LEIDEN=true
cp ./clusty ./clusty-${{matrix.compiler}}
make clean
Expand All @@ -69,13 +65,12 @@ jobs:
strategy:
fail-fast: false
matrix:
machine: [x64_linux, x64_mac, arm64_linux, arm64_mac]
compiler: [g++-11, g++-12, g++-13]
algo: [single]
exclude:
- machine: arm64_linux
compiler: g++-13

machine: [x64_linux, x64_mac, arm64_linux, arm64_mac]
compiler: [11, 12]
include:
- {algo: single, machine: x64_linux, compiler: 14}

runs-on: [self-hosted, clusty, '${{ matrix.machine }}']

steps:
Expand All @@ -88,18 +83,20 @@ jobs:

vir61-linkage:
name: Vir61
needs: make
needs: toy
strategy:
fail-fast: false
matrix:
machine: [x64_linux, x64_mac, arm64_linux, arm64_mac]
compiler: [g++-11, g++-12, g++-13]
algo: [single, complete]
threshold: [95, 70]
exclude:
- machine: arm64_linux
compiler: g++-13

machine: [x64_linux, x64_mac, arm64_linux, arm64_mac]
compiler: [12]
include:
- {algo: single, threshold: 95, machine: x64_linux, compiler: 14}
- {algo: single, threshold: 70, machine: x64_linux, compiler: 14}
- {algo: complete, threshold: 95, machine: x64_linux, compiler: 14}
- {algo: complete, threshold: 70, machine: x64_linux, compiler: 14}

runs-on: [self-hosted, clusty, '${{ matrix.machine }}']

steps:
Expand All @@ -111,18 +108,20 @@ jobs:
########################################################################################
ictv-linkage:
name: ICTV (single and complete versus python clusterings)
needs: make
needs: vir61-linkage
strategy:
fail-fast: false
matrix:
machine: [x64_linux, x64_mac, arm64_linux, arm64_mac]
compiler: [g++-11, g++-12, g++-13]
algo: [single, complete]
threshold: [95, 70]
exclude:
- machine: arm64_linux
compiler: g++-13

machine: [x64_linux, x64_mac, arm64_linux, arm64_mac]
compiler: [12]
include:
- {algo: single, threshold: 95, machine: x64_linux, compiler: 14}
- {algo: single, threshold: 70, machine: x64_linux, compiler: 14}
- {algo: complete, threshold: 95, machine: x64_linux, compiler: 14}
- {algo: complete, threshold: 70, machine: x64_linux, compiler: 14}

runs-on: [self-hosted, clusty, '${{ matrix.machine }}']

steps:
Expand All @@ -149,18 +148,22 @@ jobs:
########################################################################################
ictv-all:
name: ICTV (all algos versus our clusterings)
needs: make
needs: ictv-linkage
strategy:
fail-fast: false
matrix:
machine: [x64_linux, x64_mac, arm64_linux, arm64_mac]
compiler: [g++-11, g++-12, g++-13]
algo: [single, complete, uclust, set-cover, cd-hit]
algo: [single, complete, uclust, set-cover, cd-hit, leiden]
threshold: [70]
exclude:
- machine: arm64_linux
compiler: g++-13

machine: [x64_linux, x64_mac, arm64_linux, arm64_mac]
compiler: [12]
include:
- {algo: single, threshold: 70, machine: x64_linux, compiler: 14}
- {algo: complete, threshold: 70, machine: x64_linux, compiler: 14}
- {algo: uclust, threshold: 70, machine: x64_linux, compiler: 14}
- {algo: set-cover, threshold: 70, machine: x64_linux, compiler: 14}
- {algo: cd-hit, threshold: 70, machine: x64_linux, compiler: 14}
- {algo: leiden, threshold: 70, machine: x64_linux, compiler: 14}

runs-on: [self-hosted, clusty, '${{ matrix.machine }}']

steps:
Expand All @@ -178,69 +181,3 @@ jobs:
run: |
./clusty-${{matrix.compiler}} --algo ${{matrix.algo}} --objects-file ./test/ictv.list --similarity --min ani 0.${{matrix.threshold}} ./test/ictv.num ictv.${{matrix.algo}}.${{matrix.threshold}}.reps.num --out-representatives --numeric-ids
cmp ictv.${{matrix.algo}}.${{matrix.threshold}}.reps.num ./test/ictv.${{matrix.algo}}.${{matrix.threshold}}.reps.csv
########################################################################################
make-leiden:
name: Make (Leiden)

needs: ictv-all
strategy:
fail-fast: false
matrix:
machine: [x64_linux, arm64_linux]
include:
- machine: x64_linux
compiler: g++-13
platform: avx2
- machine: arm64_linux
compiler: g++-12
platform: arm8

runs-on: [self-hosted, clusty, '${{ matrix.machine }}']

steps:
- name: make
run: |
make -j32 CXX=${{matrix.compiler}} LEIDEN=true PLATFORM=${{ matrix.platform }}
cp ./clusty ./clusty-leiden-${{matrix.compiler}}
make clean
########################################################################################
ictv-leiden:
name: ICTV (Leiden)
needs: make-leiden
strategy:
fail-fast: false
matrix:
machine: [x64_linux, arm64_linux]
algo: [leiden]
threshold: [70]
include:
- machine: x64_linux
compiler: g++-13
- machine: arm64_linux
compiler: g++-12

runs-on: [self-hosted, clusty, '${{ matrix.machine }}']

steps:
- name: ${{matrix.algo}}, ${{matrix.threshold}} (no representatives)
run: |
./clusty-leiden-${{matrix.compiler}} --algo ${{matrix.algo}} --objects-file ./test/ictv.list --similarity --min ani 0.${{matrix.threshold}} ./test/ictv.ani ictv.${{matrix.algo}}.${{matrix.threshold}}
cmp ictv.${{matrix.algo}}.${{matrix.threshold}} ./test/ictv.${{matrix.algo}}.${{matrix.threshold}}.csv
- name: ${{matrix.algo}}, ${{matrix.threshold}} (with representatives)
run: |
./clusty-leiden-${{matrix.compiler}} --algo ${{matrix.algo}} --objects-file ./test/ictv.list --similarity --min ani 0.${{matrix.threshold}} ./test/ictv.ani ictv.${{matrix.algo}}.${{matrix.threshold}}.reps --out-representatives
cmp ictv.${{matrix.algo}}.${{matrix.threshold}}.reps ./test/ictv.${{matrix.algo}}.${{matrix.threshold}}.reps.csv
- name: ${{matrix.algo}}, ${{matrix.threshold}} (with representatives, numeric ids)
run: |
./clusty-leiden-${{matrix.compiler}} --algo ${{matrix.algo}} --objects-file ./test/ictv.list --similarity --min ani 0.${{matrix.threshold}} ./test/ictv.num ictv.${{matrix.algo}}.${{matrix.threshold}}.reps.num --out-representatives --numeric-ids
cmp ictv.${{matrix.algo}}.${{matrix.threshold}}.reps.num ./test/ictv.${{matrix.algo}}.${{matrix.threshold}}.reps.csv
- name: ${{matrix.algo}}, ${{matrix.threshold}} (non-default params)
run: |
./clusty-leiden-${{matrix.compiler}} --algo ${{matrix.algo}} --objects-file ./test/ictv.list --similarity --min ani 0.${{matrix.threshold}} --leiden-resolution 1.0 --leiden-beta 0.03 --leiden-iterations 3 ./test/ictv.ani ictv.${{matrix.algo}}-params.${{matrix.threshold}}.reps.csv --out-representatives
cmp ictv.${{matrix.algo}}-params.${{matrix.threshold}}.reps.csv ./test/ictv.${{matrix.algo}}-params.${{matrix.threshold}}.reps.csv
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Bioconda downloads](https://img.shields.io/conda/dn/bioconda/clusty.svg?style=flag&label=Bioconda%20downloads)](https://anaconda.org/bioconda/clusty)
[![GitHub downloads](https://img.shields.io/github/downloads/refresh-bio/clusty/total.svg?style=flag&label=GitHub%20downloads)](https://github.com/refresh-bio/clusty/releases)
[![GitHub Actions CI](../../workflows/GitHub%20Actions%20CI/badge.svg)](../../actions/workflows/main.yml)
[![Build and tests](../../workflows/GitHub%20Actions%20CI/badge.svg)](../../actions/workflows/main.yml)
[![License](https://anaconda.org/bioconda/famsa/badges/license.svg)](https://www.gnu.org/licenses/gpl-3.0.html)

![x86-64](https://img.shields.io/static/v1?label=%E2%80%8B&message=x86-64&color=yellow&logo=PCGamingWiki&logoColor=white)
Expand Down Expand Up @@ -43,7 +43,7 @@ cd ./test

## Installation

Clusty comes with a set of precompiled binaries for Windows and Linux. They can be found under [Releases](./releases) tab.
Clusty comes with a set of precompiled binaries for Windows, Linux, and macOS. They can be found under [Releases](./releases) tab.
The software is also available on [Bioconda](https://anaconda.org/bioconda/clusty):
```
conda install -c bioconda clusty
Expand All @@ -52,9 +52,16 @@ For detailed instructions how to set up Bioconda, please refer to the [Bioconda

The package can be built from the sources distributed as:
* Visual Studio 2022 solution for Windows,
* MAKE project for Linux (g++-10 required).
* MAKE project for Linux and macOS (g++-10 required).

Clusty provides igraph's implementation of the Leiden algorithm. However, as igraph requires several external dependencies (CMake 3.18, Flex, Bison), it is by default not linked to the Clusty software. To install dependencies under Debian/Ubuntu linux use the following command:
To compile Clusty under Linux/macOS please run:
```
make -j
```

### Leiden algorithm

Clusty provides igraph's implementation of the Leiden algorithm. Precompiled binaries as well as bioconda distributions include Leiden algorithm. However, as igraph requires several external dependencies (CMake 3.18, Flex, Bison), it is by default not linked to the Clusty software. To install dependencies under Debian/Ubuntu linux use the following command:
```
sudo apt-get install cmake flex bison
```
Expand Down
10 changes: 5 additions & 5 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,17 @@ else
endif


ifeq ($(STATIC_LINK), true)
ifeq ($(DYNAMIC_LINK), true)
CFLAGS = -Wall -O3 $(ARCH_FLAGS) -std=c++17 $(DEFINE_FLAGS) $(INCLUDES) -pthread
CLINK = -lm -O3 -std=c++17 -pthread $(ABI_FLAGS)
else
ifeq ($(uname_S),Darwin)
CFLAGS = -Wall -O3 $(ARCH_FLAGS) -std=c++17 $(DEFINE_FLAGS) $(INCLUDES)
CLINK = -lm -O3 -std=c++17 $(ABI_FLAGS) -static-libgcc
else
CFLAGS = -Wall -O3 $(ARCH_FLAGS) -std=c++17 $(DEFINE_FLAGS) $(INCLUDES) -static -Wl,--whole-archive -lpthread -Wl,--no-whole-archive
CLINK = -lm -static -O3 -std=c++17 $(ABI_FLAGS) -Wl,--whole-archive -lpthread -Wl,--no-whole-archive
endif
else
CFLAGS = -Wall -O3 $(ARCH_FLAGS) -std=c++17 $(DEFINE_FLAGS) $(INCLUDES) -pthread
CLINK = -lm -O3 -std=c++17 -pthread $(ABI_FLAGS)
endif
endif

ifeq ($(LEIDEN), true)
Expand Down
2 changes: 1 addition & 1 deletion src/params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ void Params::printUsage() const {
<< endl << endl
<< " " + PARAM_LEIDEN_RESOLUTION + " - resolution parameter for Leiden algorithm (default: " << leidenParams.resolution << ")" << endl
<< " " + PARAM_LEIDEN_BETA + " - beta parameter for Leiden algorithm (default: " << leidenParams.beta << ")" << endl
<< " " + PARAM_LEIDEN_RESOLUTION + " - number of interations for Leiden algorithm (default: " << leidenParams.numIterations << ")"
<< " " + PARAM_LEIDEN_ITERATIONS + " - number of interations for Leiden algorithm (default: " << leidenParams.numIterations << ")"
#endif
<< endl << endl;
}
Expand Down
34 changes: 18 additions & 16 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,35 @@
//
// *******************************************************************************************

#define VERSION "1.1.1"
#define DATE "2024-10-05"
#define VERSION "1.1.2"
#define DATE "2024-10-13"


/********* Version history *********
1.1.1 (2024-10-05)
1.1.2
* Precompiled binaries for macOS include Leiden algorithm.
* Fixed small bug with `--leiden-iterations` param being displayed in help as `--leiden-resolution`.
1.1.1 (2024-10-05)
Fixed bug with Leiden algorithm always running with default parameters.
1.1.0 (2024-09-30)
Memory optimizatons:
1.1.0 (2024-09-30)
Memory optimizatons:
* Row identifier removed from dist_t structure.
* Object identifiers in complete linkage stored as 32-bit integers.
* For some clustering algorithms only edges are stored (without distances).
1.0.3 (2024-09-12)
Fixes in building scripts.
1.0.2 (2024-08-29)
Fixed crash in reading very large input matrices. Reduced memory requirements.
1.0.3 (2024-09-12)
Fixes in building scripts.
1.0.1 (2024-08-19)
Fixed bug in parsing floating point numbers with more than 15 decimal places.
1.0.2 (2024-08-29)
Fixed crash in reading very large input matrices. Reduced memory requirements.
1.0.1 (2024-08-19)
Fixed bug in parsing floating point numbers with more than 15 decimal places.
1.0.0 (2024-06-26)
First public release
1.0.0 (2024-06-26)
First public release
*/
*/

0 comments on commit 4e2d935

Please sign in to comment.