Skip to content

Commit 3f9cbd0

Browse files
committed
avoid using global variables for local scopes in bed
1 parent 52563fd commit 3f9cbd0

3 files changed

Lines changed: 3 additions & 14 deletions

File tree

gfalibs

include/input.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ class Input {
3636

3737
std::vector<Instruction> instructions;
3838

39-
unsigned int begin = 0, end = 0;
40-
4139
public:
4240

4341
void load(UserInputGfastats userInput);

src/input.cpp

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,43 +61,34 @@ void Input::read(InSequences& inSequences) {
6161
if (!userInput.inBedInclude.empty() || userInput.pipeType == 'i') {
6262

6363
StreamObj streamObj;
64-
6564
stream = streamObj.openStream(userInput, 'i');
6665

6766
while (getline(*stream, line)) {
6867

68+
uint64_t begin = 0, end = 0;
6969
std::istringstream iss(line);
7070
iss >> bedHeader >> begin >> end;
71-
7271
userInput.bedIncludeList.pushCoordinates(bedHeader, begin, end);
73-
begin = 0, end = 0;
74-
7572
}
76-
7773
lg.verbose("Finished reading BED include list");
78-
7974
}
8075

8176
BedCoordinates bedExcludeList;
8277

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

8580
StreamObj streamObj;
86-
8781
stream = streamObj.openStream(userInput, 'e');
8882

8983
while (getline(*stream, line)) {
9084

85+
uint64_t begin = 0, end = 0;
9186
std::istringstream iss(line);
9287
iss >> bedHeader >> begin >> end;
9388

9489
bedExcludeList.pushCoordinates(bedHeader, begin, end);
95-
begin = 0, end = 0;
96-
9790
}
98-
9991
lg.verbose("Finished reading BED exclude list");
100-
10192
}
10293

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

0 commit comments

Comments
 (0)