Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 209a9539 authored by David Parsons's avatar David Parsons
Browse files

extract fn read_sequence

parent a6d053c6
No related branches found
No related tags found
No related merge requests found
......@@ -176,6 +176,17 @@ void interpret_cmd_line_options(int argc, char* argv[]) {
}
}
auto read_sequence(std::ifstream& chromosome_file, const std::string& chromosome_file_name) {
std::string chromosome;
std::getline(chromosome_file, chromosome);
if (not chromosome_file or chromosome.length() == 0) {
Utils::ExitWithUsrMsg(std::string("failed to read from chromosome file ") + chromosome_file_name);
}
return chromosome;
}
std::list<std::string> read_sequence_file(const std::string& chromosome_file_name) {
assert(chromosome_file_name.length() != 0);
......@@ -186,12 +197,7 @@ std::list<std::string> read_sequence_file(const std::string& chromosome_file_nam
Utils::ExitWithUsrMsg(std::string("failed to open source chromosome file ") + chromosome_file_name);
}
std::string chromosome;
std::getline(chromosome_file, chromosome);
if (not chromosome_file or chromosome.length() == 0) {
Utils::ExitWithUsrMsg(std::string("failed to read from chromosome file ") + chromosome_file_name);
}
chromosomes.push_back(std::move(chromosome));
chromosomes.push_back(read_sequence(chromosome_file, chromosome_file_name));
return chromosomes;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment