Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 11 additions & 3 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,18 @@ IncludeCategories:
Priority: 1
- Regex: '(<[[:alnum:]._]+>)'
Priority: 2
- Regex: '<sharg/'
- Regex: '<fmt/'
Priority: 3
- Regex: '<seqan3/'
- Regex: '<sharg/'
Priority: 4
- Regex: '.*'
- Regex: '<seqan3/'
Priority: 5
- Regex: '<hibf/'
Priority: 6
- Regex: '<fmindex-collection/'
Priority: 7
- Regex: '.*'
Priority: 8
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentAccessModifiers: false
Expand Down Expand Up @@ -240,4 +246,6 @@ TabWidth: 4
UseTab: Never
VerilogBreakBetweenInstancePorts: true
WhitespaceSensitiveMacros:
- SEQAN3_WORKAROUND_GCC_BOGUS_MEMCPY_START
- SEQAN3_WORKAROUND_GCC_BOGUS_MEMCPY_STOP
...
6 changes: 5 additions & 1 deletion .github/workflows/ci_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,14 @@ jobs:
strategy:
fail-fast: false
matrix:
compiler: ["clang-latest", "clang-second-latest", "clang-third-latest", "gcc-latest", "gcc-second-latest", "gcc-third-latest", "intel"]
compiler: ["clang-latest", "clang-second-latest", "gcc-latest", "gcc-second-latest", "gcc-third-latest", "intel"]
include:
- compiler: "intel"
cxx_flags: "-fp-model=strict -Wno-overriding-option"
- compiler: "gcc-latest"
cxx_flags: "-Wno-stringop-overflow"
- compiler: "gcc-second-latest"
cxx_flags: "-Wno-stringop-overflow"
container:
image: ghcr.io/seqan/${{ matrix.compiler }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
fail-fast: false
matrix:
compiler: ["clang-latest", "clang-second-latest", "clang-third-latest", "gcc-latest", "gcc-second-latest", "gcc-third-latest"]
compiler: ["clang-latest", "clang-second-latest", "gcc-latest", "gcc-second-latest", "gcc-third-latest"]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
# SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
# SPDX-License-Identifier: CC0-1.0
# SPDX-License-Identifier: BSD-3-Clause

cmake_minimum_required (VERSION 3.25)

Expand Down Expand Up @@ -31,9 +31,11 @@ CPMGetPackage (use_ccache) # Speeds up compilation by caching files that have be
# Comment/Uncomment entries as needed.
# If you change something here, make sure to add/remove the target in target_link_libraries of src/CMakeLists.txt.
CPMGetPackage (fmindex) # FM-Index
CPMGetPackage (fmt) # Formatting
CPMGetPackage (hibf) # (Hierarchical) Interleaved Bloom Filter
CPMGetPackage (seqan3) # Sequence analysis
CPMGetPackage (sharg) # Argument parser
CPMGetPackage (thresholding) # Thresholding (requires seqan3 to be present)

# Add the application. This will include `src/CMakeLists.txt`.
add_subdirectory (src)
Expand Down
4 changes: 3 additions & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
In our project, we have adopted the use of SPDX identifiers to specify the license under which each file is provided.
In FPGAlign, we have adopted the use of SPDX identifiers to specify the license under which each file is provided.

This approach simplifies the process of license declaration as it replaces the full license text with a single line
identifier. The SPDX identifier is a globally recognized standard that allows for easy identification and understanding
of the license. This means that each file in our project will have a license identifier at the top, making it clear
under which license the file is provided. For more information about the specific licenses, you can refer to the
[SPDX License List](https://spdx.org/licenses/).

For the purpose of referring to a singular license, FPGAlign is licensed under BSD-3-Clause.
11 changes: 11 additions & 0 deletions LICENSES/BSD-3-Clause.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Copyright (c) <year> <owner>.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2 changes: 1 addition & 1 deletion cmake/cxx_config.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
# SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
# SPDX-License-Identifier: CC0-1.0
# SPDX-License-Identifier: BSD-3-Clause

if (NOT DEFINED CMAKE_CXX_STANDARD)
set (CMAKE_CXX_STANDARD 23)
Expand Down
2 changes: 1 addition & 1 deletion cmake/output_directories.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
# SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
# SPDX-License-Identifier: CC0-1.0
# SPDX-License-Identifier: BSD-3-Clause

set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
Expand Down
35 changes: 28 additions & 7 deletions cmake/package-lock.cmake
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# SPDX-FileCopyrightText: 2006-2025, Knut Reinert & Freie Universität Berlin
# SPDX-FileCopyrightText: 2016-2025, Knut Reinert & MPI für molekulare Genetik
# SPDX-License-Identifier: CC0-1.0
# SPDX-License-Identifier: BSD-3-Clause

# CPM Package Lock (https://github.com/cpm-cmake/CPM.cmake)
# This file should be committed to version control

# cmake-format: off

# hibf
set (HIBF_VERSION 36c223527d7d4eb2bcdcd88d47c71984f50a00a3 CACHE STRING "" FORCE)
set (HIBF_VERSION 36c223527d7d4eb2bcdcd88d47c71984f50a00a3 CACHE STRING "")
CPMDeclarePackage (hibf
NAME hibf
GIT_TAG ${HIBF_VERSION} # main
Expand All @@ -19,7 +19,7 @@ CPMDeclarePackage (hibf
)

# sharg
set (SHARG_VERSION be113bcffe49c0d62cbd65a191820f05386aa8da CACHE STRING "" FORCE)
set (SHARG_VERSION be113bcffe49c0d62cbd65a191820f05386aa8da CACHE STRING "")
CPMDeclarePackage (sharg
NAME sharg
GIT_TAG ${SHARG_VERSION} # main
Expand All @@ -30,7 +30,7 @@ CPMDeclarePackage (sharg
)

# seqan3
set (SEQAN3_VERSION 6dfa1b442d1fabd07024edcc37a29b61d5beae8f CACHE STRING "" FORCE)
set (SEQAN3_VERSION 6dfa1b442d1fabd07024edcc37a29b61d5beae8f CACHE STRING "")
CPMDeclarePackage (seqan3
NAME seqan3
GIT_TAG ${SEQAN3_VERSION} # main
Expand All @@ -40,8 +40,20 @@ CPMDeclarePackage (seqan3
OPTIONS "INSTALL_SEQAN3 OFF" "CMAKE_MESSAGE_LOG_LEVEL WARNING"
)

# fmt
set (FMT_VERSION 11.2.0 CACHE STRING "")
CPMDeclarePackage (fmt
NAME fmt
VERSION ${FMT_VERSION}
GIT_TAG ${FMT_VERSION}
GITHUB_REPOSITORY fmtlib/fmt
SYSTEM TRUE
EXCLUDE_FROM_ALL TRUE
OPTIONS "CMAKE_MESSAGE_LOG_LEVEL WARNING" "FMT_INSTALL OFF"
)

# fmindex
set (FMINDEX_VERSION 7ed8c3a6035a898f3e9574c5aa96af8b74ca6ef4 CACHE STRING "" FORCE)
set (FMINDEX_VERSION 7ed8c3a6035a898f3e9574c5aa96af8b74ca6ef4 CACHE STRING "")
CPMDeclarePackage (fmindex
NAME fmindex
GIT_TAG ${FMINDEX_VERSION} # main
Expand All @@ -52,7 +64,7 @@ CPMDeclarePackage (fmindex
)

# googletest
set (GOOGLETEST_VERSION 1.17.0 CACHE STRING "" FORCE)
set (GOOGLETEST_VERSION 1.17.0 CACHE STRING "")
CPMDeclarePackage (googletest
NAME GTest
VERSION ${GOOGLETEST_VERSION}
Expand All @@ -63,7 +75,7 @@ CPMDeclarePackage (googletest
)

# use_ccache
set (USE_CCACHE_VERSION d2a54ef555b6fc2d496a4c9506dbeb7cf899ce37 CACHE STRING "" FORCE)
set (USE_CCACHE_VERSION d2a54ef555b6fc2d496a4c9506dbeb7cf899ce37 CACHE STRING "")
CPMDeclarePackage (use_ccache
NAME use_ccache
GIT_TAG ${USE_CCACHE_VERSION} # main
Expand All @@ -73,4 +85,13 @@ CPMDeclarePackage (use_ccache
EXCLUDE_FROM_ALL TRUE
)

# thresholding
CPMDeclarePackage (thresholding
NAME thresholding
URL "${PROJECT_SOURCE_DIR}/contrib/threshold.tar.gz"
URL_HASH SHA256=4990c7fb9778a2fb8a19794b966d57496ca77bcd708b4cee3c93eea6e5b67d80
SYSTEM TRUE
EXCLUDE_FROM_ALL TRUE
)

# cmake-format: on
4 changes: 2 additions & 2 deletions cmake/test/add_local_data.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
# SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
# SPDX-License-Identifier: CC0-1.0
# SPDX-License-Identifier: BSD-3-Clause

set (DATASOURCES_DATA_DIR "${FPGAlign_SOURCE_DIR}/test/data")

Expand All @@ -22,7 +22,7 @@ foreach (datasource IN LISTS datasources)
# If a matching file contains `@data_dir@`, it will be replaced with the actual data directory.
# This is useful if you have test files that need to reference the data directory, e.g., a file containing
# paths to other files.
if (FALSE)
if (datasource_name MATCHES ".*\.txt$")
configure_file ("${DATASOURCES_DATA_DIR}/${datasource}" "${data_dir}/${datasource_name}")
else ()
configure_file ("${DATASOURCES_DATA_DIR}/${datasource}" "${data_dir}/${datasource_name}" COPYONLY)
Expand Down
2 changes: 1 addition & 1 deletion cmake/test/config.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
# SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
# SPDX-License-Identifier: CC0-1.0
# SPDX-License-Identifier: BSD-3-Clause

list (APPEND CMAKE_CTEST_ARGUMENTS "--output-on-failure") # Must be before `enable_testing ()`.
list (APPEND CMAKE_CTEST_ARGUMENTS "--no-tests=error") # Must be before `enable_testing ()`.
Expand Down
2 changes: 1 addition & 1 deletion cmake/test/declare_datasource.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
# SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
# SPDX-License-Identifier: CC0-1.0
# SPDX-License-Identifier: BSD-3-Clause

if (CMAKE_VERSION VERSION_LESS 3.30)
include (ExternalProject)
Expand Down
Binary file added contrib/threshold.tar.gz
Binary file not shown.
3 changes: 3 additions & 0 deletions contrib/threshold.tar.gz.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
SPDX-License-Identifier: BSD-3-Clause
14 changes: 0 additions & 14 deletions include/configuration.hpp

This file was deleted.

15 changes: 0 additions & 15 deletions include/fastq_conversion.hpp

This file was deleted.

24 changes: 24 additions & 0 deletions include/fpgalign/argument_parsing.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause

#pragma once

#include <string>
#include <vector>

#include <fpgalign/config.hpp>

enum class subcommand : uint8_t
{
build,
search
};

struct parse_result
{
subcommand subcmd;
config cfg;
};

parse_result parse_arguments(std::vector<std::string> command_line);
21 changes: 21 additions & 0 deletions include/fpgalign/build/build.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause

#pragma once

#include <string>
#include <vector>

#include <fpgalign/config.hpp>

namespace build
{

std::vector<std::vector<std::string>> parse_input(config const & config);

void build(config const & config);
void ibf(config const & config);
void fmindex(config const & config);

} // namespace build
18 changes: 18 additions & 0 deletions include/fpgalign/colored_strings.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause

#pragma once

#include <string>

struct colored_strings
{
static bool const cerr_is_terminal;

struct cerr
{
static std::string const error;
static std::string const warning;
};
};
22 changes: 22 additions & 0 deletions include/fpgalign/config.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: BSD-3-Clause

#pragma once

#include <filesystem>

struct config
{
uint8_t kmer_size{20u};
uint32_t window_size{kmer_size};

uint8_t hash_count{2u};
double fpr{0.05};

std::filesystem::path input_path{};
std::filesystem::path output_path{};
std::filesystem::path query_path{};
uint8_t errors{};
uint16_t threads{1u};
};
Loading