Skip to content

Commit

Permalink
Remove deprecated feature usage
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad0x00 committed May 11, 2022
1 parent 525f5b3 commit 16eabb2
Show file tree
Hide file tree
Showing 12 changed files with 70 additions and 22 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2022-05-11 Vladimir Nikolic <[email protected]>

* Release version 2.3.5

General:
* Fixed compile errors when using the -DNDEBUG flag.


2021-12-20 Vladimir Nikolic <[email protected]>

* Release version 2.3.4
Expand Down
22 changes: 16 additions & 6 deletions Common/Functional.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,22 @@

/** A functor that always returns true. */
template <typename Arg>
struct True : std::unary_function<Arg, bool> {
struct True {
bool operator()(const Arg&) const { return true; }

typedef Arg argument_type;
typedef bool result_type;
};

/** A functor to adapt a pointer to a member variable. */
template <typename Arg, typename Result>
struct MemVar : std::unary_function<Arg, Result>
struct MemVar
{
MemVar(Result Arg::* p) : m_p(p) { }
Result operator()(const Arg& arg) const { return arg.*m_p; }

typedef Arg argument_type;
typedef Result result_type;
private:
Result Arg::* m_p;
};
Expand All @@ -28,15 +34,17 @@ MemVar<Arg, Result> mem_var(Result Arg::* p)

/** A functor, f1(f2(x)). */
template <typename F1, typename F2>
struct unary_compose : std::unary_function <
typename F2::argument_type, typename F1::result_type>
struct unary_compose
{
unary_compose(const F1& f1, const F2& f2) : f1(f1), f2(f2) { }
typename F1::result_type operator()(
const typename F2::argument_type& x) const
{
return f1(f2(x));
}

typedef typename F2::argument_type argument_type;
typedef typename F1::result_type result_type;
private:
F1 f1;
F2 f2;
Expand All @@ -51,8 +59,7 @@ unary_compose<F1, F2> compose1(const F1& f1, const F2& f2)

/** A functor, f(g1(x), g2(x)). */
template <typename F, typename G1, typename G2>
struct binary_compose : std::unary_function <
typename G1::argument_type, typename F::result_type>
struct binary_compose
{
binary_compose(const F& f, const G1& g1, const G2& g2)
: f(f), g1(g1), g2(g2) { }
Expand All @@ -61,6 +68,9 @@ struct binary_compose : std::unary_function <
{
return f(g1(x), g2(x));
}

typedef typename G1::argument_type argument_type;
typedef typename G1::result_type result_type;
private:
F f;
G1 g1;
Expand Down
25 changes: 20 additions & 5 deletions FilterGraph/FilterGraph.cc
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ removeContigs(Graph& g, vector<vertex_descriptor>& sc)
}

/** Return the value of the bit at the specified index. */
struct Marked : unary_function<vertex_descriptor, bool>
struct Marked
{
typedef vector<bool> Data;
Marked(const Graph& g, const Data& data)
Expand All @@ -391,6 +391,9 @@ struct Marked : unary_function<vertex_descriptor, bool>
{}
bool operator()(vertex_descriptor u) const { return m_data[get(vertex_contig_index, m_g, u)]; }

typedef vertex_descriptor argument_type;
typedef bool result_type;

private:
const Graph& m_g;
const Data& m_data;
Expand Down Expand Up @@ -434,7 +437,7 @@ struct sortContigs
}
};

struct ShorterThanX : unary_function<vertex_descriptor, bool>
struct ShorterThanX
{
const Graph& g;
const vector<bool>& seen;
Expand All @@ -451,9 +454,12 @@ struct ShorterThanX : unary_function<vertex_descriptor, bool>
return g[y].length < x && !get(vertex_removed, g, y) &&
!seen[get(vertex_contig_index, g, y)];
}

typedef vertex_descriptor argument_type;
typedef bool result_type;
};

struct LongerThanX : unary_function<vertex_descriptor, bool>
struct LongerThanX
{
const Graph& g;
const vector<bool>& seen;
Expand All @@ -470,9 +476,12 @@ struct LongerThanX : unary_function<vertex_descriptor, bool>
return g[y].length > x && !get(vertex_removed, g, y) &&
!seen[get(vertex_contig_index, g, y)];
}

typedef vertex_descriptor argument_type;
typedef bool result_type;
};

struct CoverageLessThan : unary_function<vertex_descriptor, bool>
struct CoverageLessThan
{
const Graph& g;
const vector<bool>& seen;
Expand All @@ -491,6 +500,9 @@ struct CoverageLessThan : unary_function<vertex_descriptor, bool>
return meanCoverage < minCov && !get(vertex_removed, g, u) &&
!seen[get(vertex_contig_index, g, u)];
}

typedef vertex_descriptor argument_type;
typedef bool result_type;
};

static void
Expand Down Expand Up @@ -549,7 +561,7 @@ getSequence(const Graph& g, vertex_descriptor u)
}

/** Return whether the specified edge is inconsistent. */
struct is_edge_inconsistent : unary_function<edge_descriptor, bool>
struct is_edge_inconsistent
{
const Graph& g;

Expand All @@ -574,6 +586,9 @@ struct is_edge_inconsistent : unary_function<edge_descriptor, bool>
return true;
return false;
}

typedef edge_descriptor argument_type;
typedef bool result_type;
};

template<typename It>
Expand Down
15 changes: 12 additions & 3 deletions Graph/ContigGraphAlgorithms.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ using boost::graph_traits;

/** Return true if the edge e is a palindrome. */
template<typename Graph>
struct IsPalindrome : std::unary_function<typename graph_traits<Graph>::edge_descriptor, bool>
struct IsPalindrome
{
IsPalindrome(const Graph& g)
: m_g(g)
Expand All @@ -28,6 +28,9 @@ struct IsPalindrome : std::unary_function<typename graph_traits<Graph>::edge_des
return source(e, m_g) == get(vertex_complement, m_g, target(e, m_g));
}

typedef typename graph_traits<Graph>::edge_descriptor argument_type;
typedef bool result_type;

private:
const Graph& m_g;
};
Expand Down Expand Up @@ -223,7 +226,7 @@ assemble(Graph& g, OutIt out)

/** Return true if the edge e is +ve sense. */
template<typename Graph>
struct IsPositive : std::unary_function<typename graph_traits<Graph>::edge_descriptor, bool>
struct IsPositive
{
IsPositive(const Graph& g)
: m_g(g)
Expand All @@ -233,6 +236,9 @@ struct IsPositive : std::unary_function<typename graph_traits<Graph>::edge_descr
return !get(vertex_sense, m_g, source(e, m_g)) && !get(vertex_sense, m_g, target(e, m_g));
}

typedef typename graph_traits<Graph>::edge_descriptor argument_type;
typedef bool result_type;

private:
const Graph& m_g;
};
Expand Down Expand Up @@ -284,7 +290,7 @@ pruneTips_if(Graph& g, OutputIt result, Pred p)

/** Return true if the vertex is a normal 1-in 0-out tip. */
template<typename Graph>
struct IsTip : std::unary_function<typename graph_traits<Graph>::vertex_descriptor, bool>
struct IsTip
{
IsTip(const Graph& g)
: m_g(g)
Expand All @@ -294,6 +300,9 @@ struct IsTip : std::unary_function<typename graph_traits<Graph>::vertex_descript
return in_degree(v, m_g) == 1;
}

typedef typename graph_traits<Graph>::vertex_descriptor argument_type;
typedef bool result_type;

private:
const Graph& m_g;
};
Expand Down
2 changes: 1 addition & 1 deletion Misc/samtobreak.hs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ parseArgs = do
where
help = putStr (usageInfo usage options) >> exitSuccess
tryHelp = "Try 'abyss-samtobreak --help' for more information."
version = "abyss-samtobreak (ABySS) 2.3.4\n"
version = "abyss-samtobreak (ABySS) 2.3.5\n"
usage = "Usage: samtobreak [OPTION]... [FILE]...\n\
\Calculate contig and scaffold contiguity and correctness metrics.\n"

Expand Down
5 changes: 4 additions & 1 deletion PathOverlap/PathOverlap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ mergePaths(const Paths& paths, const OverlapMap& overlaps, const ContigPath& mer
}

/** Return true if the edge e is a path overlap. */
struct IsPathOverlap : unary_function<edge_descriptor, bool>
struct IsPathOverlap
{
IsPathOverlap(const Graph& g, const OverlapMap& pmap, const IsPositive<Graph>& pred)
: m_g(g)
Expand All @@ -522,6 +522,9 @@ struct IsPathOverlap : unary_function<edge_descriptor, bool>
return stranded && getOverlap(m_pmap, source(e, m_g), target(e, m_g));
}

typedef edge_descriptor argument_type;
typedef bool result_type;

private:
const Graph& m_g;
const OverlapMap& m_pmap;
Expand Down
5 changes: 4 additions & 1 deletion SimpleGraph/SimpleGraph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ static unsigned calculatePathLength(const Graph& g,

/** Compare the lengths of two paths. */
struct ComparePathLength
: binary_function<ContigPath, ContigPath, bool>
{
ComparePathLength(const Graph& g, const ContigNode& origin)
: m_g(g), m_origin(origin) { }
Expand All @@ -315,6 +314,10 @@ struct ComparePathLength
return lenA < lenB
|| (lenA == lenB && a.size() < b.size());
}

typedef ContigPath first_argument_type;
typedef ContigPath second_argument_type;
typedef bool result_type;
private:
const Graph& m_g;
const ContigNode& m_origin;
Expand Down
2 changes: 1 addition & 1 deletion bin/abyss-pe
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ help:
@echo 'Report bugs to https://github.com/bcgsc/abyss/issues or [email protected].'

version:
@echo "abyss-pe (ABySS) 2.3.4"
@echo "abyss-pe (ABySS) 2.3.5"
@echo "Written by Shaun Jackman and Anthony Raymond."
@echo
@echo "Copyright 2012 Canada's Michael Smith Genome Science Centre"
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AC_PREREQ(2.62)
AC_INIT(ABySS, 2.3.4, [email protected], abyss,
AC_INIT(ABySS, 2.3.5, [email protected], abyss,
http://www.bcgsc.ca/platform/bioinfo/software/abyss)

AC_CONFIG_MACRO_DIR([m4])
Expand Down
2 changes: 1 addition & 1 deletion doc/ABYSS.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH ABYSS "1" "2015-May" "ABYSS (ABySS) 2.3.4" "User Commands"
.TH ABYSS "1" "2015-May" "ABYSS (ABySS) 2.3.5" "User Commands"
.SH NAME
ABYSS \- assemble short reads into contigs
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion doc/abyss-pe.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH abyss-pe "1" "2015-May" "abyss-pe (ABySS) 2.3.4" "User Commands"
.TH abyss-pe "1" "2015-May" "abyss-pe (ABySS) 2.3.5" "User Commands"
.SH NAME
abyss-pe - assemble reads into contigs
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion doc/abyss-tofastq.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH abyss-tofastq "1" "2015-May" "ABySS 2.3.4" "User Commands"
.TH abyss-tofastq "1" "2015-May" "ABySS 2.3.5" "User Commands"
.SH NAME
abyss-tofastq \- convert various file formats to FASTQ format
.br
Expand Down

0 comments on commit 16eabb2

Please sign in to comment.