diff --git a/partitioning/fast_clustering_t.cpp b/partitioning/fast_clustering_t.cpp index 24a48045a2f558095ded75d584261664625b10ea..3d7d6f524411a15da67b3db98b2ca37583dcaa87 100755 --- a/partitioning/fast_clustering_t.cpp +++ b/partitioning/fast_clustering_t.cpp @@ -52,11 +52,11 @@ std::string get_cluster_id(const std::string& read, const std::string& seq_to_fi SmithWaterman(read_rc, seq_to_find, score_rc, x_rc, y_rc); if (score_fw >= score_rc) { // primer found in forward sequence - if (score_fw >= 8 && read.size() > y_fw + split_level) { + if (score_fw >= 7.5 && read.size() > y_fw + split_level) { return read.substr(y_fw, split_level); } } else { // primer found in reverse complement sequence - if (score_rc >= 8 && read_rc.size() > y_rc + split_level) { + if (score_rc >= 7.5 && read_rc.size() > y_rc + split_level) { return read_rc.substr(y_rc, split_level); } } @@ -124,7 +124,7 @@ void process_file_part(const std::string& input_filename, int part_id, int start continue; // reject the read } - // lock the mutex for this output file + // lock the mutex for this output file until the end of this loop iteration std::lock_guard<std::mutex> lock(output_mutexes[cluster_id]); // write the sequence and its id to a cluster file corresponding to the bases found after the primer @@ -134,8 +134,10 @@ void process_file_part(const std::string& input_filename, int part_id, int start return; } output_file << ">" << read_name << "\n" << sequence << "\n"; // output format is fasta + output_file.close(); } + input_read_file.close(); } @@ -155,7 +157,7 @@ int main(int argc, char* argv[]) { int n_thread; // number of threads used, default = maximum possible if (argc == 4) { - n_thread = std::thread::hardware_concurrency(); + n_thread = 1;//std::thread::hardware_concurrency(); } else { n_thread = std::stoi(argv[4]); }