Skip to content

Commit d04547b

Browse files
authored
1.0.4 (#77)
* trying to change class initializaiton to fix the bug reported in #76 * Changing auto* to auto to stop issue 76 * Changing auto* to auto to stop issue 76 * Updating the format of estimated false discovery rate output * Fixed a bug with calculating coverage
1 parent 1fdcf58 commit d04547b

File tree

5 files changed

+17
-15
lines changed

5 files changed

+17
-15
lines changed

src/FASTAReader.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ class FASTAReader {
2525
std::ifstream file;
2626

2727
std::string line;
28-
long long linePlace;
29-
unsigned long long total_seq_length;
28+
long long linePlace = 0;
29+
unsigned long long total_seq_length = 0;
3030

3131
// change to queues
3232
std::vector<SequenceWindow *> windows;
@@ -46,12 +46,12 @@ class FASTAReader {
4646
double G_pctg;
4747

4848
symbol *overlapBuffer; // = NULL;
49-
unsigned long overlapLength; // = 0;
49+
unsigned long overlapLength = 0; // = 0;
5050

51-
std::string sequenceName; // = "";
52-
unsigned long sequenceID; // = 0;
53-
unsigned long readID; // = 0; // read id's may not be contiguous
54-
unsigned long symbolsReadInSeq; // = 0;
51+
std::string sequenceName = ""; // = "";
52+
unsigned long sequenceID = 0; // = 0;
53+
unsigned long readID = 0; // = 0; // read id's may not be contiguous
54+
unsigned long symbolsReadInSeq = 0; // = 0;
5555

5656
bool doneReadingFile; // = false;
5757
bool isReading;

src/cli.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#ifndef ULTRA_CLI_HPP
66
#define ULTRA_CLI_HPP
77

8-
#define ULTRA_VERSION_STRING "1.0.3"
8+
#define ULTRA_VERSION_STRING "1.0.4"
99
#define DEBUG_STRING ""
1010
#ifdef DEBUG_PRAGMA
1111
#undef DEBUG_STRING

src/main.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ int main_wrapper(int argc, const char * argv[]) {
7171
search_setting.bed_out = false;
7272

7373
// We first get the normal coverage
74-
auto *ultra = new Ultra(&search_setting);
74+
auto ultra = new Ultra(&search_setting);
7575
ultra->AnalyzeFile();
7676
ultra->OutputRepeats(true);
7777
seq_length = ultra->reader->fastaReader->total_seq_length;
@@ -102,7 +102,7 @@ int main_wrapper(int argc, const char * argv[]) {
102102
}
103103
}
104104

105-
printf("(%zu/%zu): %g, %g, %s\n",(coverage.size()),
105+
printf("(%zu/%zu): %.5f, %.5f, %s\n",(coverage.size()),
106106
param_strings.size(),
107107
real_coverage, fdr, arg_string.c_str());
108108
}
@@ -113,7 +113,7 @@ int main_wrapper(int argc, const char * argv[]) {
113113
double false_coverage = (double)shuffled_coverage[best_coverage_index] / (double)seq_length;
114114
double fdr = false_coverage / real_coverage;
115115

116-
printf("Best coverage within FDR limit: %g, %g, %s\n", real_coverage,
116+
printf("Best coverage within FDR limit: %.5f, %.5f, %s\n", real_coverage,
117117
fdr,
118118
param_strings[best_coverage_index].c_str());
119119

@@ -136,9 +136,7 @@ int main_wrapper(int argc, const char * argv[]) {
136136
}
137137

138138
// Perform the actual run
139-
140-
141-
auto *ultra = new Ultra(settings);
139+
auto ultra = new Ultra(settings);
142140
ultra->AnalyzeFile();
143141
ultra->OutputRepeats(true);
144142
unsigned long long true_coverage = ultra->Coverage();

src/ultra.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,10 @@ void Ultra::OutputRepeat(RepeatRegion *r, bool isSubRep) {
322322
total_coverage += (r->sequenceStart + r->repeatLength) - rep_start;
323323
}
324324

325+
if (r->sequenceStart + r->repeatLength > last_rep_end) {
326+
last_rep_end = r->sequenceStart + r->repeatLength;
327+
}
328+
325329
if (!settings->suppress_out)
326330
for (auto writer : writers)
327331
writer->WriteRepeat(r);

src/ultra.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class Ultra {
6868
bool firstRepeat = true;
6969
unsigned long repeatBuffer = 2000;
7070

71-
unsigned long long total_coverage;
71+
unsigned long long total_coverage = 0;
7272
int last_read_id = 0;
7373
unsigned long long last_rep_end = 0;
7474

0 commit comments

Comments
 (0)