Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
khalid
radsex
Commits
0e13d458
Commit
0e13d458
authored
Aug 17, 2021
by
khalid
Browse files
Mutex just before changing results map
parent
4a3ab705
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/processTagged.cpp
View file @
0e13d458
...
...
@@ -283,8 +283,7 @@ inline void process_file(taggedInputFile& input_file, std::unordered_map<std::st
kseq_destroy
(
sequence
);
// Destroy the seq object
gzclose
(
file
);
// Transfer the results from the temp data structure to the full data structure
results_mutex
.
lock
();
//CPM normalization
double
nbreads
=
0
;
for
(
auto
marker
:
temp_results
)
{
...
...
@@ -292,9 +291,12 @@ inline void process_file(taggedInputFile& input_file, std::unordered_map<std::st
}
double
permillion
=
nbreads
/
1000000
;
// 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
]
+=
round
(
marker
.
second
/
permillion
);
results
[
marker
.
first
][
input_file
.
individual_name
]
+=
round
(
marker
.
second
/
permillion
);
//rounded CPM counts
}
results_mutex
.
unlock
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment