Skip to content

Commit

Permalink
drop deprecated func
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasrausch committed Sep 17, 2024
1 parent 6e1f4d5 commit 364e88c
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 35 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ RUN apt-get update && apt-get install -y \
libhdf5-dev \
libncurses-dev \
liblzma-dev \
pkg-config \
zlib1g-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ bindir ?= $(exec_prefix)/bin

# Flags
CXX=g++
CXXFLAGS += -std=c++14 -isystem ${JLIB} -isystem ${EBROOTHTSLIB} -isystem ${SDSL_ROOT}/include -pedantic -W -Wall
CXXFLAGS += -std=c++17 -isystem ${JLIB} -isystem ${EBROOTHTSLIB} -isystem ${SDSL_ROOT}/include -pedantic -W -Wall
LDFLAGS += -L${EBROOTHTSLIB} -L${EBROOTHTSLIB}/lib -L${SDSL_ROOT}/lib -lboost_iostreams -lboost_filesystem -lboost_system -lboost_program_options -lboost_date_time -ldl -lpthread

ifeq (${STATIC}, 1)
Expand Down
2 changes: 1 addition & 1 deletion singularity/dicey.def
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Stage: build

# Final image
BootStrap: library
From: alpine:3.9
From: alpine:latest
Stage: final

%files from build
Expand Down
17 changes: 9 additions & 8 deletions src/gtf.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ namespace dicey {

explicit IntervalLabel(int32_t s) : start(s), end(s+1), strand('*'), lid(-1) {}
IntervalLabel(int32_t s, int32_t e, char t, int32_t l) : start(s), end(e), strand(t), lid(l) {}

bool operator<(const IntervalLabel& s2) const {
return start < s2.start;
}
};

struct IntervalLabelId {
Expand All @@ -47,22 +51,19 @@ namespace dicey {

explicit IntervalLabelId(int32_t s) : start(s), end(s+1), strand('*'), lid(-1), eid(-1) {}
IntervalLabelId(int32_t s, int32_t e, char t, int32_t l, int32_t i) : start(s), end(e), strand(t), lid(l), eid(i) {}

bool operator<(const IntervalLabelId& s2) const {
return start < s2.start;
}
};

template<typename TRecord>
struct SortIntervalLabel : public std::binary_function<TRecord, TRecord, bool> {
struct SortIntervalLabel {
inline bool operator()(TRecord const& s1, TRecord const& s2) const {
return s1.lid < s2.lid;
}
};

template<typename TRecord>
struct SortIntervalStart : public std::binary_function<TRecord, TRecord, bool> {
inline bool operator()(TRecord const& s1, TRecord const& s2) const {
return s1.start < s2.start;
}
};

inline void
_insertInterval(std::vector<IntervalLabel>& cr, int32_t s, int32_t e, char strand, int32_t lid, int32_t) {
// Uniqueness not necessary because we flatten the interval map
Expand Down
9 changes: 3 additions & 6 deletions src/hunter.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,9 @@ namespace dicey
std::string queryalign;

DnaHit(int32_t sc, uint32_t const refIndex, uint32_t const s, char const orient, std::string const& ra, std::string const& qa) : score(sc), chr(refIndex), start(s), strand(orient), refalign(ra), queryalign(qa) {}
};

template<typename TRecord>
struct SortDnaHit : public std::binary_function<TRecord, TRecord, bool> {
inline bool operator()(TRecord const& a, TRecord const& b) const {
return ((a.score > b.score) || ((a.score == b.score) && (a.chr < b.chr)) || ((a.score == b.score) && (a.chr == b.chr) && (a.start < b.start)));
bool operator<(const DnaHit& b) const {
return ((score > b.score) || ((score == b.score) && (chr < b.chr)) || ((score == b.score) && (chr == b.chr) && (start < b.start)));
}
};

Expand Down Expand Up @@ -393,7 +390,7 @@ namespace dicey
}

// Sort
std::sort(ht.begin(), ht.end(), SortDnaHit<DnaHit>());
std::sort(ht.begin(), ht.end());

// Output
jsonDnaHitOut(c, seqname, ht, msg);
Expand Down
29 changes: 11 additions & 18 deletions src/silica.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,16 +74,13 @@ namespace dicey
double temp;
double perfTemp;
std::string genome;

bool operator<(const PrimerBind& b) const {
return (temp > b.temp);
}

};

template<typename TRecord>
struct SortPrimer : public std::binary_function<TRecord, TRecord, bool>
{
inline bool operator()(TRecord const& a, TRecord const& b) const {
return (a.temp > b.temp);
}
};

struct PcrProduct {
uint32_t refIndex;
uint32_t leng;
Expand All @@ -94,16 +91,12 @@ namespace dicey
double forTemp;
double revTemp;
double penalty;

bool operator<(const PcrProduct& b) const {
return (penalty < b.penalty);
}
};

template<typename TRecord>
struct SortProducts : public std::binary_function<TRecord, TRecord, bool>
{
inline bool operator()(TRecord const& a, TRecord const& b) const {
return (a.penalty < b.penalty);
}
};

template<typename TConfig, typename TStream>
inline void
writeJsonPrimerOut(TConfig const& c, TStream& rcfile, std::vector<std::string> const& qn, std::vector<PrimerBind> const& allp, std::vector<PcrProduct> const& pcrColl, std::vector<std::string> const& pName, std::vector<std::string> const& pSeq, std::vector<std::string> const& msg) {
Expand Down Expand Up @@ -588,7 +581,7 @@ namespace dicey
}

// Sort by temperature
std::sort(allp.begin(), allp.end(), SortPrimer<PrimerBind>());
std::sort(allp.begin(), allp.end());

// Search PCR amplicons
if (c.pruneprimer) jsonPrimerOut(c, seqname, allp, pcrColl, pName, pSeq, msg);
Expand Down Expand Up @@ -622,7 +615,7 @@ namespace dicey
}

// Sort by penalty
std::sort(pcrColl.begin(), pcrColl.end(), SortProducts<PcrProduct>());
std::sort(pcrColl.begin(), pcrColl.end());

// Output amplicons
jsonPrimerOut(c, seqname, allp, pcrColl, pName, pSeq, msg);
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace dicey
{


std::string diceyVersionNumber = "0.3.1";
std::string diceyVersionNumber = "0.3.2";

inline
void printTitle(std::string const& title)
Expand Down

0 comments on commit 364e88c

Please sign in to comment.