Skip to content

Commit

Permalink
avoid using global variables for local scopes in bed
Browse files Browse the repository at this point in the history
  • Loading branch information
gf777 committed Mar 19, 2024
1 parent 52563fd commit 3f9cbd0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
2 changes: 1 addition & 1 deletion gfalibs
2 changes: 0 additions & 2 deletions include/input.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ class Input {

std::vector<Instruction> instructions;

unsigned int begin = 0, end = 0;

public:

void load(UserInputGfastats userInput);
Expand Down
13 changes: 2 additions & 11 deletions src/input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,43 +61,34 @@ void Input::read(InSequences& inSequences) {
if (!userInput.inBedInclude.empty() || userInput.pipeType == 'i') {

StreamObj streamObj;

stream = streamObj.openStream(userInput, 'i');

while (getline(*stream, line)) {

uint64_t begin = 0, end = 0;
std::istringstream iss(line);
iss >> bedHeader >> begin >> end;

userInput.bedIncludeList.pushCoordinates(bedHeader, begin, end);
begin = 0, end = 0;

}

lg.verbose("Finished reading BED include list");

}

BedCoordinates bedExcludeList;

if (!userInput.inBedExclude.empty() || userInput.pipeType == 'e') {

StreamObj streamObj;

stream = streamObj.openStream(userInput, 'e');

while (getline(*stream, line)) {

uint64_t begin = 0, end = 0;
std::istringstream iss(line);
iss >> bedHeader >> begin >> end;

bedExcludeList.pushCoordinates(bedHeader, begin, end);
begin = 0, end = 0;

}

lg.verbose("Finished reading BED exclude list");

}

if (!userInput.inSequence.empty() || userInput.pipeType == 'f') {
Expand Down

0 comments on commit 3f9cbd0

Please sign in to comment.