Skip to content

Commit

Permalink
Cleanup for -Werror build
Browse files Browse the repository at this point in the history
  • Loading branch information
milot-mirdita committed Oct 30, 2023
1 parent e26b9ad commit 932d32b
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 28 deletions.
2 changes: 1 addition & 1 deletion lib/alp/sls_pvalues.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ namespace Sls {
return rand_C;
};

static inline double standard_normal()//generates standard normal random value using the BoxMuller transform
static inline double standard_normal()//generates standard normal random value using the Box-Muller transform
{
double r1=0;
while(r1==0)
Expand Down
2 changes: 1 addition & 1 deletion src/alignment/Matcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ size_t Matcher::resultToBuffer(char * buff1, const result_t &result, bool addBac
*(tmpBuff-1) = '\t';
tmpBuff = Util::fastSeqIdToBuffer(result.seqId, tmpBuff);
*(tmpBuff-1) = '\t';
tmpBuff += sprintf(tmpBuff,"%.3E",result.eval);
tmpBuff += snprintf(tmpBuff, 32, "%.3E", result.eval);
tmpBuff++;
*(tmpBuff-1) = '\t';
tmpBuff = Itoa::i32toa_sse2(result.qStartPos, tmpBuff);
Expand Down
10 changes: 4 additions & 6 deletions src/alignment/MultipleAlignment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,23 @@ void MultipleAlignment::computeQueryGaps(unsigned int *queryGaps, Sequence *cent
for(size_t i = 0; i < alignmentResults.size(); i++) {
const Matcher::result_t& alignment = alignmentResults[i];
const std::string& bt = alignment.backtrace;
size_t queryPos = 0;
size_t targetPos = 0;
size_t currentQueryGapSize = 0;
queryPos = alignment.qStartPos;
targetPos = alignment.dbStartPos;
size_t queryPos = alignment.qStartPos;
// size_t targetPos = alignment.dbStartPos;
// compute query gaps (deletions)
for (size_t pos = 0; pos < bt.size(); ++pos) {
char bt_letter = bt.at(pos);
if (bt_letter == 'M') { // match state
++queryPos;
++targetPos;
// ++targetPos;
currentQueryGapSize = 0;
} else {
if (bt_letter == 'I') { // insertion
++queryPos;
currentQueryGapSize = 0;
}
else { // deletion
++targetPos;
// ++targetPos;
currentQueryGapSize += 1;
size_t gapCount = queryGaps[queryPos];
queryGaps[queryPos] = std::max(gapCount, currentQueryGapSize);
Expand Down
6 changes: 3 additions & 3 deletions src/commons/CSProfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,12 @@ void ContextLibrary::readContextProfile(std::stringstream &in, LibraryReader &re
}
// Calculate maximum of pseudocount weights
double max = -DBL_MAX;
double mean = 0.0;
// double mean = 0.0;
for (size_t a = 0; a < 20; ++a) {
mean += pc_weight[a];
// mean += pc_weight[a];
if (pc_weight[a] > max) max = pc_weight[a];
}
mean /= 20.0;
// mean /= 20.0;

// Rescale pseudocount weights and calculate their sum in lin-space
long double sum = 0.0;
Expand Down
3 changes: 0 additions & 3 deletions src/commons/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1631,7 +1631,6 @@ void Parameters::parseParameters(int argc, const char *pargv[], const Command &c
}
}

size_t parametersFound = 0;
for (int argIdx = 0; argIdx < argc; argIdx++) {
// it is a parameter if it starts with - or --
const bool longParameter = (pargv[argIdx][0] == '-' && pargv[argIdx][1] == '-');
Expand Down Expand Up @@ -1848,8 +1847,6 @@ void Parameters::parseParameters(int argc, const char *pargv[], const Command &c

EXIT(EXIT_FAILURE);
}

parametersFound++;
} else {
// parameter is actually a filename
#ifdef __CYGWIN__
Expand Down
4 changes: 2 additions & 2 deletions src/commons/ProfileStates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ int ProfileStates::readProfile(std::stringstream &in, float * profile, float *
pos += Util::skipWhitespace(pos);
pos += Util::skipNoneWhitespace(pos);
pos += Util::skipWhitespace(pos);
float s = 0.0;
// float s = 0.0;

// Store the probabilities
for (int k = 0 ; k < nalph ; k++)
{
float score = std::strtod(pos, NULL);
float prob = MathUtil::fpow2(-score/kScale);
profile[ProfileStates::hh2mmseqsAAorder(k)] = prob;// /background[k];
s+=prob;
// s+=prob;
char* oldPos = pos;
pos += Util::skipNoneWhitespace(pos);
pos += Util::skipWhitespace(pos);
Expand Down
2 changes: 0 additions & 2 deletions src/linclust/LinsearchIndexReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ size_t LinsearchIndexReader::pickCenterKmer(KmerPosition<short> *hashSeqPair, si
prevHash = BIT_SET(prevHash, 63);
}
size_t prevHashStart = 0;
size_t prevSetSize = 0;
for (size_t elementIdx = 0; elementIdx < splitKmerCount + 1; elementIdx++) {
size_t currKmer = hashSeqPair[elementIdx].kmer;
if (TYPE == Parameters::DBTYPE_NUCLEOTIDES) {
Expand All @@ -52,7 +51,6 @@ size_t LinsearchIndexReader::pickCenterKmer(KmerPosition<short> *hashSeqPair, si
if (hashSeqPair[elementIdx].kmer == SIZE_T_MAX) {
break;
}
prevSetSize++;
prevHash = hashSeqPair[elementIdx].kmer;
if (TYPE == Parameters::DBTYPE_NUCLEOTIDES) {
prevHash = BIT_SET(prevHash, 63);
Expand Down
4 changes: 2 additions & 2 deletions src/multihit/combinepvalperset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,13 @@ class PvalueAggregator : public Aggregation {
return buffer;
}

size_t k = 0;
// size_t k = 0;
double r = 0;
const double logPvalThr = log(pvalThreshold);
for (size_t i = 0; i < dataToAggregate.size(); ++i) {
double logPvalue = std::strtod(dataToAggregate[i][1].c_str(), NULL);
if (logPvalue < logPvalThr) {
k++;
// k++;
r -= logPvalue - logPvalThr;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/prefiltering/IndexTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,14 @@ class IndexTable {

size_t entrySize = 0;
size_t minKmer = 0;
size_t emptyKmer = 0;
// size_t emptyKmer = 0;
for (size_t i = 0; i < tableSize; i++) {
const ptrdiff_t size = offsets[i + 1] - offsets[i];
minKmer = std::min(minKmer, (size_t) size);
entrySize += size;
if (size == 0) {
emptyKmer++;
}
// if (size == 0) {
// emptyKmer++;
// }
if (((size_t) size) < topElements[top_N - 1].first)
continue;
for (size_t j = 0; j < top_N; j++) {
Expand Down
4 changes: 2 additions & 2 deletions src/util/extractframes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ int extractframes(int argc, const char **argv, const Command& command) {

if(reverseFrames != 0){
size_t sequenceLength = dataLength -2;
bool hasWrongChar = false;
// bool hasWrongChar = false;
for(size_t pos = 0; pos < sequenceLength; ++pos) {
char reverseComplement = Orf::complement(data[sequenceLength - pos - 1]);
reverseComplement = (reverseComplement == '.') ? 'N' : reverseComplement;
reverseComplementStr.push_back(reverseComplement);
hasWrongChar |= (reverseComplement == '.');
// hasWrongChar |= (reverseComplement == '.');
}
// if(hasWrongChar == true){
// continue;
Expand Down
2 changes: 0 additions & 2 deletions src/util/result2stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,6 @@ int StatsComputer::sequenceWise(typename PerSequence<T>::type call, bool onlyRes
buffer.append("\n");
} else {
// for every hit
int cnt = 0;
while (*results != '\0') {
Util::parseKey(results, dbKey);
char *rest;
Expand All @@ -402,7 +401,6 @@ int StatsComputer::sequenceWise(typename PerSequence<T>::type call, bool onlyRes
buffer.append("\n");

results = Util::skipLine(results);
cnt++;
}
}
statWriter->writeData(buffer.c_str(), buffer.length(), resultReader->getDbKey(id), thread_idx);
Expand Down

0 comments on commit 932d32b

Please sign in to comment.