Commit 4a3ab705 authored by khalid's avatar khalid
Browse files

Now processTagged return CPM normalized read counts

parent 2f069bb0
......@@ -285,7 +285,17 @@ inline void process_file(taggedInputFile& input_file, std::unordered_map<std::st
// Transfer the results from the temp data structure to the full data structure
results_mutex.lock();
for (auto marker : temp_results) results[marker.first][input_file.individual_name] += marker.second;
//CPM normalization
double nbreads = 0;
for (auto marker : temp_results) {
nbreads += marker.second;
}
double permillion = nbreads/1000000;
for (auto marker : temp_results) {
results[marker.first][input_file.individual_name] += round(marker.second / permillion);
}
results_mutex.unlock();
log("Finished processing individual " + input_file.individual_name + " trimmed tag " + tag + " and "+ std::to_string(maxtagl - tagl)+ " bases in the tail for loci" + input_file.path );
......
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