Commit e14f2962 authored by Romain Feron's avatar Romain Feron
Browse files

Sex distribution matrix now has 0 at position 0, 0

Sequences not found in any individual are an artefact of coverage filtering and are not relevant for other analyses
parent 6acc386c
......@@ -12,7 +12,6 @@ void output_process_reads(std::string& output_file_path, std::vector<std::string
* - A matrix of coverage [Individual: [Sequence, Coverage]]
*/
FILE* output_file;
output_file = fopen(output_file_path.c_str(), "w");
......@@ -65,6 +64,8 @@ void output_sex_distribution(std::string& output_file_path, std::unordered_map<u
uint i = 0;
results[0][0] = 0; // Sequences found in none of the individuals (after filtering for minimum coverage) should not appear in the results
for (uint f=0; f < n_females; ++f) {
for (uint m=0; m < n_males; ++m) {
output_file << results[m][f];
......
......@@ -9,6 +9,7 @@ void sex_distribution(Parameters& parameters) {
*/
std::unordered_map<std::string, bool> popmap = load_popmap(parameters);
// Find number of males and females
uint n_males = 0, n_females = 0;
for (auto i: popmap) if (i.second) ++n_males; else ++n_females;
......
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