Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
yazhinia committed Nov 15, 2024
1 parent 3d1b126 commit 1d87958
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions util/get_sequence_bybin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

namespace fs = std::filesystem;

bool condition_header(std::ifstream &fasta, std::string &line) {
bool condition_header(std::string &line) {
if (line[0] == '>') {
return true;
}
Expand All @@ -32,7 +32,7 @@ bool line_check(std::ifstream &fasta, std::string &line) {

void get_complete_sequence(std::ifstream &fasta, std::string &line, std::string &sequence) {
fasta >> line;
while (!condition_header(fasta, line) && !fasta.eof()) {
while (!condition_header(line) && !fasta.eof()) {
if (line_check(fasta, line)) {
sequence.append(line);
fasta >> line;
Expand Down Expand Up @@ -86,7 +86,7 @@ int main(int argc, char *argv[]) {
std::string outdir = argv[5];

std::fstream binassignment;
binassignment.open(tmp_dir + bin_ids);
binassignment.open(tmp_dir + '/' + bin_ids);

if (!binassignment.is_open()) {
std::cerr << "Error: Unable to open bin assignment file!" << "\n";
Expand Down Expand Up @@ -114,7 +114,7 @@ int main(int argc, char *argv[]) {
}

fastaFile >> line;
while (condition_header(fastaFile, line)) {
while (condition_header(line)) {
sequence = "";
auto range = bins_ids.equal_range(line.substr(1,-1));
if (range.first != range.second) {
Expand All @@ -137,7 +137,7 @@ int main(int argc, char *argv[]) {
}
else {
fastaFile >> line;
while (!condition_header(fastaFile, line) && !fastaFile.eof()) {
while (!condition_header(line) && !fastaFile.eof()) {
fastaFile >> line;
}
}
Expand Down

0 comments on commit 1d87958

Please sign in to comment.