diff -pruN old/caps.cpp new/caps.cpp --- old/caps.cpp 2022-01-20 09:30:24.409886691 +0200 +++ new/caps.cpp 2022-01-20 09:39:10.669845265 +0200 @@ -1,4 +1,5 @@ #include +#include #include #include"BCFasta.h" #include"file_manip.h" @@ -15,7 +16,7 @@ #include #include #include - +#include #include @@ -69,6 +70,10 @@ const gsl_rng_type * T; gsl_rng *r; +// make sure filenames are sorted! +// https://stackoverflow.com/a/34757557 +bool compareFunction (std::string a, std::string b) {return a totaltempnew; double alphathresh = 0; int main(int argc, char *argv[]){ @@ -189,6 +194,8 @@ int main(int argc, char *argv[]){ vector files; files = Folder_to_vector(mystring.c_str()); + // make sure filenames are sorted! + std::sort(files.begin(),files.end(),compareFunction); Fasta_vector file; file.ref_num=0;