Skip to content

Commit 8de233f

Browse files
committed
Making output deterministic
1 parent 321b487 commit 8de233f

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/cgi/include/cgid_types.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ namespace cgi
3232
{
3333
bool operator() (const MappingResult_CGI &x, const MappingResult_CGI &y)
3434
{
35-
return std::tie(x.genomeId, x.querySeqId, x.nucIdentity)
36-
< std::tie(y.genomeId, y.querySeqId, y.nucIdentity);
35+
return std::tie(x.genomeId, x.querySeqId, x.nucIdentity, x.mapRefPosBin)
36+
< std::tie(y.genomeId, y.querySeqId, y.nucIdentity, y.mapRefPosBin);
37+
//Added ref. bin also to make sort output deterministic [issue #46]
3738
}
3839
} cmp_query_bucket;
3940

src/map/include/winSketch.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ namespace skch
4949
const skch::Parameters &param;
5050

5151
//Ignore top % most frequent minimizers while lookups
52-
const float percentageThreshold = 0.001;
52+
const float percentageThreshold = 0.0;
5353

5454
//Minimizers that occur this or more times will be ignored (computed based on percentageThreshold)
5555
int freqThreshold = std::numeric_limits<int>::max();
@@ -123,6 +123,9 @@ namespace skch
123123
//sequence counter while parsing file
124124
seqno_t seqCounter = 0;
125125

126+
if ( omp_get_thread_num() == 0)
127+
std::cerr << "INFO [thread 0], skch::Sketch::build, window size for minimizer sampling = " << param.windowSize << std::endl;
128+
126129
for(const auto &fileName : param.refSequences)
127130
{
128131

@@ -238,7 +241,7 @@ namespace skch
238241
else
239242
{
240243
if ( omp_get_thread_num() == 0)
241-
std::cerr << "INFO [thread 0], skch::Sketch::computeFreqHist, With threshold " << this->percentageThreshold << "\%, consider all minimizers during lookup." << std::endl;
244+
std::cerr << "INFO [thread 0], skch::Sketch::computeFreqHist, consider all minimizers during lookup." << std::endl;
242245
}
243246

244247
}

0 commit comments

Comments
 (0)