3475 |
08 Mar 16 |
peter |
// $Id$ |
3475 |
08 Mar 16 |
peter |
2 |
|
3475 |
08 Mar 16 |
peter |
3 |
/* |
3628 |
08 Mar 17 |
peter |
Copyright (C) 2016, 2017 Peter Johansson |
3475 |
08 Mar 16 |
peter |
5 |
|
3475 |
08 Mar 16 |
peter |
This file is part of the yat library, http://dev.thep.lu.se/yat |
3475 |
08 Mar 16 |
peter |
7 |
|
3475 |
08 Mar 16 |
peter |
The yat library is free software; you can redistribute it and/or |
3475 |
08 Mar 16 |
peter |
modify it under the terms of the GNU General Public License as |
3475 |
08 Mar 16 |
peter |
published by the Free Software Foundation; either version 3 of the |
3475 |
08 Mar 16 |
peter |
License, or (at your option) any later version. |
3475 |
08 Mar 16 |
peter |
12 |
|
3475 |
08 Mar 16 |
peter |
The yat library is distributed in the hope that it will be useful, |
3475 |
08 Mar 16 |
peter |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
3475 |
08 Mar 16 |
peter |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
3475 |
08 Mar 16 |
peter |
General Public License for more details. |
3475 |
08 Mar 16 |
peter |
17 |
|
3475 |
08 Mar 16 |
peter |
You should have received a copy of the GNU General Public License |
3475 |
08 Mar 16 |
peter |
along with yat. If not, see <http://www.gnu.org/licenses/>. |
3475 |
08 Mar 16 |
peter |
20 |
*/ |
3475 |
08 Mar 16 |
peter |
21 |
|
3475 |
08 Mar 16 |
peter |
22 |
#include <config.h> |
3475 |
08 Mar 16 |
peter |
23 |
|
3475 |
08 Mar 16 |
peter |
24 |
#include "Suite.h" |
3475 |
08 Mar 16 |
peter |
25 |
|
3475 |
08 Mar 16 |
peter |
26 |
#include "yat/omic/algorithm.h" |
3475 |
08 Mar 16 |
peter |
27 |
|
3475 |
08 Mar 16 |
peter |
28 |
#include <boost/concept_archetype.hpp> |
3475 |
08 Mar 16 |
peter |
29 |
#include <boost/iterator/iterator_archetypes.hpp> |
3475 |
08 Mar 16 |
peter |
30 |
|
3475 |
08 Mar 16 |
peter |
31 |
using namespace theplu::yat; |
3475 |
08 Mar 16 |
peter |
32 |
using namespace omic; |
3475 |
08 Mar 16 |
peter |
33 |
int main(int argc, char* argv[]) |
3475 |
08 Mar 16 |
peter |
34 |
{ |
3475 |
08 Mar 16 |
peter |
35 |
test::Suite suite(argc, argv); |
3475 |
08 Mar 16 |
peter |
36 |
|
3628 |
08 Mar 17 |
peter |
37 |
std::string random("ACGTATATATAGG"); |
3628 |
08 Mar 17 |
peter |
// test that reverse complement (in-place) and copy version yield same results |
3628 |
08 Mar 17 |
peter |
39 |
std::string result1(random); |
3628 |
08 Mar 17 |
peter |
40 |
dna_reverse_complement(result1.begin(), result1.end()); |
3628 |
08 Mar 17 |
peter |
41 |
std::string result2; |
3628 |
08 Mar 17 |
peter |
42 |
dna_reverse_complement_copy(random.begin(), random.end(), |
3628 |
08 Mar 17 |
peter |
43 |
std::back_inserter(result2)); |
3628 |
08 Mar 17 |
peter |
44 |
if (result1 != result2) { |
3628 |
08 Mar 17 |
peter |
45 |
suite.add(false); |
3628 |
08 Mar 17 |
peter |
46 |
suite.err() << "input: " << random << "\n"; |
3628 |
08 Mar 17 |
peter |
47 |
suite.err() << "dna_reverse_complement: " << result1 << "\n"; |
3628 |
08 Mar 17 |
peter |
48 |
suite.err() << "dna_reverse_complement_copy: " << result2 << "\n"; |
3628 |
08 Mar 17 |
peter |
49 |
} |
3628 |
08 Mar 17 |
peter |
50 |
|
3475 |
08 Mar 16 |
peter |
51 |
if (false) { // do not run compiler tests |
3475 |
08 Mar 16 |
peter |
52 |
using namespace boost::iterator_archetypes; |
3475 |
08 Mar 16 |
peter |
53 |
using boost::iterator_archetype; |
3475 |
08 Mar 16 |
peter |
54 |
boost::input_iterator_archetype<char> input; |
3475 |
08 Mar 16 |
peter |
55 |
boost::detail::dummy_constructor arg; |
3475 |
08 Mar 16 |
peter |
56 |
boost::output_iterator_archetype<char> output(arg); |
3475 |
08 Mar 16 |
peter |
57 |
boost::mutable_forward_iterator_archetype<char> forward; |
3475 |
08 Mar 16 |
peter |
58 |
boost::mutable_bidirectional_iterator_archetype<char> bidirect; |
3475 |
08 Mar 16 |
peter |
59 |
|
3517 |
16 Aug 16 |
peter |
60 |
boost::iterator_archetype<char |
3517 |
16 Aug 16 |
peter |
61 |
, boost::iterator_archetypes::readable_iterator_t |
3517 |
16 Aug 16 |
peter |
62 |
, boost::bidirectional_traversal_tag> const_bidirect; |
3517 |
16 Aug 16 |
peter |
63 |
|
3475 |
08 Mar 16 |
peter |
64 |
dna_complement(input, input, output); |
3475 |
08 Mar 16 |
peter |
65 |
dna_reverse_complement(bidirect, bidirect); |
3517 |
16 Aug 16 |
peter |
66 |
dna_reverse_complement_copy(const_bidirect, const_bidirect, output); |
3475 |
08 Mar 16 |
peter |
67 |
} |
3475 |
08 Mar 16 |
peter |
68 |
|
3475 |
08 Mar 16 |
peter |
69 |
return suite.return_value(); |
3475 |
08 Mar 16 |
peter |
70 |
} |