ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/PrimerMatch/exact_halves.h
Revision: 1.2
Committed: Wed May 4 18:03:44 2005 UTC (11 years, 1 month ago) by nje01
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +4 -1 lines
Log Message:
Small bug fixes, plus codon based edit distance for peptide searching.

Line File contents
1 /**************************************************************************
2 * This code is part of the supporting infrastructure for ATA Mapper.
3 * Copyright (C) 2002,2003,2004 Applera Corporation. All rights reserved.
4 * Author: Nathan Edwards
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received (LICENSE.txt) a copy of the GNU General Public
17 * License along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *************************************************************************/
20
21
22 #ifndef _IBPEP_EXACT_HALVES_H
23 #define _IBPEP_EXACT_HALVES_H
24
25 #include <iostream>
26 #include <utility>
27 #include <vector>
28 #include <map>
29 #include "char_io.h"
30 #include "keyword_tree.h"
31 #include "types.h"
32
33 #if !defined(NO_STD_NAMESPACE)
34 using namespace std;
35 #endif
36
37 class exact_halves : public PatternMatch {
38 private:
39 PatternMatch *pm_;
40 unsigned long int num_patterns_;
41 unsigned int k_;
42 unsigned char eos_;
43 bool _wc;
44 bool _textn;
45 bool _indels;
46 bool _dna_mut;
47 long unsigned int _mpl;
48 std::vector<FILE_POSITION_TYPE> lasthit_;
49 std::vector<tinylist<pattern_list_element>::const_iterator> plit_;
50 std::vector<std::string> pattern_halves_;
51 public:
52 exact_halves(PatternMatch *pm,
53 unsigned int k=0, unsigned char eos='\n',
54 bool wc=false, bool tn=false, bool indels=true, bool dna_mut=false);
55 exact_halves(PatternMatch *pm);
56 ~exact_halves();
57 long unsigned int add_pattern(std::string const & pat, unsigned long id=0,
58 int esb=0, int eeb=0);
59 bool find_patterns(CharacterProducer & cp,
60 pattern_hit_vector & kas,
61 long unsigned minka=1);
62 void init(CharacterProducer & cp);
63 void reset();
64 unsigned int mismatches() const;
65 void mismatches(unsigned int k);
66 bool wildcards() const;
67 void wildcards(bool wc);
68 bool wildcard_text_N() const;
69 void wildcard_text_N(bool tn);
70 bool indels() const;
71 void indels(bool id);
72 bool dna_mut() const;
73 void dna_mut(bool dm);
74 unsigned char eos_char() const;
75 void eos_char(unsigned char c);
76 };
77
78 #endif