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
cc517039
Commit
cc517039
authored
Apr 29, 2020
by
RomainFeron
Browse files
Fixed bug in 'map' for low number of samples
parent
eeb59f14
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/map.cpp
View file @
cc517039
...
...
@@ -27,7 +27,7 @@
void
Map
::
extra_setup
()
{
// Filtering
this
->
min_individuals
=
static_cast
<
uint16_t
>
(
this
->
popmap
.
n_individuals
*
this
->
parameters
.
map_min_frequency
);
this
->
min_individuals
=
std
::
max
(
static_cast
<
uint16_t
>
(
1
),
static_cast
<
uint16_t
>
(
this
->
popmap
.
n_individuals
*
this
->
parameters
.
map_min_frequency
)
)
;
// Loading bwa index
this
->
load_bwa_index
();
...
...
src/map.h
View file @
cc517039
...
...
@@ -22,6 +22,7 @@
*/
#pragma once
#include <algorithm>
#include <fstream>
#include <string>
#include <unordered_map>
...
...
src/markers_table.cpp
View file @
cc517039
...
...
@@ -84,6 +84,7 @@ void MarkersTable::start_parser(bool store_sequence, bool compute_groups) {
char
buffer
[
65536
];
uint
k
=
0
,
field_n
=
0
,
marker_n
=
0
;
Marker
marker
(
this
->
header
.
n_individuals
);
for
(
auto
g
:
this
->
popmap
->
get_groups
())
marker
.
group_counts
[
g
]
=
0
;
// Initialize group counts
std
::
vector
<
Marker
>
tmp_queue
(
TMP_QUEUE_SIZE
);
// Temporary block queue to avoid locking the shared blocks queue too often
uint
tmp_queue_real_size
=
0
;
uint
marker_queue_size
=
0
;
...
...
src/popmap.cpp
View file @
cc517039
...
...
@@ -134,6 +134,17 @@ uint Popmap::get_count(const std::string& group) const {
std
::
vector
<
std
::
string
>
Popmap
::
get_groups
()
const
{
std
::
vector
<
std
::
string
>
groups
;
for
(
auto
g
:
this
->
group_counts
)
groups
.
push_back
(
g
.
first
);
return
groups
;
}
std
::
string
Popmap
::
print_groups
(
const
bool
counts
)
const
{
...
...
src/popmap.h
View file @
cc517039
...
...
@@ -80,6 +80,15 @@ class Popmap {
uint
get_count
(
const
std
::
string
&
group
)
const
;
/*!
* \brief Get a list of all groups found in the popmap
*
* \return A vector of group names
*/
std
::
vector
<
std
::
string
>
get_groups
()
const
;
/*!
* \brief Print all the groups in the popmap
*
...
...
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