Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
3b33f47
add bin files to ignore
mahmudhera Nov 6, 2024
f557d9c
add sketch reader to utils
mahmudhera Nov 6, 2024
b8bcd9f
move computation of hash index to header
mahmudhera Nov 6, 2024
08d8014
move sketch reading to header
mahmudhera Nov 6, 2024
5532e3c
move show mpty sketches to header
mahmudhera Nov 6, 2024
567eec1
move computation of int matrix to utils
mahmudhera Nov 6, 2024
37a2cb4
change implementation to use two sets of sketches
mahmudhera Nov 7, 2024
d03192b
test if different sketches work
mahmudhera Nov 7, 2024
980ee55
remove globals
mahmudhera Nov 7, 2024
cbdacbb
remove precomputation of sizes and ids
mahmudhera Nov 7, 2024
c675814
remove redundant arguments
mahmudhera Nov 7, 2024
de66de7
keep single appearing sketches
mahmudhera Nov 7, 2024
ccba5fe
rename to yacht train code
mahmudhera Nov 7, 2024
71a4438
name sketch names to sketch paths
mahmudhera Nov 7, 2024
26faba0
added code for computing similarity
mahmudhera Nov 7, 2024
a2e7a24
fix linking
mahmudhera Nov 7, 2024
a03b6b1
fix linking
mahmudhera Nov 7, 2024
c682943
fix build
mahmudhera Nov 7, 2024
d31c45f
combine output
mahmudhera Nov 7, 2024
398538e
add default value
mahmudhera Nov 7, 2024
42d1717
add documentations
mahmudhera Nov 7, 2024
0706786
add documentation
mahmudhera Nov 7, 2024
653a247
remove unnecessary files
mahmudhera Nov 7, 2024
4db35d8
Merge branch 'dev-fast-yacht-run' into chunyu_v1.4.0
chunyuma Dec 9, 2024
24562da
rename compute_similarity.cpp -> yacht_run_compute_similarity.cpp
chunyuma Dec 10, 2024
9e5dddf
update yacht run
chunyuma Dec 10, 2024
3cef6df
update the setup scripts
chunyuma Dec 10, 2024
22ad07f
try fixiing the pthread_create issue
chunyuma Dec 10, 2024
20d19b4
add conftest.py file and mark slow test functions
chunyuma Dec 10, 2024
5906df0
add conftest file
chunyuma Dec 10, 2024
9a5b3d1
update version number
chunyuma Dec 10, 2024
f4e0a01
update sha256 code
chunyuma Dec 10, 2024
91b1357
update conda_recipe/meta.yaml
chunyuma Dec 10, 2024
ff365df
update conda_recipe/meta.yaml
chunyuma Dec 10, 2024
a906ed2
add some documents for the new parameters
chunyuma Dec 10, 2024
9784812
change database 0.9995 to 0.80 for faster test
chunyuma Dec 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,6 @@ gtdb-rs214-reps.k31_0.9995_pretrained/
# added by mahmudhera
src/cpp/main.o
.gitignore
src/cpp/utils.o
src/yacht/run_yacht_train_core
.vscode/settings.json
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Include C++ source files
include src/cpp/*.cpp
include src/cpp/*.hpp
include src/cpp/*.h

# Include other necessary files
include LICENSE.txt
Expand Down
35 changes: 16 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,29 @@ SRC_DIR = src/cpp
BIN_DIR = src/yacht

# Source files
SRC_FILES = $(SRC_DIR)/main.cpp
SRC_FILES = $(SRC_DIR)/yacht_train_core.cpp $(SRC_DIR)/utils.cpp $(SRC_DIR)/yacht_run_compute_similarity.cpp

# Object files
OBJ_FILES = $(SRC_FILES:.cpp=.o)

# Target executable
TARGET = $(BIN_DIR)/run_yacht_train_core
# Target executables
TARGET1 = $(BIN_DIR)/yacht_train_core
TARGET2 = $(BIN_DIR)/yacht_run_compute_similarity

# Default target
all: $(TARGET)
# Build rules
all: $(TARGET1) $(TARGET2)

# Create the bin directory if it doesn't exist
$(BIN_DIR):
echo "Creating directory: $(BIN_DIR)"
mkdir -p $(BIN_DIR)
$(TARGET1): $(SRC_DIR)/yacht_train_core.cpp $(SRC_DIR)/utils.cpp
$(CXX) $(CXXFLAGS) -pthread $(SRC_DIR)/yacht_train_core.cpp $(SRC_DIR)/utils.cpp -o $(TARGET1)

# build the object files
$(OBJ_FILES): %.o: %.cpp
echo "Compiling: $<"
$(CXX) $(CXXFLAGS) -c $< -o $@
$(TARGET2): $(SRC_DIR)/yacht_run_compute_similarity.cpp $(SRC_DIR)/utils.cpp
$(CXX) $(CXXFLAGS) -pthread $(SRC_DIR)/yacht_run_compute_similarity.cpp $(SRC_DIR)/utils.cpp -o $(TARGET2)

# build the target executable
$(TARGET): $(OBJ_FILES) | $(BIN_DIR)
echo "Linking to create executable: $(TARGET)"
$(CXX) $(CXXFLAGS) $(OBJ_FILES) -o $(TARGET) -lpthread
%.o: %.cpp
$(CXX) $(CXXFLAGS) -pthread -c $< -o $@

# clean up
clean:
rm -f $(OBJ_FILES) $(TARGET)
rm -f $(OBJ_FILES) $(TARGET1) $(TARGET2)

.PHONY: all clean

34 changes: 27 additions & 7 deletions build_windows.bat
Original file line number Diff line number Diff line change
@@ -1,21 +1,41 @@
@echo off
setlocal enabledelayedexpansion

REM Set up paths for directories
rem Set up paths for directories
set SRC_DIR=src\cpp
set BIN_DIR=src\yacht

REM Create bin directory if it doesn't exist
rem Create bin directory if it doesn't exist
if not exist %BIN_DIR% (
mkdir %BIN_DIR%
)

REM Compile the main.cpp file using g++ from MinGW or another suitable compiler
g++ -std=c++17 -Wsign-compare -Wall -O3 -o %BIN_DIR%\run_yacht_train_core.exe %SRC_DIR%\main.cpp
rem Compile source files into object files
set OBJ_FILES=
for %%f in (%SRC_DIR%\*.cpp) do (
g++ -std=c++17 -Wall -O3 -Wsign-compare -c %%f -o %%~nf.o
if %errorlevel% neq 0 (
echo Compilation failed for %%f!
exit /b %errorlevel%
)
set OBJ_FILES=!OBJ_FILES! %%~nf.o
)

rem Create yacht_train_core.exe
g++ %OBJ_FILES% -o %BIN_DIR%\yacht_train_core.exe
if %errorlevel% neq 0 (
echo Linking failed for yacht_train_core.exe!
exit /b %errorlevel%
)

REM Check if compilation succeeded
rem Create yacht_run_compute_similarity.exe
g++ %OBJ_FILES% -o %BIN_DIR%\yacht_run_compute_similarity.exe
if %errorlevel% neq 0 (
echo Compilation failed!
echo Linking failed for yacht_run_compute_similarity.exe!
exit /b %errorlevel%
)

echo Compilation successful. Executable created at %BIN_DIR%\run_yacht_train_core.exe
rem Clean up object files
del *.o

echo Compilation successful. Executables created in %BIN_DIR%.
6 changes: 2 additions & 4 deletions conda_recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
{% set version = "1.3.0" %}
{% set version = "1.4.0" %}

package:
name: yacht
version: {{ version }}

source:
url: https://github.com/KoslickiLab/YACHT/releases/download/v{{ version }}/yacht-{{ version }}.tar.gz
sha256: 68d272daeb70ed7390aa2d468934dc4bf0aa9a021f99fe99847b8a664e8ac8cf
sha256: 3558abd6d1084f0679ffbd8b1a8592ec7e0e642e201b5fcc0e34eaa62ae7e705

build:
number: 0
skip: True # [osx]
script: "{{ PYTHON }} -m pip install . --no-deps --no-build-isolation --no-cache-dir -vvv"
run_exports:
- {{ pin_subpackage('yacht') }}
Expand Down Expand Up @@ -52,7 +51,6 @@ requirements:
- pytaxonkit
- openpyxl
- ruff
- sourmash_plugin_branchwater

test:
commands:
Expand Down
1 change: 0 additions & 1 deletion env/yacht_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ dependencies:
- pytaxonkit
- requests
- pip
- sourmash_plugin_branchwater
- pip:
- openpyxl
- ruff
19 changes: 14 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,24 @@ def run(self):
print(f"Error during Unix compilation: {e}")
raise e

# Move the compiled binary to the correct location for packaging
compiled_binary = os.path.join('src', 'yacht', 'run_yacht_train_core')
if os.path.exists(compiled_binary):
# Move the compiled binary files to the correct location for packaging
compiled_binary1 = os.path.join('src', 'yacht', 'yacht_train_core')
compiled_binary2 = os.path.join('src', 'yacht', 'yacht_run_compute_similarity')
if os.path.exists(compiled_binary1):
destination = os.path.join(self.build_lib, 'yacht')
os.makedirs(destination, exist_ok=True)
shutil.move(compiled_binary, destination)
shutil.move(compiled_binary1, destination)
else:
print("Compiled binary not found after build step.")
raise FileNotFoundError("The executable 'run_yacht_train_core' was not generated successfully.")
raise FileNotFoundError("The executable 'yacht_train_core' was not generated successfully.")

if os.path.exists(compiled_binary2):
destination = os.path.join(self.build_lib, 'yacht')
os.makedirs(destination, exist_ok=True)
shutil.move(compiled_binary2, destination)
else:
print("Compiled binary not found after build step.")
raise FileNotFoundError("The executable 'yacht_run_compute_similarity' was not generated successfully.")

# Run the usual build_ext logic (necessary to continue with setuptools)
super().run()
Expand Down
Loading