Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
686d028
linting config files: adding and updating
andrewdavidsmith Dec 5, 2025
0f4c5fc
cmake/static_analysis.cmake and cmake/FindHTSLIB.cmake: adding cmake …
andrewdavidsmith Dec 5, 2025
7352e80
src/bam_record_utils.hcpp: linting
andrewdavidsmith Dec 5, 2025
13a0553
src/CLI11.hpp: adding CLI11
andrewdavidsmith Dec 5, 2025
89d9289
src/load_data_for_complexity.cpp: linting
andrewdavidsmith Dec 5, 2025
dbddb7e
switching to CLI11
andrewdavidsmith Dec 5, 2025
bb1e19d
src/common.hcpp: formatting and adding some utilities
andrewdavidsmith Dec 5, 2025
7bbbc44
src/continued_fraction.hcpp: linting
andrewdavidsmith Dec 5, 2025
5cc36ee
src/moment_sequence.hcpp: linting
andrewdavidsmith Dec 5, 2025
6bdb215
src/preseq.cpp: iwyu and formatting
andrewdavidsmith Dec 5, 2025
111ae40
src/bamxx and src/smithlab_cpp: updating submodules
andrewdavidsmith Dec 5, 2025
5c19dd0
data/config.h.in: adding this for cmake builds
andrewdavidsmith Dec 5, 2025
b92450f
CMakeLists.txt src/CMakeLists.txt: adding cmake stuff
andrewdavidsmith Dec 5, 2025
752d6ec
src/CMakeLists.txt: htslib stuff is only included in build if htslib …
andrewdavidsmith Dec 5, 2025
9060f06
src/CMakeLists.txt: removing requirement on particular version for ht…
andrewdavidsmith Dec 5, 2025
02ed726
src/bound_pop.cpp: linting and formatting help output
andrewdavidsmith Dec 5, 2025
ec00148
src/c_curve.cpp: linting and formatting help output
andrewdavidsmith Dec 5, 2025
67ee2d3
src/common.hpp: linting and deadcode
andrewdavidsmith Dec 5, 2025
40e2633
src/gc_extrap.cpp: linting and formatting help output
andrewdavidsmith Dec 5, 2025
e0593dd
src/pop_size.cpp: linting and formatting help output
andrewdavidsmith Dec 5, 2025
2d2f554
src/lc_extrap.cpp: linting and formatting help output
andrewdavidsmith Dec 5, 2025
6bbd303
src/load_data_for_complexity.cpp: linting
andrewdavidsmith Dec 5, 2025
1d64343
src/preseq.cpp: fixing the args passed to subcommands
andrewdavidsmith Dec 5, 2025
5e924e7
tests/scripts several scripts: updating args to have -i explicit
andrewdavidsmith Dec 5, 2025
3d339d8
src/CLI11/CLI11.hpp: moving file
andrewdavidsmith Dec 5, 2025
f59363d
Adding license and cpplint config for cli11
andrewdavidsmith Dec 5, 2025
31994a0
.cppcheck_suppress: adding CLI11.hpp to suppression list
andrewdavidsmith Dec 6, 2025
9cbc563
src/bound_pop.cpp: linting
andrewdavidsmith Dec 6, 2025
4ed726b
src/c_curve.cpp: linting
andrewdavidsmith Dec 6, 2025
8ca97eb
src/common.hcpp: linting
andrewdavidsmith Dec 6, 2025
d0dbcb4
multiple sources: linting
andrewdavidsmith Dec 6, 2025
51b4ebe
src/load_data_for_complexity.cpp: linting
andrewdavidsmith Dec 6, 2025
2289cfe
src/load_data_for_complexity.cpp: fixing do-while loops
andrewdavidsmith Dec 11, 2025
8d72975
src/load_data_for_complexity.cpp: cleanup
andrewdavidsmith Dec 11, 2025
53bc550
src/dnmt_error.hpp: no longer needed
andrewdavidsmith Dec 11, 2025
7ab093d
src/bam_record_utils.hcpp: linting
andrewdavidsmith Dec 11, 2025
24b518f
.clang-format-ignore: adding
andrewdavidsmith Dec 11, 2025
99700c4
src/smithlab_cpp: removing submodule
andrewdavidsmith Dec 11, 2025
7bd447c
.gitmodules: removing smithlab_cpp
andrewdavidsmith Dec 11, 2025
b64c015
src/Interval6.hcpp: adding
andrewdavidsmith Dec 11, 2025
9e8e149
src/CMakeLists.txt: removing smithlab_cpp and adding Interval6
andrewdavidsmith Dec 11, 2025
55c6047
multiple sources: renaming functions
andrewdavidsmith Dec 11, 2025
9f60d2f
src/load_data_for_complexity.hcpp: some simplification
andrewdavidsmith Dec 11, 2025
245abed
src/gc_extrap.cpp: removed option for input being MappedRead format
andrewdavidsmith Dec 11, 2025
0b6ea90
Makefile.am: removing smithlab_cpp and adding Interval6
andrewdavidsmith Dec 12, 2025
60139e7
configure.ac: removing smithlab_cpp and updating the input test mr fi…
andrewdavidsmith Dec 12, 2025
06d0f9a
tests/scripts/test_gc_extrap.test: updating the input file name
andrewdavidsmith Dec 12, 2025
5004a5e
src/gc_extrap.cpp: fixing typo
andrewdavidsmith Dec 12, 2025
8f7bc67
src/load_data_for_complexity.cpp: modernizing
andrewdavidsmith Dec 12, 2025
42789b1
src/load_data_for_complexity.cpp: tweak
andrewdavidsmith Dec 12, 2025
ef37269
src/load_data_for_complexity.hcpp and all main sources: returning tup…
andrewdavidsmith Dec 12, 2025
f9ae676
src/Interval6.hcpp and src/load_data_for_complexity.cpp: linting
andrewdavidsmith Dec 12, 2025
37d7ee6
src/Makefile: removing
andrewdavidsmith Dec 12, 2025
e9a6f20
Makefile: removing
andrewdavidsmith Dec 12, 2025
6c11b87
all subcommand headers: adding a namespace to wrap a main and to hold…
andrewdavidsmith Dec 13, 2025
074facd
src/common.hcpp: mmodernizing and fixing name of log factorial function
andrewdavidsmith Dec 13, 2025
f901dc1
src/preseq.cpp: changing to use CLI11 for the subcommands. Nice!
andrewdavidsmith Dec 13, 2025
afedffa
src all command sources: using the main function in each case from th…
andrewdavidsmith Dec 13, 2025
c9742e7
src/lnfact.hpp: adding faster log factorial function
andrewdavidsmith Dec 13, 2025
1422a15
src/common.hcpp: changing the log factorial to use a table since it's…
andrewdavidsmith Dec 13, 2025
e1cbbeb
src/load_data_for_complexity.hcpp: adding a function to check if the …
andrewdavidsmith Dec 13, 2025
10c2cf0
src/load_data_for_complexity.hcpp: added helper functions to deduce i…
andrewdavidsmith Dec 13, 2025
06228f3
src/nlohmann/json.hpp: adding json support
andrewdavidsmith Dec 13, 2025
79e27a4
data/LICENSES.inc.in and data/LICENSE: adding full licenses for pre-b…
andrewdavidsmith Dec 13, 2025
92f18eb
.clang-format-ignore: ignoring json.hpp
andrewdavidsmith Dec 13, 2025
1cf962b
.clang-format: no auto-formatting comments
andrewdavidsmith Dec 13, 2025
b2f7a16
.cppcheck_suppress: don't check json.hpp
andrewdavidsmith Dec 13, 2025
de7f45f
src/moment_sequence.hcpp: formatting
andrewdavidsmith Dec 13, 2025
7648aca
src/bound_pop.cpp: refactoring and outputting moments info in json fo…
andrewdavidsmith Dec 13, 2025
a34dbc1
src/c_curve.cpp: refactoring how input is read
andrewdavidsmith Dec 13, 2025
7cee97e
src/lc_extrap.cpp: refactoring how input is read
andrewdavidsmith Dec 13, 2025
794ee58
src/preseq.cpp: allowing for embedding license info in the built binary
andrewdavidsmith Dec 13, 2025
3884690
src/gc_extrap.cpp: refactoring including how input is read
andrewdavidsmith Dec 13, 2025
a6e7a1c
src/pop_size.cpp: refactoring how input is read
andrewdavidsmith Dec 13, 2025
8e1574d
src/load_data_for_complexity.cpp: linting
andrewdavidsmith Dec 13, 2025
b514a9c
configure.ac: making htslib on by default and adding check for libdef…
andrewdavidsmith Dec 24, 2025
7bcf82e
src/c_curve.cpp: updating args with default values
andrewdavidsmith Dec 24, 2025
ca11a12
src/common.cpp: requiring an output file in writing ptredicted comple…
andrewdavidsmith Dec 24, 2025
aac09d4
src/gc_extrap.cpp: updating default arg values
andrewdavidsmith Dec 24, 2025
a637851
src/lc_extrap.cpp: updating default arg values and arg flags for cons…
andrewdavidsmith Dec 24, 2025
fd317a4
documentation/README.md: update
andrewdavidsmith Dec 24, 2025
01ee79a
tests/data/gc_extrap_input.mr to bed: changing file format
andrewdavidsmith Dec 24, 2025
0b37c54
Makefile.am: renaming test data file
andrewdavidsmith Dec 24, 2025
e47f668
configure.ac: fixing type
andrewdavidsmith Dec 24, 2025
262272d
m4/ax_pthread.m4: adding macro to find the proper threads lib
andrewdavidsmith Dec 24, 2025
dddd4f0
Makefile.am: ENABLE_HTS to ENABLE_HTSLIB
andrewdavidsmith Dec 24, 2025
be82d67
configure.ac: more detailed config...
andrewdavidsmith Dec 24, 2025
a28a192
configure.ac: adding checks for additional dependencies when building…
andrewdavidsmith Dec 24, 2025
f8cb361
src/nlohmann/LICENSE: adding license
andrewdavidsmith Dec 24, 2025
4153529
src/nlohmann/CPPLINT.cfg: adding CPPLINT.cfg to disable cpplint
andrewdavidsmith Dec 24, 2025
041de2b
linting
andrewdavidsmith Dec 24, 2025
f14a34f
adding include guard
andrewdavidsmith Dec 24, 2025
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
19 changes: 2 additions & 17 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
# This file is part of preseq
#
# Copyright (C) 2024: Andrew D. Smith
#
# Authors: Andrew D. Smith
#
# This is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.

BasedOnStyle: LLVM
ColumnLimit: 80
IndentWidth: 2
AlwaysBreakAfterReturnType: TopLevel
AlwaysBreakAfterReturnType: All
ContinuationIndentWidth: 2
ConstructorInitializerIndentWidth: 2
BraceWrapping:
Expand All @@ -26,3 +10,4 @@ BraceWrapping:
BreakBeforeBraces: Custom
BreakConstructorInitializers: AfterColon
SpacesBeforeTrailingComments: 2
ReflowComments: false
2 changes: 2 additions & 0 deletions .clang-format-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
src/CLI11/CLI11.hpp
src/nlohmann/json.hpp
31 changes: 31 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Checks: 'cert-*,cppcoreguidelines-*,performance-*,clang-diagnostic-*,clang-analyzer-*,-clang-diagnostic-unqualified-std-cast-call,-clang-diagnostic-unknown-warning-option,-clang-analyzer-unix.BlockInCriticalSection,-cppcoreguidelines-pro-type-vararg'
WarningsAsErrors: '*'
HeaderFileExtensions:
- ''
- h
- hh
- hpp
- hxx
ImplementationFileExtensions:
- c
- cc
- cpp
- cxx
HeaderFilterRegex: ''
ExcludeHeaderFilterRegex: 'OptionParser.hpp'
FormatStyle: none
CheckOptions:
cert-dcl16-c.NewSuffixes: 'L;LL;LU;LLU'
cert-err33-c.AllowCastToVoid: 'true'
cert-err33-c.CheckedFunctions: '::aligned_alloc;::asctime_s;::at_quick_exit;::atexit;::bsearch;::bsearch_s;::btowc;::c16rtomb;::c32rtomb;::calloc;::clock;::cnd_broadcast;::cnd_init;::cnd_signal;::cnd_timedwait;::cnd_wait;::ctime_s;::fclose;::fflush;::fgetc;::fgetpos;::fgets;::fgetwc;::fopen;::fopen_s;::fprintf;::fprintf_s;::fputc;::fputs;::fputwc;::fputws;::fread;::freopen;::freopen_s;::fscanf;::fscanf_s;::fseek;::fsetpos;::ftell;::fwprintf;::fwprintf_s;::fwrite;::fwscanf;::fwscanf_s;::getc;::getchar;::getenv;::getenv_s;::gets_s;::getwc;::getwchar;::gmtime;::gmtime_s;::localtime;::localtime_s;::malloc;::mbrtoc16;::mbrtoc32;::mbsrtowcs;::mbsrtowcs_s;::mbstowcs;::mbstowcs_s;::memchr;::mktime;::mtx_init;::mtx_lock;::mtx_timedlock;::mtx_trylock;::mtx_unlock;::printf_s;::putc;::putwc;::raise;::realloc;::remove;::rename;::scanf;::scanf_s;::setlocale;::setvbuf;::signal;::snprintf;::snprintf_s;::sprintf;::sprintf_s;::sscanf;::sscanf_s;::strchr;::strerror_s;::strftime;::strpbrk;::strrchr;::strstr;::strtod;::strtof;::strtoimax;::strtok;::strtok_s;::strtol;::strtold;::strtoll;::strtoul;::strtoull;::strtoumax;::strxfrm;::swprintf;::swprintf_s;::swscanf;::swscanf_s;::thrd_create;::thrd_detach;::thrd_join;::thrd_sleep;::time;::timespec_get;::tmpfile;::tmpfile_s;::tmpnam;::tmpnam_s;::tss_create;::tss_get;::tss_set;::ungetc;::ungetwc;::vfprintf;::vfprintf_s;::vfscanf;::vfscanf_s;::vfwprintf;::vfwprintf_s;::vfwscanf;::vfwscanf_s;::vprintf_s;::vscanf;::vscanf_s;::vsnprintf;::vsnprintf_s;::vsprintf;::vsprintf_s;::vsscanf;::vsscanf_s;::vswprintf;::vswprintf_s;::vswscanf;::vswscanf_s;::vwprintf_s;::vwscanf;::vwscanf_s;::wcrtomb;::wcschr;::wcsftime;::wcspbrk;::wcsrchr;::wcsrtombs;::wcsrtombs_s;::wcsstr;::wcstod;::wcstof;::wcstoimax;::wcstok;::wcstok_s;::wcstol;::wcstold;::wcstoll;::wcstombs;::wcstombs_s;::wcstoul;::wcstoull;::wcstoumax;::wcsxfrm;::wctob;::wctrans;::wctype;::wmemchr;::wprintf_s;::wscanf;::wscanf_s;'
cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField: 'false'
cert-str34-c.DiagnoseSignedUnsignedCharComparisons: 'false'
cppcoreguidelines-non-private-member-variables-in-classes.IgnorePublicMemberVariables: 'true'
google-readability-braces-around-statements.ShortStatementLines: '1'
google-readability-function-size.StatementThreshold: '800'
google-readability-namespace-comments.ShortNamespaceLines: '10'
google-readability-namespace-comments.SpacesBeforeComments: '2'
llvm-else-after-return.WarnOnConditionVariables: 'false'
llvm-else-after-return.WarnOnUnfixable: 'false'
llvm-qualified-auto.AddConstToQualified: 'false'
SystemHeaders: 'false'
21 changes: 16 additions & 5 deletions .cppcheck_suppress
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is part of preseq
#
# Copyright (C) 2024: Andrew D. Smith
# Copyright (C) 2024-2025 Andrew D. Smith
#
# Authors: Andrew D. Smith
#
Expand All @@ -17,7 +17,18 @@
missingIncludeSystem
constVariablePointer
checkersReport
unusedFunction:src/bam_record_utils.hpp
unusedFunction:src/bam_record_utils.cpp
*:src/smithlab_cpp*
unusedStructMember:src/*.hpp
unknownMacro
unmatchedSuppression
# Ignore unused function because it's too hard to get right
unusedFunction
# Ignore unused struct member because this won't go unnoticed anyway
unusedStructMember
# Ignore missing includes because if they are real things won't build
missingInclude
# Exclude external files
*:*CLI11.hpp
*:*json.hpp
# Problem caused by external files
toomanyconfigs
# More problems caused by external files -- with too many ifdefs
normalCheckLevelMaxBranches
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[submodule "preseqR"]
path = preseqR
url = ../preseqR.git
[submodule "src/smithlab_cpp"]
path = src/smithlab_cpp
url = ../smithlab_cpp.git
[submodule "src/bamxx"]
path = src/bamxx
url = ../bamxx.git
55 changes: 55 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright (C) 2025 Andrew D Smith
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <https://www.gnu.org/licenses/>.

# to find the version of cmake do
# $ cmake --version
cmake_minimum_required(VERSION 3.30)
project(
preseq
VERSION 3.2.0
DESCRIPTION
"predict properties of genomic sequencing libraries"
HOMEPAGE_URL https://github.com/smithlabcode/preseq
LANGUAGES CXX)

# Set language version used
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED yes)
set(CMAKE_CXX_EXTENSIONS off) # prevents std=gnu++17
set(CMAKE_EXPORT_COMPILE_COMMANDS on)

include(CheckIncludeFileCXX)
include(CheckFunctionExists)
include(CheckCXXCompilerFlag)

include(GNUInstallDirs)

configure_file(data/config.h.in config.h)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

add_compile_options(
-Wall
-Wextra
-Wpedantic
-Werror
-Wfatal-errors
)

if(STATIC_ANALYSIS)
include(cmake/static_analysis.cmake)
endif()

add_subdirectory(src)
24 changes: 12 additions & 12 deletions CPPLINT.cfg
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
# This file is part of preseq
#
# Copyright (C) 2024: Andrew D. Smith
# Copyright (C) 2023-2025 Andrew D. Smith
#
# Authors: Andrew D. Smith
# This is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This software is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.

# This software is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
set noparent
filter=-runtime/references
filter=-build/include_subdir
Expand All @@ -26,3 +23,6 @@ filter=-whitespace/newline
filter=-readability/braces
filter=-whitespace/semicolon
filter=-whitespace/indent
filter=-whitespace/braces
filter=-whitespace/parens
filter=-readability/nolint
32 changes: 0 additions & 32 deletions Makefile

This file was deleted.

34 changes: 16 additions & 18 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
# This file is part of preseq
#
# Copyright (C) 2018-2024: Andrew D. Smith
# Copyright (C) 2018-2025: Andrew D. Smith
#
# Authors: Andrew D. Smith
#
# This is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This software is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
# This software is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.

ACLOCAL_AMFLAGS = -I m4

SUBDIRS := src/smithlab_cpp
install installdirs: SUBDIRS := $(filter-out src/smithlab_cpp, $(SUBDIRS))
AM_CPPFLAGS = -I $(top_srcdir)/src/smithlab_cpp
if ENABLE_HTS
AM_CPPFLAGS =
if ENABLE_HTSLIB
AM_CPPFLAGS += -I $(top_srcdir)/src/bamxx
endif

AM_CPPFLAGS += -Wall -Wextra -Wpedantic -Wno-unknown-attributes
if ENABLE_HTS
if ENABLE_HTSLIB
AM_CPPFLAGS += -DHAVE_HTSLIB
endif

Expand All @@ -36,7 +34,7 @@ EXTRA_DIST = \
docs \
tests/md5sum.txt \
tests/data/lc_extrap_input.vals \
tests/data/gc_extrap_input.mr \
tests/data/gc_extrap_input.bed \
tests/data/c_curve_input.hist \
tests/scripts/test_c_curve.test \
tests/scripts/test_gc_extrap.test \
Expand All @@ -49,8 +47,6 @@ TESTS = \

TEST_EXTENSIONS = .test

LDADD = src/smithlab_cpp/libsmithlab_cpp.a

bin_PROGRAMS = preseq

preseq_SOURCES = \
Expand All @@ -71,10 +67,12 @@ preseq_SOURCES = \
src/continued_fraction.cpp \
src/load_data_for_complexity.hpp \
src/load_data_for_complexity.cpp \
src/Interval6.hpp \
src/Interval6.cpp \
src/moment_sequence.hpp \
src/moment_sequence.cpp

if ENABLE_HTS
if ENABLE_HTSLIB
preseq_SOURCES += \
src/bamxx/bamxx.hpp \
src/bam_record_utils.hpp \
Expand Down
Loading