Commit 0b793ce8 authored by Romain Feron's avatar Romain Feron
Browse files

Fixed bug with signif / subset not outputting sequence

parent 2a898e5c
......@@ -30,11 +30,11 @@ struct Marker {
output_file << "\n";
}
void output_fasta(std::ofstream& output_file, uint16_t min_depth) const {
void output_fasta(std::ofstream& output_file, uint min_depth) const {
output_file << ">" << this->id;
for (auto group: this->groups) output_file << "_" << group.first << ":" << group.second;
output_file << "_mindepth:" << min_depth << "_p:" << this->p << "\n" << this->sequence << "\n";
output_file << "_p:" << this->p << "_mindepth:" << min_depth << "\n" << this->sequence << "\n";
}
};
......
......@@ -23,7 +23,7 @@ void signif(Parameters& parameters) {
MarkersQueue markers_queue;
std::mutex queue_mutex;
std::thread parsing_thread(table_parser, std::ref(parameters), std::ref(popmap), std::ref(markers_queue), std::ref(queue_mutex), std::ref(header), std::ref(parsing_ended), true, false);
std::thread parsing_thread(table_parser, std::ref(parameters), std::ref(popmap), std::ref(markers_queue), std::ref(queue_mutex), std::ref(header), std::ref(parsing_ended), false, false);
std::thread processing_thread(processor, std::ref(markers_queue), std::ref(popmap), std::ref(parameters), std::ref(queue_mutex), std::ref(candidate_markers), std::ref(n_markers), std::ref(parsing_ended), BATCH_SIZE);
parsing_thread.join();
......@@ -76,7 +76,7 @@ void processor(MarkersQueue& markers_queue, Popmap& popmap, Parameters& paramete
++n_markers; // Increment total number of markers for Bonferroni correction
chi_squared = get_chi_squared(marker.groups[parameters.group1], marker.groups[parameters.group2], popmap.counts[parameters.group1], popmap.counts[parameters.group2]);
marker.p = get_chi_squared_p(chi_squared);
marker.p = static_cast<float>(get_chi_squared_p(chi_squared));
// First pass: filter markers with non-corrected p < 0.05
if (static_cast<float>(marker.p) < parameters.signif_threshold) candidate_markers.push_back(marker);
......
......@@ -17,7 +17,7 @@ void subset(Parameters& parameters) {
std::ofstream output_file = open_output(parameters.output_file_path);
std::thread parsing_thread(table_parser, std::ref(parameters), std::ref(popmap), std::ref(markers_queue), std::ref(queue_mutex), std::ref(header), std::ref(parsing_ended), true, false);
std::thread parsing_thread(table_parser, std::ref(parameters), std::ref(popmap), std::ref(markers_queue), std::ref(queue_mutex), std::ref(header), std::ref(parsing_ended), false, false);
std::thread processing_thread(processor, std::ref(markers_queue), std::ref(popmap), std::ref(parameters), std::ref(queue_mutex), std::ref(output_file), std::ref(parsing_ended), BATCH_SIZE);
parsing_thread.join();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment