Skip to content

Commit

Permalink
Merge pull request #261 from EBIvariation/dev/vcf4.4
Browse files Browse the repository at this point in the history
VCF 4.4 Feature branch
  • Loading branch information
tcezard authored Oct 11, 2024
2 parents 1edca3e + 98da794 commit ab34929
Show file tree
Hide file tree
Showing 396 changed files with 41,633 additions and 230,585 deletions.
21 changes: 0 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,13 @@ jobs:
if: ${{ matrix.config.cc == 'gcc' }}
run: |
mv build/bin/vcf_validator vcf_validator_linux
mv build/bin/vcf_debugulator vcf_debugulator_linux
mv build/bin/vcf_assembly_checker vcf_assembly_checker_linux
- name: Upload vcf-validator
uses: actions/upload-artifact@v3
if: ${{ matrix.config.cc == 'gcc' }}
with:
name: vcf_validator_linux
path: vcf_validator_linux
- name: Upload vcf-debugulator
uses: actions/upload-artifact@v3
if: ${{ matrix.config.cc == 'gcc' }}
with:
name: vcf_debugulator_linux
path: vcf_debugulator_linux
- name: Upload vcf-assembly-checker
uses: actions/upload-artifact@v3
if: ${{ matrix.config.cc == 'gcc' }}
Expand Down Expand Up @@ -85,20 +78,13 @@ jobs:
if: ${{ matrix.config.cc == 'clang' }}
run: |
mv build/bin/vcf_validator vcf_validator_macos_x64
mv build/bin/vcf_debugulator vcf_debugulator_macos_x64
mv build/bin/vcf_assembly_checker vcf_assembly_checker_macos_x64
- name: Upload vcf-validator
uses: actions/upload-artifact@v3
if: ${{ matrix.config.cc == 'clang' }}
with:
name: vcf_validator_macos_x64
path: vcf_validator_macos_x64
- name: Upload vcf-debugulator
uses: actions/upload-artifact@v3
if: ${{ matrix.config.cc == 'clang' }}
with:
name: vcf_debugulator_macos_x64
path: vcf_debugulator_macos_x64
- name: Upload vcf-assembly-checker
uses: actions/upload-artifact@v3
if: ${{ matrix.config.cc == 'clang' }}
Expand Down Expand Up @@ -131,20 +117,13 @@ jobs:
if: ${{ matrix.config.cc == 'clang' }}
run: |
mv build/bin/vcf_validator vcf_validator_macos_arm64
mv build/bin/vcf_debugulator vcf_debugulator_macos_arm64
mv build/bin/vcf_assembly_checker vcf_assembly_checker_macos_arm64
- name: Upload vcf-validator
uses: actions/upload-artifact@v3
if: ${{ matrix.config.cc == 'clang' }}
with:
name: vcf_validator_macos_arm64
path: vcf_validator_macos_arm64
- name: Upload vcf-debugulator
uses: actions/upload-artifact@v3
if: ${{ matrix.config.cc == 'clang' }}
with:
name: vcf_debugulator_macos_arm64
path: vcf_debugulator_macos_arm64
- name: Upload vcf-assembly-checker
uses: actions/upload-artifact@v3
if: ${{ matrix.config.cc == 'clang' }}
Expand Down
76 changes: 10 additions & 66 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,13 @@ if (LINUX)
set (EXT_LIB_PATH "/usr/local/bin" CACHE STRING "Absolute path to libraries")
else()
set (EXT_LIB_PATH "${DEFAULT_EXT_LIB_PATH}" CACHE STRING "Absolute path to libraries") # cached: this instruction is ignored if the user provided the variable
set (ODB_PATH "${EXT_LIB_PATH}/odb-2.4.0-x86_64-linux-gnu/bin/" CACHE STRING "Path to odb binaries")
if (EXISTS "${EXT_LIB_PATH}/boost")
set (SELF_COMPILED_BOOST TRUE)
else ()
set (SELF_COMPILED_BOOST FALSE)
endif()
endif()
elseif (OSX)
set (EXT_LIB_PATH "${PROJECT_SOURCE_DIR}/osx_dependencies" CACHE STRING "Absolute path to libraries")
set (ODB_PATH "${EXT_LIB_PATH}/odb-2.4.0-i686-macosx/bin/" CACHE STRING "Path to odb binaries")
if (NOT EXISTS "${EXT_LIB_PATH}")
message(FATAL_ERROR "Please run first install_dependencies.sh osx")
endif()
elseif (WINDOWS)
include_directories (lib/sqlite) # Windows specific
set (EXT_LIB_PATH "${PROJECT_SOURCE_DIR}/lib/windows_specific" CACHE STRING "Absolute path to libraries")
if (NOT EXISTS "${PROJECT_SOURCE_DIR}/windows_dependencies")
message(FATAL_ERROR "Please run first install_dependencies.bat")
Expand All @@ -66,8 +58,8 @@ elseif (WINDOWS)
include_directories (windows_dependencies/curl/include)
endif ()

include_directories ("${EXT_LIB_PATH}")
if (NOT OSX)
include_directories ("${EXT_LIB_PATH}")
include_directories ("${EXT_LIB_PATH}/curl/include")
endif ()

Expand Down Expand Up @@ -106,7 +98,6 @@ find_package (Threads REQUIRED)

if (LINUX OR OSX)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wno-unknown-pragmas") # No unknown pragmas: it's ok that gcc doesn't know about ODB's pragmas
set (CMAKE_C_FLAGS " -DSQLITE_ENABLE_UNLOCK_NOTIFY -DSQLITE_OMIT_LOAD_EXTENSION") # Needed to statically link ODB
if (LINUX AND SELF_COMPILED_BOOST)
set (BOOST_CUSTOM_INCLUDE_DIR ${EXT_LIB_PATH}/boost)
include_directories (${BOOST_CUSTOM_INCLUDE_DIR} )
Expand Down Expand Up @@ -134,7 +125,6 @@ endif ()


# Application modules
add_library (mod_sqlite3 STATIC lib/sqlite/sqlite3.c)

if (LINUX)
set (THIRD_PARTY_LIBRARIES
Expand All @@ -145,65 +135,32 @@ if (LINUX)
${EXT_LIB_PATH}/openssl/lib/libcrypto.a
${EXT_LIB_PATH}/libbz2.a
${EXT_LIB_PATH}/libz.a
${EXT_LIB_PATH}/libodb-sqlite.a
${EXT_LIB_PATH}/libodb.a
mod_sqlite3
${CMAKE_THREAD_LIBS_INIT}
)
elseif (OSX)
set (THIRD_PARTY_LIBRARIES
${Boost_LIBRARIES}
libcurl.a
${EXT_LIB_PATH}/libodb-sqlite.a
${EXT_LIB_PATH}/libodb.a
mod_sqlite3
${CMAKE_THREAD_LIBS_INIT}
)
elseif (WINDOWS)
set (THIRD_PARTY_LIBRARIES
${EXT_LIB_PATH}/odb-sqlite.lib
${EXT_LIB_PATH}/odb.lib
mod_sqlite3
windows_dependencies/curl/lib/libcurl
${CMAKE_THREAD_LIBS_INIT}
)
endif ()

set (MOD_ODB_SOURCES)
set (ODB_MAPPING_CLASSES inc/vcf/error.hpp)
foreach (_file ${ODB_MAPPING_CLASSES})
string (REPLACE ".hpp" "-odb.cpp" gencppfile ${_file})
string (REPLACE "inc" "src" right_place_gencppfile ${gencppfile})
if (LINUX OR OSX)
add_custom_command (
OUTPUT ${CMAKE_HOME_DIRECTORY}/${right_place_gencppfile}
COMMAND cd ${CMAKE_HOME_DIRECTORY}/ && ${ODB_PATH}odb --include-prefix vcf --std c++11 -d sqlite --generate-query --generate-schema
--hxx-suffix .hpp --ixx-suffix .ipp --cxx-suffix .cpp
--output-dir ${CMAKE_HOME_DIRECTORY}/inc/vcf/ ${_file}
&& mv ${CMAKE_HOME_DIRECTORY}/${gencppfile} ${CMAKE_HOME_DIRECTORY}/${right_place_gencppfile}
DEPENDS ${_file}
COMMENT "Building odb for ${_file}"
)
endif ()
list (APPEND MOD_ODB_SOURCES ${right_place_gencppfile})
endforeach ()
add_library (mod_odb STATIC ${MOD_ODB_SOURCES})
target_link_libraries (mod_odb ${THIRD_PARTY_LIBRARIES})

set (MOD_VCF_SOURCES
inc/fasta/faidx.hpp
inc/fasta/fasta.hpp
inc/util/curl_easy.hpp
inc/vcf/assembly_checker.hpp
inc/vcf/assembly_check_report_writer.hpp
inc/vcf/compression.hpp
inc/vcf/debugulator.hpp
inc/vcf/error_policy.hpp
inc/vcf/file_structure.hpp
inc/vcf/fixer.hpp
inc/vcf/meta_entry_visitor.hpp
inc/vcf/normalizer.hpp
inc/vcf/odb_report.hpp
inc/vcf/optional_policy.hpp
inc/vcf/parse_policy.hpp
inc/vcf/parsing_state.hpp
Expand All @@ -216,6 +173,7 @@ set (MOD_VCF_SOURCES
inc/vcf/validator_detail_v41.hpp
inc/vcf/validator_detail_v42.hpp
inc/vcf/validator_detail_v43.hpp
inc/vcf/validator_detail_v44.hpp
inc/vcf/validator.hpp

src/fasta/faidx.cpp
Expand All @@ -224,11 +182,8 @@ set (MOD_VCF_SOURCES
src/vcf/abort_error_policy.cpp
src/vcf/assembly_checker.cpp
src/vcf/compression.cpp
src/vcf/debugulator.cpp
src/vcf/fixer.cpp
src/vcf/meta_entry.cpp
src/vcf/normalizer.cpp
src/vcf/odb_report.cpp
src/vcf/parsing_state.cpp
src/vcf/record.cpp
src/vcf/report_error_policy.cpp
Expand All @@ -238,47 +193,34 @@ set (MOD_VCF_SOURCES
src/vcf/validator.cpp
)
add_library (mod_vcf STATIC ${MOD_VCF_SOURCES})
add_dependencies (mod_vcf mod_odb) # works even without this if we add mod_vcf as target_link_libraries
target_link_libraries (mod_vcf ${THIRD_PARTY_LIBRARIES} mod_odb)
target_link_libraries (mod_vcf ${THIRD_PARTY_LIBRARIES})


# Libraries to link with executables
if (LINUX)
set (LIBRARIES_TO_LINK
mod_vcf
mod_odb
${EXT_LIB_PATH}/curl/lib/libcurl.a
${EXT_LIB_PATH}/c-ares/lib/libcares.a
${EXT_LIB_PATH}/openssl/lib/libssl.a
${EXT_LIB_PATH}/openssl/lib/libcrypto.a
${Boost_LIBRARIES}
${EXT_LIB_PATH}/libbz2.a
${EXT_LIB_PATH}/libz.a
${EXT_LIB_PATH}/libodb-sqlite.a
${EXT_LIB_PATH}/libodb.a
mod_sqlite3
dl
${CMAKE_THREAD_LIBS_INIT}
)
elseif (OSX)
set (LIBRARIES_TO_LINK
mod_vcf
mod_odb
libcurl.a
${Boost_LIBRARIES}
${EXT_LIB_PATH}/libodb-sqlite.a
${EXT_LIB_PATH}/libodb.a
mod_sqlite3
dl
${CMAKE_THREAD_LIBS_INIT}
)
elseif (WINDOWS)
set (LIBRARIES_TO_LINK
mod_vcf
mod_odb
${EXT_LIB_PATH}/odb-sqlite.lib
${EXT_LIB_PATH}/odb.lib
mod_sqlite3
windows_dependencies/curl/lib/libcurl
ws2_32
crypt32
Expand All @@ -293,22 +235,22 @@ endif ()
set (V41_TESTS test/vcf/parser_v41_test.cpp)
set (V42_TESTS test/vcf/parser_v42_test.cpp)
set (V43_TESTS test/vcf/parser_v43_test.cpp)
set (V44_TESTS test/vcf/parser_v44_test.cpp)
set (ALL_TESTS
test/assembly_report/assembly_report_test.cpp
test/fasta/faidx_test.cpp
test/fasta/fasta_test.cpp
test/vcf/assembly_checker_integration_test.cpp
test/vcf/assembly_checker_test.cpp
test/vcf/compressed_file_test.cpp
test/vcf/debugulator_integration_test.cpp
test/vcf/debugulator_test.cpp
test/vcf/metaentry_test.cpp
test/vcf/normalize_test.cpp
test/vcf/optional_policy_test.cpp
test/vcf/parser_test_aux.hpp
test/vcf/parser_v41_test.cpp
test/vcf/parser_v42_test.cpp
test/vcf/parser_v43_test.cpp
test/vcf/parser_v44_test.cpp
test/vcf/predefined_info_tags_test.cpp
test/vcf/predefined_format_tags_test.cpp
test/vcf/record_cache_test.cpp
Expand All @@ -332,6 +274,11 @@ target_link_libraries (test_validator_v43 ${LIBRARIES_TO_LINK})
enable_testing ()
add_test (NAME ValidatorTests_v43 COMMAND test_validator_v43)

add_executable (test_validator_v44 test/main_test.cpp ${V44_TESTS})
target_link_libraries (test_validator_v44 ${LIBRARIES_TO_LINK})
enable_testing ()
add_test (NAME ValidatorTests_v44 COMMAND test_validator_v44)

add_executable (test_validation_suite test/main_test.cpp ${ALL_TESTS})
target_link_libraries (test_validation_suite ${LIBRARIES_TO_LINK})
enable_testing ()
Expand All @@ -342,8 +289,5 @@ add_test (NAME ValidatorTests COMMAND test_validation_suite)
add_executable (vcf_validator src/validator_main.cpp)
target_link_libraries (vcf_validator ${LIBRARIES_TO_LINK})

add_executable (vcf_debugulator src/debugulator_main.cpp)
target_link_libraries (vcf_debugulator ${LIBRARIES_TO_LINK})

add_executable (vcf_assembly_checker src/assembly_checker_main.cpp)
target_link_libraries (vcf_assembly_checker ${LIBRARIES_TO_LINK})
Loading

0 comments on commit ab34929

Please sign in to comment.