Skip to content
Commits on Source (13)
......@@ -16,9 +16,6 @@
[submodule "vendor/rampler"]
path = vendor/rampler
url = https://github.com/rvaser/rampler
[submodule "vendor/logger"]
path = vendor/logger
url = https://github.com/rvaser/logger
[submodule "vendor/ClaraGenomicsAnalysis"]
path = vendor/ClaraGenomicsAnalysis
url = https://github.com/clara-genomics/ClaraGenomicsAnalysis
cmake_minimum_required(VERSION 3.2)
project(racon)
set(racon_version 1.4.7)
set(racon_version 1.4.10)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
......@@ -30,6 +30,7 @@ include_directories(${PROJECT_SOURCE_DIR}/src)
set(racon_sources
src/main.cpp
src/logger.cpp
src/polisher.cpp
src/overlap.cpp
src/sequence.cpp
......@@ -58,9 +59,6 @@ endif()
if (NOT TARGET edlib)
add_subdirectory(vendor/edlib EXCLUDE_FROM_ALL)
endif()
if (NOT TARGET logger)
add_subdirectory(vendor/logger EXCLUDE_FROM_ALL)
endif()
if (racon_enable_cuda)
if (DEFINED CLARAGENOMICSANALYSIS_SDK_PATH)
list(APPEND CMAKE_PREFIX_PATH "${CLARAGENOMICSANALYSIS_SDK_PATH}/cmake")
......@@ -90,7 +88,7 @@ if (racon_enable_cuda)
endif()
endif()
target_link_libraries(racon bioparser spoa thread_pool edlib_static logger)
target_link_libraries(racon bioparser spoa thread_pool edlib_static)
if (racon_enable_cuda)
target_link_libraries(racon cudapoa cudaaligner)
endif()
......@@ -106,6 +104,7 @@ if (racon_build_tests)
set(racon_test_sources
test/racon_test.cpp
src/logger.cpp
src/polisher.cpp
src/overlap.cpp
src/sequence.cpp
......@@ -123,7 +122,7 @@ if (racon_build_tests)
add_subdirectory(vendor/googletest/googletest EXCLUDE_FROM_ALL)
endif()
target_link_libraries(racon_test bioparser spoa thread_pool edlib_static logger gtest_main)
target_link_libraries(racon_test bioparser spoa thread_pool edlib_static gtest_main)
if (racon_enable_cuda)
target_link_libraries(racon_test cudapoa cudaaligner)
endif()
......
racon (1.4.7-1) UNRELEASED; urgency=medium
racon (1.4.10-1) unstable; urgency=medium
* Team upload.
[ Andreas Tille ]
* New upstream version
* debhelper-compat 12
* Standards-Version: 4.4.0
* Build-Depends: liblogger-dev
Closes: #940564
* Point watch file to new location
* New homepage
* Versioned Build-Depends: libthread-pool-dev (>= 2)
* New upstream version
* New upstream version
-- Andreas Tille <tille@debian.org> Wed, 18 Sep 2019 11:43:24 +0200
[ Michael Crusoe ]
* New upstream version Closes: #940564
* Run the tests during the build
* Run the tests as part of 'autopkgtest'ing
-- Michael R. Crusoe <michael.crusoe@gmail.com> Tue, 12 Nov 2019 14:43:58 +0100
racon (1.3.2-1) unstable; urgency=medium
......
......@@ -11,7 +11,6 @@ Build-Depends: debhelper-compat (= 12),
libedlib-dev,
libspoa-dev,
libthread-pool-dev (>= 2),
liblogger-dev,
rampler
Standards-Version: 4.4.0
Vcs-Browser: https://salsa.debian.org/med-team/racon
......@@ -22,6 +21,7 @@ Package: racon
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends}
Recommends: python3
Description: consensus module for raw de novo DNA assembly of long uncorrected reads
Racon is intended as a standalone consensus module to correct raw
contigs generated by rapid assembly methods which do not include a
......
obj-*/bin/racon_test /usr/lib/racon/
scripts/racon_wrapper.py /usr/bin/
From: Michael R. Crusoe <michael.crusoe@gmail.com>
Subject: Mark script as being Python version 3
--- racon.orig/scripts/racon_wrapper.py
+++ racon/scripts/racon_wrapper.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
from __future__ import print_function
import os, sys, time, shutil, argparse, subprocess
From: Michael R. Crusoe <michael.crusoe>
Subject: remove unnecessary __FILE__ reference
It reduces the reproduciblilty of the build
--- racon.orig/src/polisher.cpp
+++ racon/src/polisher.cpp
@@ -143,8 +143,7 @@
#else
fprintf(stderr, "[racon::createPolisher] error: "
"Attemping to use CUDA when CUDA support is not available.\n"
- "Please check logic in %s:%s\n",
- __FILE__, __func__);
+ "Please check logic in scripts/racon_wrapper.py:%s\n", __func__);
exit(1);
#endif
}
--- racon.orig/test/racon_test_config.h.in
+++ racon/test/racon_test_config.h.in
@@ -6,4 +6,4 @@
#include <string>
-const std::string racon_test_data_path = "@racon_test_data_path@";
+const std::string racon_test_data_path = "./data/";
use_debian_packaged_libs.patch
remove_buildpath
py3
......@@ -2,9 +2,9 @@ Author: Andreas Tille <tille@debian.org>
Last-Update: Fri, 08 Jun 2018 13:20:51 +0200
Description: Use Debian packaged libraries
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,21 +46,6 @@ endif()
--- racon.orig/CMakeLists.txt
+++ racon/CMakeLists.txt
@@ -47,18 +47,6 @@
# Add version information to bibary.
target_compile_definitions(racon PRIVATE RACON_VERSION="v${racon_version}")
......@@ -19,25 +19,21 @@ Description: Use Debian packaged libraries
-endif()
-if (NOT TARGET edlib)
- add_subdirectory(vendor/edlib EXCLUDE_FROM_ALL)
-endif()
-if (NOT TARGET logger)
- add_subdirectory(vendor/logger EXCLUDE_FROM_ALL)
-endif()
if (racon_enable_cuda)
if (DEFINED CLARAGENOMICSANALYSIS_SDK_PATH)
list(APPEND CMAKE_PREFIX_PATH "${CLARAGENOMICSANALYSIS_SDK_PATH}/cmake")
@@ -90,7 +75,9 @@ if (racon_enable_cuda)
@@ -88,7 +76,8 @@
endif()
endif()
-target_link_libraries(racon bioparser spoa thread_pool edlib_static logger)
+#set_target_properties(racon PROPERTIES COMPILE_FLAGS -pthread LINK_FLAGS -pthread) # does not work
+target_link_libraries(racon spoa thread_pool edlib logger z)
-target_link_libraries(racon bioparser spoa thread_pool edlib_static)
+target_link_libraries(racon spoa thread_pool edlib z)
+set_target_properties(racon PROPERTIES COMPILE_FLAGS -pthread LINK_FLAGS -pthread)
if (racon_enable_cuda)
target_link_libraries(racon cudapoa cudaaligner)
endif()
@@ -119,11 +106,7 @@ if (racon_build_tests)
@@ -118,11 +107,7 @@
add_executable(racon_test ${racon_test_sources})
endif()
......@@ -45,8 +41,8 @@ Description: Use Debian packaged libraries
- add_subdirectory(vendor/googletest/googletest EXCLUDE_FROM_ALL)
- endif()
-
- target_link_libraries(racon_test bioparser spoa thread_pool edlib_static logger gtest_main)
+ target_link_libraries(racon_test spoa thread_pool pthread edlib logger gtest_main gtest z)
- target_link_libraries(racon_test bioparser spoa thread_pool edlib_static gtest_main)
+ target_link_libraries(racon_test spoa thread_pool pthread edlib gtest_main gtest z)
if (racon_enable_cuda)
target_link_libraries(racon_test cudapoa cudaaligner)
endif()
......@@ -12,3 +12,8 @@ override_dh_auto_configure:
# Somehow the means in the patch for CMakeLists.txt to replace -lpthread by -pthread to not work
# Just hack it here
sed -i 's/-lpthread/-pthread/' obj-*/CMakeFiles/racon_test.dir/link.txt
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
cd test && ../obj-*/bin/racon_test
endif
Test-Command: sh -c "cd /usr/share/doc/racon/examples && /usr/lib/racon/racon_test"
Depends: @
Restrictions: allow-stderr
......@@ -10,11 +10,11 @@
#include <cuda_profiler_api.h>
#include "sequence.hpp"
#include "logger.hpp"
#include "cudapolisher.hpp"
#include <claragenomics/utils/cudautils.hpp>
#include "bioparser/bioparser.hpp"
#include "logger/logger.hpp"
namespace racon {
......
/*!
* @file logger.cpp
*
* @brief Logger source file
*/
#include <iostream>
#include "logger.hpp"
namespace racon {
Logger::Logger()
: time_(0.), bar_(0), time_point_() {
}
Logger::~Logger() {
}
void Logger::log() {
auto now = std::chrono::steady_clock::now();
if (time_point_ != std::chrono::time_point<std::chrono::steady_clock>()) {
time_ += std::chrono::duration_cast<std::chrono::duration<double>>(now - time_point_).count();
}
time_point_ = now;
}
void Logger::log(const std::string& msg) const {
std::cerr << msg << " " << std::fixed
<< std::chrono::duration_cast<std::chrono::duration<double>>(std::chrono::steady_clock::now() - time_point_).count()
<< " s" << std::endl;
}
void Logger::bar(const std::string& msg) {
++bar_;
std::string progress_bar = "[" + std::string(bar_, '=') + (bar_ == 20 ? "" : ">" + std::string(19 - bar_, ' ')) + "]";
std::cerr << msg << " " << progress_bar << " " << std::fixed
<< std::chrono::duration_cast<std::chrono::duration<double>>(std::chrono::steady_clock::now() - time_point_).count()
<< " s";
bar_ %= 20;
if (bar_ == 0) {
std::cerr << std::endl;
} else {
std::cerr << "\r";
}
}
void Logger::total(const std::string& msg) const {
std::cerr << msg << " " << std::fixed
<< time_ + std::chrono::duration_cast<std::chrono::duration<double>>(std::chrono::steady_clock::now() - time_point_).count()
<< " s" << std::endl;
}
}
/*!
* @file logger.hpp
*
* @brief Logger header file
*/
#pragma once
#include <cstdint>
#include <chrono>
#include <string>
namespace racon {
static const std::string version = "v1.0.0";
class Logger {
public:
Logger();
Logger(const Logger&) = default;
Logger& operator=(const Logger&) = default;
Logger(Logger&&) = default;
Logger& operator=(Logger&&) = default;
~Logger();
/*!
* @brief Resets the time point
*/
void log();
/*!
* @brief Prints the elapsed time from last time point to stderr
*/
void log(const std::string& msg) const;
/*!
* @brief Prints a progress bar and the elapsed time from last time to
* stderr (the progress bar resets after 20 calls)
*/
void bar(const std::string& msg);
/*!
* @brief Prints the total elapsed time from the first log() call
*/
void total(const std::string& msg) const;
private:
double time_;
std::uint32_t bar_;
std::chrono::time_point<std::chrono::steady_clock> time_point_;
};
}
......@@ -11,6 +11,7 @@
#include "overlap.hpp"
#include "sequence.hpp"
#include "window.hpp"
#include "logger.hpp"
#include "polisher.hpp"
#ifdef CUDA_ENABLED
#include "cuda/cudapolisher.hpp"
......@@ -19,7 +20,6 @@
#include "bioparser/bioparser.hpp"
#include "thread_pool/thread_pool.hpp"
#include "spoa/spoa.hpp"
#include "logger/logger.hpp"
namespace racon {
......@@ -170,7 +170,7 @@ Polisher::Polisher(std::unique_ptr<bioparser::Parser<Sequence>> sparser,
alignment_engines_(), sequences_(), dummy_quality_(window_length, '!'),
window_length_(window_length), windows_(),
thread_pool_(thread_pool::createThreadPool(num_threads)),
thread_to_id_(), logger_(new logger::Logger()) {
thread_to_id_(), logger_(new Logger()) {
uint32_t id = 0;
for (const auto& it: thread_pool_->thread_identifiers()) {
......
......@@ -25,15 +25,13 @@ namespace spoa {
class AlignmentEngine;
}
namespace logger {
class Logger;
}
namespace racon {
class Sequence;
class Overlap;
class Window;
class Logger;
enum class PolisherType {
kC, // Contig polishing
......@@ -95,7 +93,7 @@ protected:
std::unique_ptr<thread_pool::ThreadPool> thread_pool_;
std::unordered_map<std::thread::id, uint32_t> thread_to_id_;
std::unique_ptr<logger::Logger> logger_;
std::unique_ptr<Logger> logger_;
};
}
......@@ -42,6 +42,10 @@ Window::~Window() {
void Window::add_layer(const char* sequence, uint32_t sequence_length,
const char* quality, uint32_t quality_length, uint32_t begin, uint32_t end) {
if (sequence_length == 0 || begin == end) {
return;
}
if (quality != nullptr && sequence_length != quality_length) {
fprintf(stderr, "[racon::Window::add_layer] error: "
"unequal quality size!\n");
......