[med-svn] [Git][med-team/rampler][master] 6 commits: Fix watch file
Andreas Tille (@tille)
gitlab at salsa.debian.org
Fri Nov 25 13:47:34 GMT 2022
Andreas Tille pushed to branch master at Debian Med / rampler
Commits:
9d8eea4b by Andreas Tille at 2022-11-25T12:07:49+01:00
Fix watch file
- - - - -
e306dd21 by Andreas Tille at 2022-11-25T12:08:17+01:00
New upstream version 2.1.1
- - - - -
de0e15b6 by Andreas Tille at 2022-11-25T12:08:17+01:00
routine-update: New upstream version
- - - - -
9d60404e by Andreas Tille at 2022-11-25T12:08:18+01:00
Update upstream source from tag 'upstream/2.1.1'
Update to upstream version '2.1.1'
with Debian dir 55fb1eb3b93d94add0bbd38fc279760dfb8b7e75
- - - - -
07ba891b by Andreas Tille at 2022-11-25T12:08:18+01:00
routine-update: Standards-Version: 4.6.1
- - - - -
f0917339 by Andreas Tille at 2022-11-25T12:14:54+01:00
Refresh patch
- - - - -
10 changed files:
- + .github/workflows/rampler.yml
- − .travis.yml
- CMakeLists.txt
- debian/changelog
- debian/control
- debian/patches/use_debian_packaged_libs.patch
- debian/watch
- src/main.cpp
- src/sampler.cpp
- src/sampler.hpp
Changes:
=====================================
.github/workflows/rampler.yml
=====================================
@@ -0,0 +1,52 @@
+name: rampler CI
+
+on:
+ push:
+ pull_request:
+ branches:
+ - master
+
+env:
+ BUILD_TYPE: Release
+
+jobs:
+ test:
+ strategy:
+ matrix:
+ compiler:
+ - g++
+ - g++-4.8
+ - clang++
+ - clang++-4.0
+
+ runs-on: ubuntu-18.04
+
+ steps:
+ - uses: actions/checkout at v2
+
+ - if: ${{ matrix.compiler == 'g++-4.8' }}
+ name: Setup GCC
+ uses: egor-tensin/setup-gcc at v1
+ with:
+ version: "4.8"
+ platform: x64
+
+ - if: ${{ matrix.compiler == 'clang++-4.0' }}
+ name: Setup Clang
+ uses: egor-tensin/setup-clang at v1
+ with:
+ version: "4.0"
+ platform: x64
+
+ - name: Configure CMake
+ run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}
+ env:
+ CXX: ${{ matrix.compiler }}
+
+ - name: Build
+ run: cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }}
+
+ - name: Test
+ working-directory: ${{ github.workspace }}/build
+ run: |
+ bin/rampler --version
=====================================
.travis.yml deleted
=====================================
@@ -1,47 +0,0 @@
-dist: trusty
-
-language: cpp
-
-matrix:
- include:
- - name: "GCC 4.8 (Linux)" # GCC 4.8.5 & CMake 3.9.2
- os: linux
- addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
- packages:
- - g++-4.8
- - cmake
- env:
- - SET_COMPILER="export CC=gcc-4.8 && export CXX=g++-4.8"
-
- - name: "Clang 4.0 (Linux)" # Clang 4.0 & CMake 3.9.2
- os: linux
- addons:
- apt:
- sources:
- - llvm-toolchain-trusty-4.0
- packages:
- - clang-4.0
- - cmake
- env:
- - SET_COMPILER="export CC=clang-4.0 && export CXX=clang++-4.0"
-
- - name: "Clang Xcode 9.0 (OSX)" # Clang 9.0.0 & CMake 3.9.2
- os: osx
- osx_image: xcode9
-
-before_install:
- - eval "${SET_COMPILER}"
-
-install:
- - mkdir build && cd build
- - cmake -DCMAKE_BUILD_TYPE=Release .. && make
-
-script:
- - ./bin/rampler --version
-
-notifications:
- email:
- on_failure: always
=====================================
CMakeLists.txt
=====================================
@@ -1,6 +1,6 @@
-cmake_minimum_required(VERSION 3.9)
+cmake_minimum_required(VERSION 3.11)
-project(rampler VERSION 2.0.0
+project(rampler VERSION 2.1.1
LANGUAGES CXX
DESCRIPTION "Rampler is a tool for subsampling or splitting FASTA/Q files.")
@@ -13,21 +13,51 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
-if (NOT TARGET bioparser)
- add_subdirectory(vendor/bioparser EXCLUDE_FROM_ALL)
+include(FetchContent)
+include(GNUInstallDirs)
+
+find_package(bioparser 3.0.15 QUIET)
+if (NOT bioparser_FOUND)
+ FetchContent_Declare(
+ bioparser
+ GIT_REPOSITORY https://github.com/rvaser/bioparser
+ GIT_TAG 3.0.15)
+
+ FetchContent_GetProperties(bioparser)
+ if (NOT bioparser_POPULATED)
+ FetchContent_Populate(bioparser)
+ add_subdirectory(
+ ${bioparser_SOURCE_DIR}
+ ${bioparser_BINARY_DIR}
+ EXCLUDE_FROM_ALL)
+ endif ()
endif ()
-if (NOT TARGET biosoup)
- add_subdirectory(vendor/bioparser/vendor/biosoup EXCLUDE_FROM_ALL)
+
+find_package(biosoup 0.10.0 QUIET)
+if (NOT biosoup_FOUND)
+ FetchContent_Declare(
+ biosoup
+ GIT_REPOSITORY https://github.com/rvaser/biosoup
+ GIT_TAG 0.10.0)
+
+ FetchContent_GetProperties(biosoup)
+ if (NOT biosoup_POPULATED)
+ FetchContent_Populate(biosoup)
+ add_subdirectory(
+ ${biosoup_SOURCE_DIR}
+ ${biosoup_BINARY_DIR}
+ EXCLUDE_FROM_ALL)
+ endif ()
endif ()
-add_executable(${PROJECT_NAME}
+add_executable(rampler
src/main.cpp
src/sampler.cpp)
-target_link_libraries(${PROJECT_NAME}
- bioparser
- biosoup)
-target_compile_definitions(${PROJECT_NAME} PRIVATE
- RAMPLER_VERSION="v${PROJECT_VERSION}")
-include(GNUInstallDirs)
-install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
+target_link_libraries(rampler
+ bioparser::bioparser
+ biosoup::biosoup)
+
+target_compile_definitions(rampler PRIVATE VERSION="${PROJECT_VERSION}")
+
+install(TARGETS rampler DESTINATION ${CMAKE_INSTALL_BINDIR})
=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+rampler (2.1.1-1) UNRELEASED; urgency=medium
+
+ * Fix watch file
+ * New upstream version
+ * Standards-Version: 4.6.1 (routine-update)
+
+ -- Andreas Tille <tille at debian.org> Fri, 25 Nov 2022 12:08:17 +0100
+
rampler (2.0.0-2) unstable; urgency=medium
* Fix watchfile to detect new versions on github
=====================================
debian/control
=====================================
@@ -7,7 +7,7 @@ Priority: optional
Build-Depends: debhelper-compat (= 13),
cmake,
libbioparser-dev
-Standards-Version: 4.6.0
+Standards-Version: 4.6.1
Vcs-Browser: https://salsa.debian.org/med-team/rampler
Vcs-Git: https://salsa.debian.org/med-team/rampler.git
Homepage: https://github.com/rvaser/rampler
=====================================
debian/patches/use_debian_packaged_libs.patch
=====================================
@@ -2,26 +2,15 @@ Author: Andreas Tille <tille at debian.org>
Last-Update: 2021-01-19
Description: Use Debian packaged libraries
Forwarded: not-needed
---- rampler.orig/CMakeLists.txt
-+++ rampler/CMakeLists.txt
-@@ -13,19 +13,11 @@
- set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
- set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -56,7 +56,8 @@ add_executable(rampler
--if (NOT TARGET bioparser)
-- add_subdirectory(vendor/bioparser EXCLUDE_FROM_ALL)
--endif ()
--if (NOT TARGET biosoup)
-- add_subdirectory(vendor/bioparser/vendor/biosoup EXCLUDE_FROM_ALL)
--endif ()
--
- add_executable(${PROJECT_NAME}
- src/main.cpp
- src/sampler.cpp)
- target_link_libraries(${PROJECT_NAME}
-- bioparser
-- biosoup)
+ target_link_libraries(rampler
+ bioparser::bioparser
+- biosoup::biosoup)
++ biosoup::biosoup
+ z)
- target_compile_definitions(${PROJECT_NAME} PRIVATE
- RAMPLER_VERSION="v${PROJECT_VERSION}")
+
+ target_compile_definitions(rampler PRIVATE VERSION="${PROJECT_VERSION}")
=====================================
debian/watch
=====================================
@@ -1,3 +1,4 @@
version=4
-https://github.com/rvaser/rampler/releases .*/@ANY_VERSION@@ARCHIVE_EXT@
+opts="filenamemangle=s%(?:.*?)?v?(\d[\d.]*)\.tar\.gz%@PACKAGE at -$1.tar.gz%" \
+ https://github.com/rvaser/rampler/tags .*/@ANY_VERSION@@ARCHIVE_EXT@
=====================================
src/main.cpp
=====================================
@@ -13,8 +13,6 @@ std::atomic<std::uint32_t> biosoup::Sequence::num_objects{0};
namespace {
-static const char* rampler_version = RAMPLER_VERSION;
-
static struct option options[] = {
{"out-directory", required_argument, nullptr, 'o'},
{"version", no_argument, nullptr, 'v'},
@@ -33,11 +31,11 @@ std::unique_ptr<bioparser::Parser<biosoup::Sequence>> CreateParser(
*name = (c == std::string::npos ? path : path.substr(c + 1));
c = name->find('.');
- *ext = (c == std::string::npos ? "" : name->substr(c, name->find('.', c + 1) - c)); // NOLINT
*name = (c == std::string::npos ? *name : name->substr(0, c));
if (is_suffix(path, ".fasta") || is_suffix(path, ".fa") ||
is_suffix(path, ".fasta.gz") || is_suffix(path, ".fa.gz")) {
+ *ext = ".fasta";
try {
return bioparser::Parser<biosoup::Sequence>::Create<bioparser::FastaParser>(path); // NOLINT
} catch (const std::invalid_argument& exception) {
@@ -47,6 +45,7 @@ std::unique_ptr<bioparser::Parser<biosoup::Sequence>> CreateParser(
}
if (is_suffix(path, ".fastq") || is_suffix(path, ".fq") ||
is_suffix(path, ".fastq.gz") || is_suffix(path, ".fq.gz")) {
+ *ext = ".fastq";
try {
return bioparser::Parser<biosoup::Sequence>::Create<bioparser::FastqParser>(path); // NOLINT
} catch (const std::invalid_argument& exception) {
@@ -103,7 +102,7 @@ int main(int argc, char** argv) {
while ((arg = getopt_long(argc, argv, "o:h", options, nullptr)) != -1) {
switch (arg) {
case 'o': out_directory = optarg; break;
- case 'v': std::cerr << rampler_version << std::endl; return 0;
+ case 'v': std::cerr << VERSION << std::endl; return 0;
case 'h': Help(); return 0;
default: return 1;
}
@@ -149,14 +148,14 @@ int main(int argc, char** argv) {
sampler.Initialize();
if (split) {
- sampler.Split(out_directory, atoi(input_parameters[2].c_str()));
+ sampler.Split(out_directory, std::atoll(input_parameters[2].c_str()));
} else if (subsample) {
- std::uint32_t reference_length = atoi(input_parameters[2].c_str());
+ std::uint64_t reference_length = std::atoll(input_parameters[2].c_str());
for (std::uint32_t i = 3; i < input_parameters.size(); ++i) {
sampler.Subsample(
out_directory,
reference_length,
- atoi(input_parameters[i].c_str()));
+ std::atoll(input_parameters[i].c_str()));
}
}
=====================================
src/sampler.cpp
=====================================
@@ -10,8 +10,6 @@
namespace rampler {
-constexpr uint32_t kChunkSize = 1024 * 1024 * 1024; // ~ 1GB
-
Sampler::Sampler(
std::unique_ptr<bioparser::Parser<biosoup::Sequence>> sparser,
const std::string& base_name,
@@ -42,8 +40,8 @@ void Sampler::Initialize() {
void Sampler::Subsample(
const std::string& out_directory,
- std::uint32_t reference_length,
- std::uint32_t coverage) {
+ std::uint64_t reference_length,
+ std::uint64_t coverage) {
if (coverage * reference_length > sequences_length_) {
std::cerr << "[rampler::Sampler::subsample] warning: "
<< "insufficient data for coverage of " << coverage
@@ -92,7 +90,7 @@ void Sampler::Subsample(
ofs.close();
}
-void Sampler::Split(const std::string& out_directory, std::uint32_t chunk_size) { // NOLINT
+void Sampler::Split(const std::string& out_directory, std::uint64_t chunk_size) { // NOLINT
if (chunk_size > sequences_length_) {
std::cerr << "[rampler::Sampler::split] warning: "
<< "insufficient data for chunk size " << chunk_size
@@ -100,7 +98,7 @@ void Sampler::Split(const std::string& out_directory, std::uint32_t chunk_size)
return;
}
- uint32_t chunk_number = 0;
+ std::size_t chunk_number = 0;
sparser_->Reset();
while (true) {
=====================================
src/sampler.hpp
=====================================
@@ -35,10 +35,10 @@ class Sampler {
void Subsample(
const std::string& out_directory,
- std::uint32_t reference_length,
- std::uint32_t coverage);
+ std::uint64_t reference_length,
+ std::uint64_t coverage);
- void Split(const std::string& out_directory, std::uint32_t chunk_size);
+ void Split(const std::string& out_directory, std::uint64_t chunk_size);
private:
std::unique_ptr<bioparser::Parser<biosoup::Sequence>> sparser_;
View it on GitLab: https://salsa.debian.org/med-team/rampler/-/compare/27c74604685224d17615d067a6cc5c77a76bc0b1...f0917339470096da32a02eefdc22f57c1076d08e
--
View it on GitLab: https://salsa.debian.org/med-team/rampler/-/compare/27c74604685224d17615d067a6cc5c77a76bc0b1...f0917339470096da32a02eefdc22f57c1076d08e
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20221125/3fdb7fea/attachment-0001.htm>
More information about the debian-med-commit
mailing list