diff --git a/kmc_CLI/kmc.cpp b/kmc_CLI/kmc.cpp index 15e579e..d32ed10 100644 --- a/kmc_CLI/kmc.cpp +++ b/kmc_CLI/kmc.cpp @@ -5,6 +5,7 @@ #include #include #include +#include using namespace std; struct CLIParams @@ -36,7 +37,7 @@ void usage() << " -sm - use strict memory mode (memory limit from -m switch will not be exceeded)\n" << " -hc - count homopolymer compressed k-mers (approximate and experimental)\n" << " -p - signature length (5, 6, 7, 8, 9, 10, 11); default: 9\n" - << " -f - input in FASTA format (-fa), FASTQ format (-fq), multi FASTA (-fm) or BAM (-fbam) or KMC(-fkmc); default: FASTQ\n" + << " -f - input in FASTA format (-fa), FASTQ format (-fq), multi FASTA (-fm) or BAM (-fbam) or KMC (-fkmc); default: FASTQ\n" << " -ci - exclude k-mers occurring less than times (default: 2)\n" << " -cs - maximal value of a counter (default: 255)\n" << " -cx - exclude k-mers occurring more of than times (default: 1e9)\n" @@ -264,7 +265,8 @@ bool parse_parameters(int argc, char* argv[], Params& params) input_file_names.push_back(s); in.close(); - std::random_shuffle(input_file_names.begin(), input_file_names.end()); + std::mt19937 gen; + std::shuffle(input_file_names.begin(), input_file_names.end(), gen); } stage1Params.SetInputFiles(input_file_names); diff --git a/kmc_api/kmer_api.h b/kmc_api/kmer_api.h index a5a1ebe..4f99aae 100644 --- a/kmc_api/kmer_api.h +++ b/kmc_api/kmer_api.h @@ -99,7 +99,7 @@ class CKmerAPI // ---------------------------------------------------------------------------------- template - inline void to_string_impl(RandomAccessIterator iter) + inline void to_string_impl(RandomAccessIterator iter) const { uchar *byte_ptr; uchar c; @@ -431,7 +431,7 @@ class CKmerAPI // Convert kmer into string (an alphabet ACGT) // RET : string kmer //----------------------------------------------------------------------- - inline std::string to_string() + inline std::string to_string() const { std::string string_kmer; string_kmer.resize(kmer_length); @@ -442,14 +442,14 @@ class CKmerAPI // Convert kmer into string (an alphabet ACGT). The function assumes enough memory was allocated // OUT : str - string kmer. //----------------------------------------------------------------------- - inline void to_string(char *str) + inline void to_string(char *str) const { to_string_impl(str); str[kmer_length] = '\0'; }; - inline void to_long(std::vector& kmer) + inline void to_long(std::vector& kmer) const { kmer.resize(no_of_rows); uint32 offset = 62 - ((kmer_length - 1 + byte_alignment) & 31) * 2; @@ -473,7 +473,7 @@ class CKmerAPI // Convert kmer into string (an alphabet ACGT) // OUT : str - string kmer //----------------------------------------------------------------------- - inline void to_string(std::string &str) + inline void to_string(std::string &str) const { str.resize(kmer_length); to_string_impl(str.begin()); diff --git a/py_kmc_api/libs/pybind11/include/pybind11/attr.h b/py_kmc_api/libs/pybind11/include/pybind11/attr.h index 8732cfe..9981b2e 100644 --- a/py_kmc_api/libs/pybind11/include/pybind11/attr.h +++ b/py_kmc_api/libs/pybind11/include/pybind11/attr.h @@ -11,6 +11,7 @@ #pragma once #include "cast.h" +#include NAMESPACE_BEGIN(PYBIND11_NAMESPACE)