Skip to content

Commit 4e2d935

Browse files
authored
Leiden algorithm included in precompiled macOS binaries
1 parent 5503c50 commit 4e2d935

File tree

6 files changed

+87
-151
lines changed

6 files changed

+87
-151
lines changed

.github/workflows/deploy.yml

+7-17
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
runs-on: [self-hosted, clusty, '${{ matrix.machine }}']
1818

1919
steps:
20+
- name: clean
21+
run: rm -rf ${{ github.workspace }}/*
2022
- uses: actions/checkout@v4
2123
with:
2224
submodules: recursive
@@ -36,30 +38,18 @@ jobs:
3638
fail-fast: false
3739
matrix:
3840
machine: [x64_linux]
39-
leiden: [true]
4041
platform: [avx2]
41-
compiler: [g++-13]
42+
compiler: [14]
4243
include:
43-
- machine: arm64_linux
44-
leiden: true
45-
platform: arm8
46-
compiler: g++-12
47-
- machine: x64_mac
48-
leiden: false
49-
platform: avx2
50-
compiler: g++-13
51-
- machine: arm64_mac
52-
leiden: false
53-
platform: m1
54-
compiler: g++-13
44+
- {machine: arm64_linux, platform: arm8, compiler: 12}
45+
- {machine: x64_mac, platform: avx2, compiler: 12}
46+
- {machine: arm64_mac, platform: m1, compiler: 12}
5547

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

5850
steps:
5951
- name: make
60-
run: |
61-
make clean
62-
make -j32 CXX=${{matrix.compiler}} STATIC_LINK=true LEIDEN=${{ matrix.leiden }} PLATFORM=${{ matrix.platform }}
52+
run: make -j32 CXX=g++-${{matrix.compiler}} CC=gcc-${{matrix.compiler}} PLATFORM=${{ matrix.platform }} LEIDEN=true
6353
- name: tar artifacts
6454
run: tar -cvzf clusty.tar.gz clusty LICENSE
6555

.github/workflows/self-hosted.yml

+45-108
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
runs-on: [self-hosted, clusty, '${{ matrix.machine }}']
2020

2121
steps:
22+
- name: clean
23+
run: rm -rf ${{ github.workspace }}/*
2224
- uses: actions/checkout@v4
2325
with:
2426
submodules: recursive
@@ -39,26 +41,20 @@ jobs:
3941
fail-fast: false
4042
matrix:
4143
machine: [x64_linux, x64_mac, arm64_linux, arm64_mac]
42-
compiler: [g++-11, g++-12, g++-13]
44+
compiler: [11, 12]
4345
include:
44-
- machine: x64_linux
45-
platform: avx2
46-
- machine: arm64_linux
47-
platform: arm8
48-
- machine: x64_mac
49-
platform: avx2
50-
- machine: arm64_mac
51-
platform: m1
52-
exclude:
53-
- machine: arm64_linux
54-
compiler: g++-13
55-
46+
- {machine: x64_linux, platform: avx2, compiler: 14}
47+
- {machine: x64_linux, platform: avx2}
48+
- {machine: arm64_linux, platform: arm8}
49+
- {machine: x64_mac, platform: avx2}
50+
- {machine: arm64_mac, platform: m1}
51+
5652
runs-on: [self-hosted, clusty, '${{ matrix.machine }}']
5753

5854
steps:
5955
- name: make
6056
run: |
61-
make -j32 CXX=${{matrix.compiler}} PLATFORM=${{ matrix.platform }}
57+
make -j32 CXX=g++-${{matrix.compiler}} CC=gcc-${{matrix.compiler}} PLATFORM=${{ matrix.platform }} LEIDEN=true
6258
cp ./clusty ./clusty-${{matrix.compiler}}
6359
make clean
6460
@@ -69,13 +65,12 @@ jobs:
6965
strategy:
7066
fail-fast: false
7167
matrix:
72-
machine: [x64_linux, x64_mac, arm64_linux, arm64_mac]
73-
compiler: [g++-11, g++-12, g++-13]
7468
algo: [single]
75-
exclude:
76-
- machine: arm64_linux
77-
compiler: g++-13
78-
69+
machine: [x64_linux, x64_mac, arm64_linux, arm64_mac]
70+
compiler: [11, 12]
71+
include:
72+
- {algo: single, machine: x64_linux, compiler: 14}
73+
7974
runs-on: [self-hosted, clusty, '${{ matrix.machine }}']
8075

8176
steps:
@@ -88,18 +83,20 @@ jobs:
8883

8984
vir61-linkage:
9085
name: Vir61
91-
needs: make
86+
needs: toy
9287
strategy:
9388
fail-fast: false
9489
matrix:
95-
machine: [x64_linux, x64_mac, arm64_linux, arm64_mac]
96-
compiler: [g++-11, g++-12, g++-13]
9790
algo: [single, complete]
9891
threshold: [95, 70]
99-
exclude:
100-
- machine: arm64_linux
101-
compiler: g++-13
102-
92+
machine: [x64_linux, x64_mac, arm64_linux, arm64_mac]
93+
compiler: [12]
94+
include:
95+
- {algo: single, threshold: 95, machine: x64_linux, compiler: 14}
96+
- {algo: single, threshold: 70, machine: x64_linux, compiler: 14}
97+
- {algo: complete, threshold: 95, machine: x64_linux, compiler: 14}
98+
- {algo: complete, threshold: 70, machine: x64_linux, compiler: 14}
99+
103100
runs-on: [self-hosted, clusty, '${{ matrix.machine }}']
104101

105102
steps:
@@ -111,18 +108,20 @@ jobs:
111108
########################################################################################
112109
ictv-linkage:
113110
name: ICTV (single and complete versus python clusterings)
114-
needs: make
111+
needs: vir61-linkage
115112
strategy:
116113
fail-fast: false
117114
matrix:
118-
machine: [x64_linux, x64_mac, arm64_linux, arm64_mac]
119-
compiler: [g++-11, g++-12, g++-13]
120115
algo: [single, complete]
121116
threshold: [95, 70]
122-
exclude:
123-
- machine: arm64_linux
124-
compiler: g++-13
125-
117+
machine: [x64_linux, x64_mac, arm64_linux, arm64_mac]
118+
compiler: [12]
119+
include:
120+
- {algo: single, threshold: 95, machine: x64_linux, compiler: 14}
121+
- {algo: single, threshold: 70, machine: x64_linux, compiler: 14}
122+
- {algo: complete, threshold: 95, machine: x64_linux, compiler: 14}
123+
- {algo: complete, threshold: 70, machine: x64_linux, compiler: 14}
124+
126125
runs-on: [self-hosted, clusty, '${{ matrix.machine }}']
127126

128127
steps:
@@ -149,18 +148,22 @@ jobs:
149148
########################################################################################
150149
ictv-all:
151150
name: ICTV (all algos versus our clusterings)
152-
needs: make
151+
needs: ictv-linkage
153152
strategy:
154153
fail-fast: false
155154
matrix:
156-
machine: [x64_linux, x64_mac, arm64_linux, arm64_mac]
157-
compiler: [g++-11, g++-12, g++-13]
158-
algo: [single, complete, uclust, set-cover, cd-hit]
155+
algo: [single, complete, uclust, set-cover, cd-hit, leiden]
159156
threshold: [70]
160-
exclude:
161-
- machine: arm64_linux
162-
compiler: g++-13
163-
157+
machine: [x64_linux, x64_mac, arm64_linux, arm64_mac]
158+
compiler: [12]
159+
include:
160+
- {algo: single, threshold: 70, machine: x64_linux, compiler: 14}
161+
- {algo: complete, threshold: 70, machine: x64_linux, compiler: 14}
162+
- {algo: uclust, threshold: 70, machine: x64_linux, compiler: 14}
163+
- {algo: set-cover, threshold: 70, machine: x64_linux, compiler: 14}
164+
- {algo: cd-hit, threshold: 70, machine: x64_linux, compiler: 14}
165+
- {algo: leiden, threshold: 70, machine: x64_linux, compiler: 14}
166+
164167
runs-on: [self-hosted, clusty, '${{ matrix.machine }}']
165168

166169
steps:
@@ -178,69 +181,3 @@ jobs:
178181
run: |
179182
./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
180183
cmp ictv.${{matrix.algo}}.${{matrix.threshold}}.reps.num ./test/ictv.${{matrix.algo}}.${{matrix.threshold}}.reps.csv
181-
182-
183-
########################################################################################
184-
make-leiden:
185-
name: Make (Leiden)
186-
187-
needs: ictv-all
188-
strategy:
189-
fail-fast: false
190-
matrix:
191-
machine: [x64_linux, arm64_linux]
192-
include:
193-
- machine: x64_linux
194-
compiler: g++-13
195-
platform: avx2
196-
- machine: arm64_linux
197-
compiler: g++-12
198-
platform: arm8
199-
200-
runs-on: [self-hosted, clusty, '${{ matrix.machine }}']
201-
202-
steps:
203-
- name: make
204-
run: |
205-
make -j32 CXX=${{matrix.compiler}} LEIDEN=true PLATFORM=${{ matrix.platform }}
206-
cp ./clusty ./clusty-leiden-${{matrix.compiler}}
207-
make clean
208-
209-
########################################################################################
210-
ictv-leiden:
211-
name: ICTV (Leiden)
212-
needs: make-leiden
213-
strategy:
214-
fail-fast: false
215-
matrix:
216-
machine: [x64_linux, arm64_linux]
217-
algo: [leiden]
218-
threshold: [70]
219-
include:
220-
- machine: x64_linux
221-
compiler: g++-13
222-
- machine: arm64_linux
223-
compiler: g++-12
224-
225-
runs-on: [self-hosted, clusty, '${{ matrix.machine }}']
226-
227-
steps:
228-
- name: ${{matrix.algo}}, ${{matrix.threshold}} (no representatives)
229-
run: |
230-
./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}}
231-
cmp ictv.${{matrix.algo}}.${{matrix.threshold}} ./test/ictv.${{matrix.algo}}.${{matrix.threshold}}.csv
232-
233-
- name: ${{matrix.algo}}, ${{matrix.threshold}} (with representatives)
234-
run: |
235-
./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
236-
cmp ictv.${{matrix.algo}}.${{matrix.threshold}}.reps ./test/ictv.${{matrix.algo}}.${{matrix.threshold}}.reps.csv
237-
238-
- name: ${{matrix.algo}}, ${{matrix.threshold}} (with representatives, numeric ids)
239-
run: |
240-
./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
241-
cmp ictv.${{matrix.algo}}.${{matrix.threshold}}.reps.num ./test/ictv.${{matrix.algo}}.${{matrix.threshold}}.reps.csv
242-
243-
- name: ${{matrix.algo}}, ${{matrix.threshold}} (non-default params)
244-
run: |
245-
./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
246-
cmp ictv.${{matrix.algo}}-params.${{matrix.threshold}}.reps.csv ./test/ictv.${{matrix.algo}}-params.${{matrix.threshold}}.reps.csv

README.md

+11-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![Bioconda downloads](https://img.shields.io/conda/dn/bioconda/clusty.svg?style=flag&label=Bioconda%20downloads)](https://anaconda.org/bioconda/clusty)
44
[![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)
5-
[![GitHub Actions CI](../../workflows/GitHub%20Actions%20CI/badge.svg)](../../actions/workflows/main.yml)
5+
[![Build and tests](../../workflows/GitHub%20Actions%20CI/badge.svg)](../../actions/workflows/main.yml)
66
[![License](https://anaconda.org/bioconda/famsa/badges/license.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
77

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

4444
## Installation
4545

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

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

57-
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:
57+
To compile Clusty under Linux/macOS please run:
58+
```
59+
make -j
60+
```
61+
62+
### Leiden algorithm
63+
64+
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:
5865
```
5966
sudo apt-get install cmake flex bison
6067
```

makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,17 @@ else
6767
endif
6868

6969

70-
ifeq ($(STATIC_LINK), true)
70+
ifeq ($(DYNAMIC_LINK), true)
71+
CFLAGS = -Wall -O3 $(ARCH_FLAGS) -std=c++17 $(DEFINE_FLAGS) $(INCLUDES) -pthread
72+
CLINK = -lm -O3 -std=c++17 -pthread $(ABI_FLAGS)
73+
else
7174
ifeq ($(uname_S),Darwin)
7275
CFLAGS = -Wall -O3 $(ARCH_FLAGS) -std=c++17 $(DEFINE_FLAGS) $(INCLUDES)
7376
CLINK = -lm -O3 -std=c++17 $(ABI_FLAGS) -static-libgcc
7477
else
7578
CFLAGS = -Wall -O3 $(ARCH_FLAGS) -std=c++17 $(DEFINE_FLAGS) $(INCLUDES) -static -Wl,--whole-archive -lpthread -Wl,--no-whole-archive
7679
CLINK = -lm -static -O3 -std=c++17 $(ABI_FLAGS) -Wl,--whole-archive -lpthread -Wl,--no-whole-archive
77-
endif
78-
else
79-
CFLAGS = -Wall -O3 $(ARCH_FLAGS) -std=c++17 $(DEFINE_FLAGS) $(INCLUDES) -pthread
80-
CLINK = -lm -O3 -std=c++17 -pthread $(ABI_FLAGS)
80+
endif
8181
endif
8282

8383
ifeq ($(LEIDEN), true)

src/params.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void Params::printUsage() const {
4747
<< endl << endl
4848
<< " " + PARAM_LEIDEN_RESOLUTION + " - resolution parameter for Leiden algorithm (default: " << leidenParams.resolution << ")" << endl
4949
<< " " + PARAM_LEIDEN_BETA + " - beta parameter for Leiden algorithm (default: " << leidenParams.beta << ")" << endl
50-
<< " " + PARAM_LEIDEN_RESOLUTION + " - number of interations for Leiden algorithm (default: " << leidenParams.numIterations << ")"
50+
<< " " + PARAM_LEIDEN_ITERATIONS + " - number of interations for Leiden algorithm (default: " << leidenParams.numIterations << ")"
5151
#endif
5252
<< endl << endl;
5353
}

src/version.h

+18-16
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,35 @@
88
//
99
// *******************************************************************************************
1010

11-
#define VERSION "1.1.1"
12-
#define DATE "2024-10-05"
11+
#define VERSION "1.1.2"
12+
#define DATE "2024-10-13"
1313

1414

1515
/********* Version history *********
1616
17-
1.1.1 (2024-10-05)
17+
1.1.2
18+
* Precompiled binaries for macOS include Leiden algorithm.
19+
* Fixed small bug with `--leiden-iterations` param being displayed in help as `--leiden-resolution`.
20+
21+
1.1.1 (2024-10-05)
1822
Fixed bug with Leiden algorithm always running with default parameters.
1923
20-
1.1.0 (2024-09-30)
21-
Memory optimizatons:
24+
1.1.0 (2024-09-30)
25+
Memory optimizatons:
2226
* Row identifier removed from dist_t structure.
2327
* Object identifiers in complete linkage stored as 32-bit integers.
2428
* For some clustering algorithms only edges are stored (without distances).
2529
26-
1.0.3 (2024-09-12)
27-
Fixes in building scripts.
28-
29-
1.0.2 (2024-08-29)
30-
Fixed crash in reading very large input matrices. Reduced memory requirements.
31-
30+
1.0.3 (2024-09-12)
31+
Fixes in building scripts.
3232
33-
1.0.1 (2024-08-19)
34-
Fixed bug in parsing floating point numbers with more than 15 decimal places.
33+
1.0.2 (2024-08-29)
34+
Fixed crash in reading very large input matrices. Reduced memory requirements.
3535
36+
1.0.1 (2024-08-19)
37+
Fixed bug in parsing floating point numbers with more than 15 decimal places.
3638
37-
1.0.0 (2024-06-26)
38-
First public release
39+
1.0.0 (2024-06-26)
40+
First public release
3941
40-
*/
42+
*/

0 commit comments

Comments
 (0)