Skip to content

Commit

Permalink
[INFRA] Update raptor to the latest main in the HIBF lib and chopper. (
Browse files Browse the repository at this point in the history
…#429)

* [INFRA] Update raptor to the latest main in the HIBF lib and chopper.

* more

* fix
  • Loading branch information
smehringer committed Aug 15, 2024
1 parent cd2b90f commit 2f15084
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 31 deletions.
4 changes: 2 additions & 2 deletions cmake/package-lock.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# This file should be committed to version control

# hibf
set (RAPTOR_HIBF_VERSION 2ee8fa371f20cfc170ccf01bc3d50fce1ecd22fa)
set (RAPTOR_HIBF_VERSION ed7fc7126375f350d886bb09daa14f26b2b9d356)
CPMDeclarePackage (hibf
NAME hibf
GIT_TAG ${RAPTOR_HIBF_VERSION}
Expand Down Expand Up @@ -36,7 +36,7 @@ CPMDeclarePackage (seqan3
OPTIONS "INSTALL_SEQAN3 OFF" "CMAKE_MESSAGE_LOG_LEVEL WARNING"
)
# chopper
set (RAPTOR_CHOPPER_VERSION 40b79a02a44d66bc0bd98d50e731a93ab38e96f5)
set (RAPTOR_CHOPPER_VERSION f48073b8b440b30f46075a31aaeee3818e180cd6)
CPMDeclarePackage (chopper
NAME chopper
GIT_TAG ${RAPTOR_CHOPPER_VERSION}
Expand Down
30 changes: 2 additions & 28 deletions src/layout/raptor_layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@
* \author Enrico Seiler <enrico.seiler AT fu-berlin.de>
*/

#include <chopper/input_functor.hpp>
#include <chopper/layout/execute.hpp>
#include <chopper/chopper_layout.hpp>
#include <chopper/set_up_parser.hpp>
#include <chopper/sketch/check_filenames.hpp>
#include <chopper/sketch/read_data_file.hpp>

#include <raptor/argument_parsing/init_shared_meta.hpp>

Expand All @@ -27,30 +24,7 @@ void chopper_layout(sharg::parser & parser)
parser.info.author = "Svenja Mehringer";
parser.info.email = "svenja.mehringer@fu-berlin.de";

parser.parse();

if (!parser.is_option_set("window"))
config.window_size = config.k;
else if (config.k > config.window_size)
throw sharg::parser_error{"The k-mer size cannot be bigger than the window size."};

config.disable_sketch_output = !parser.is_option_set("output-sketches-to");

if (std::filesystem::is_empty(config.data_file))
throw sharg::parser_error{"The input file is empty."};

std::vector<std::vector<std::string>> filenames{};
chopper::sketch::read_data_file(config, filenames);

chopper::sketch::check_filenames(filenames, config);

config.hibf_config.input_fn = chopper::input_functor{.filenames = filenames,
.input_are_precomputed_files = config.precomputed_files,
.kmer_size = config.k,
.window_size = config.window_size};
config.hibf_config.number_of_user_bins = filenames.size();

chopper::layout::execute(config, filenames);
chopper::chopper_layout(config, parser);
}

} // namespace raptor
2 changes: 1 addition & 1 deletion test/unit/cli/argument_parsing/options_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ TEST_F(argparse_layout, no_bins_in_file)
{
cli_test_result const result = execute_app("raptor", "layout", "--input", tmp_bin_list_empty);
EXPECT_EQ(result.out, std::string{});
EXPECT_EQ(result.err, std::string{"[Error] The input file is empty.\n"});
EXPECT_EQ(result.err, "[Error] The file " + tmp_bin_list_empty.string() + " appears to be empty.\n");
RAPTOR_ASSERT_FAIL_EXIT(result);
}

Expand Down

0 comments on commit 2f15084

Please sign in to comment.