From 16eabb26dfa0d09df5385be585e53f91597350dc Mon Sep 17 00:00:00 2001 From: vlad0x00 Date: Wed, 11 May 2022 15:20:54 -0700 Subject: [PATCH] Remove deprecated feature usage --- ChangeLog | 8 ++++++++ Common/Functional.h | 22 ++++++++++++++++------ FilterGraph/FilterGraph.cc | 25 ++++++++++++++++++++----- Graph/ContigGraphAlgorithms.h | 15 ++++++++++++--- Misc/samtobreak.hs | 2 +- PathOverlap/PathOverlap.cpp | 5 ++++- SimpleGraph/SimpleGraph.cpp | 5 ++++- bin/abyss-pe | 2 +- configure.ac | 2 +- doc/ABYSS.1 | 2 +- doc/abyss-pe.1 | 2 +- doc/abyss-tofastq.1 | 2 +- 12 files changed, 70 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 66ba323f3..b441b1629 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2022-05-11 Vladimir Nikolic + + * Release version 2.3.5 + + General: + * Fixed compile errors when using the -DNDEBUG flag. + + 2021-12-20 Vladimir Nikolic * Release version 2.3.4 diff --git a/Common/Functional.h b/Common/Functional.h index a7d36c319..6dc0a805c 100644 --- a/Common/Functional.h +++ b/Common/Functional.h @@ -5,16 +5,22 @@ /** A functor that always returns true. */ template -struct True : std::unary_function { +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 -struct MemVar : std::unary_function +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; }; @@ -28,8 +34,7 @@ MemVar mem_var(Result Arg::* p) /** A functor, f1(f2(x)). */ template -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()( @@ -37,6 +42,9 @@ struct unary_compose : std::unary_function < { return f1(f2(x)); } + + typedef typename F2::argument_type argument_type; + typedef typename F1::result_type result_type; private: F1 f1; F2 f2; @@ -51,8 +59,7 @@ unary_compose compose1(const F1& f1, const F2& f2) /** A functor, f(g1(x), g2(x)). */ template -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) { } @@ -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; diff --git a/FilterGraph/FilterGraph.cc b/FilterGraph/FilterGraph.cc index cc0628fcd..23c223841 100644 --- a/FilterGraph/FilterGraph.cc +++ b/FilterGraph/FilterGraph.cc @@ -382,7 +382,7 @@ removeContigs(Graph& g, vector& sc) } /** Return the value of the bit at the specified index. */ -struct Marked : unary_function +struct Marked { typedef vector Data; Marked(const Graph& g, const Data& data) @@ -391,6 +391,9 @@ struct Marked : unary_function {} 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; @@ -434,7 +437,7 @@ struct sortContigs } }; -struct ShorterThanX : unary_function +struct ShorterThanX { const Graph& g; const vector& seen; @@ -451,9 +454,12 @@ struct ShorterThanX : unary_function 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 +struct LongerThanX { const Graph& g; const vector& seen; @@ -470,9 +476,12 @@ struct LongerThanX : unary_function 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 +struct CoverageLessThan { const Graph& g; const vector& seen; @@ -491,6 +500,9 @@ struct CoverageLessThan : unary_function 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 @@ -549,7 +561,7 @@ getSequence(const Graph& g, vertex_descriptor u) } /** Return whether the specified edge is inconsistent. */ -struct is_edge_inconsistent : unary_function +struct is_edge_inconsistent { const Graph& g; @@ -574,6 +586,9 @@ struct is_edge_inconsistent : unary_function return true; return false; } + + typedef edge_descriptor argument_type; + typedef bool result_type; }; template diff --git a/Graph/ContigGraphAlgorithms.h b/Graph/ContigGraphAlgorithms.h index f6ea421ef..b786c38df 100644 --- a/Graph/ContigGraphAlgorithms.h +++ b/Graph/ContigGraphAlgorithms.h @@ -18,7 +18,7 @@ using boost::graph_traits; /** Return true if the edge e is a palindrome. */ template -struct IsPalindrome : std::unary_function::edge_descriptor, bool> +struct IsPalindrome { IsPalindrome(const Graph& g) : m_g(g) @@ -28,6 +28,9 @@ struct IsPalindrome : std::unary_function::edge_des return source(e, m_g) == get(vertex_complement, m_g, target(e, m_g)); } + typedef typename graph_traits::edge_descriptor argument_type; + typedef bool result_type; + private: const Graph& m_g; }; @@ -223,7 +226,7 @@ assemble(Graph& g, OutIt out) /** Return true if the edge e is +ve sense. */ template -struct IsPositive : std::unary_function::edge_descriptor, bool> +struct IsPositive { IsPositive(const Graph& g) : m_g(g) @@ -233,6 +236,9 @@ struct IsPositive : std::unary_function::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::edge_descriptor argument_type; + typedef bool result_type; + private: const Graph& m_g; }; @@ -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 -struct IsTip : std::unary_function::vertex_descriptor, bool> +struct IsTip { IsTip(const Graph& g) : m_g(g) @@ -294,6 +300,9 @@ struct IsTip : std::unary_function::vertex_descript return in_degree(v, m_g) == 1; } + typedef typename graph_traits::vertex_descriptor argument_type; + typedef bool result_type; + private: const Graph& m_g; }; diff --git a/Misc/samtobreak.hs b/Misc/samtobreak.hs index a8cfb6050..e5781aa1b 100644 --- a/Misc/samtobreak.hs +++ b/Misc/samtobreak.hs @@ -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" diff --git a/PathOverlap/PathOverlap.cpp b/PathOverlap/PathOverlap.cpp index 531a7b009..05d271e19 100644 --- a/PathOverlap/PathOverlap.cpp +++ b/PathOverlap/PathOverlap.cpp @@ -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 +struct IsPathOverlap { IsPathOverlap(const Graph& g, const OverlapMap& pmap, const IsPositive& pred) : m_g(g) @@ -522,6 +522,9 @@ struct IsPathOverlap : unary_function 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; diff --git a/SimpleGraph/SimpleGraph.cpp b/SimpleGraph/SimpleGraph.cpp index 591dccef1..5bddb8012 100644 --- a/SimpleGraph/SimpleGraph.cpp +++ b/SimpleGraph/SimpleGraph.cpp @@ -305,7 +305,6 @@ static unsigned calculatePathLength(const Graph& g, /** Compare the lengths of two paths. */ struct ComparePathLength - : binary_function { ComparePathLength(const Graph& g, const ContigNode& origin) : m_g(g), m_origin(origin) { } @@ -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; diff --git a/bin/abyss-pe b/bin/abyss-pe index 0f7d916c1..baff11c8d 100755 --- a/bin/abyss-pe +++ b/bin/abyss-pe @@ -414,7 +414,7 @@ help: @echo 'Report bugs to https://github.com/bcgsc/abyss/issues or abyss-users@bcgsc.ca.' 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" diff --git a/configure.ac b/configure.ac index cf102f9e9..b2aa37cb6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_PREREQ(2.62) -AC_INIT(ABySS, 2.3.4, abyss-users@bcgsc.ca, abyss, +AC_INIT(ABySS, 2.3.5, abyss-users@bcgsc.ca, abyss, http://www.bcgsc.ca/platform/bioinfo/software/abyss) AC_CONFIG_MACRO_DIR([m4]) diff --git a/doc/ABYSS.1 b/doc/ABYSS.1 index 417b1a9f0..358786f84 100644 --- a/doc/ABYSS.1 +++ b/doc/ABYSS.1 @@ -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 diff --git a/doc/abyss-pe.1 b/doc/abyss-pe.1 index f410a47c5..e1a190b2b 100644 --- a/doc/abyss-pe.1 +++ b/doc/abyss-pe.1 @@ -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 diff --git a/doc/abyss-tofastq.1 b/doc/abyss-tofastq.1 index 131a29aca..d2244cd01 100644 --- a/doc/abyss-tofastq.1 +++ b/doc/abyss-tofastq.1 @@ -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