Commit 6c018464 authored by Andreas Tille's avatar Andreas Tille
Browse files

New upstream version 1.1.1

parent 0bc05f8b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
dist: trusty

language: cpp

compiler:
+3 −1
Original line number Diff line number Diff line
@@ -3,7 +3,9 @@
[![Latest GitHub release](https://img.shields.io/github/release/rvaser/rampler.svg)](https://github.com/rvaser/rampler/releases/latest)
[![Build status for c++/clang++](https://travis-ci.org/rvaser/rampler.svg?branch=master)](https://travis-ci.org/rvaser/rampler)

Module for sampling genomic sequences.
Standalone module for sampling genomic sequences. It supports two modes, random subsampling of sequencer data to a desired depth (given the reference length) and file splitting to desired size in bytes.

Rampler takes as first input argument a file in FASTA/FASTQ format which can be compressed with gzip. The rest of input parameters depend on the mode of operation. The output is stored into a file(s) which is in the same format as the input file but uncompressed.

## Dependencies
1. gcc 4.8+ or clang 3.4+
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@

#include "bioparser/bioparser.hpp"

static const char* version = "v1.1.0";
static const char* version = "v1.1.1";

static struct option options[] = {
    {"out-directory", required_argument, 0, 'o'},
+3 −3
Original line number Diff line number Diff line
@@ -72,7 +72,7 @@ void Sampler::initialize() {
    sparser_->reset();
    while (true) {
        std::vector<std::unique_ptr<Sequence>> sequences;
        auto status = sparser_->parse_objects(sequences, kChunkSize);
        auto status = sparser_->parse(sequences, kChunkSize);

        for (const auto& it: sequences) {
            sequences_length_ += it->data().size();
@@ -112,7 +112,7 @@ void Sampler::subsample(const std::string& out_directory, uint32_t reference_len
    sparser_->reset();
    while (true) {
        std::vector<std::unique_ptr<Sequence>> sequences;
        auto status = sparser_->parse_objects(sequences, kChunkSize);
        auto status = sparser_->parse(sequences, kChunkSize);

        for (const auto& it: sequences) {
            if (distribution(generator) < ratio) {
@@ -147,7 +147,7 @@ void Sampler::split(const std::string& out_directory, uint32_t chunk_size) {
    sparser_->reset();
    while (true) {
        std::vector<std::unique_ptr<Sequence>> sequences;
        auto status = sparser_->parse_objects(sequences, chunk_size);
        auto status = sparser_->parse(sequences, chunk_size);

        std::string out_path = out_directory + "/" + base_name_ + "_" +
            std::to_string(chunk_number) + extension_;