Victor
 All Data Structures Functions Variables Friends Pages
ProfInput.h
1 /* This file is part of Victor.
2 
3  Victor is free software: you can redistribute it and/or modify
4  it under the terms of the GNU General Public License as published by
5  the Free Software Foundation, either version 3 of the License, or
6  (at your option) any later version.
7 
8  Victor is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with Victor. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 
18 #ifndef __ProfInput_H__
19 #define __ProfInput_H__
20 
21 #include <IoTools.h>
22 #include <stringtools.h>
23 #include <Substitution.h>
24 #include <iostream>
25 #include <string>
26 
27 namespace Victor { namespace Align2{
28 
34  class ProfInput {
35  public:
36 
37  // CONSTRUCTORS:
38 
40  ProfInput();
41 
43  ProfInput(istream &is);
44 
46  ProfInput(const ProfInput &orig);
47 
49  virtual ~ProfInput();
50 
51 
52  // OPERATORS:
53 
55  ProfInput& operator =(const ProfInput &orig);
56 
58  friend ostream& operator <<(ostream &os, const ProfInput &object);
59 
61  friend istream& operator >>(istream &is, ProfInput &object);
62 
63 
64  // PREDICATES:
65 
67  char getProfSS(int i);
68 
70  char getProfBE(int i);
71 
73  char getProfMixSSBE(char ssChar, char beChar);
74 
76  virtual unsigned int size() const;
77 
78 
79  // MODIFIERS:
80 
82  virtual void copy(const ProfInput &orig);
83 
85  virtual ProfInput* newCopy();
86 
87 
88  // HELPERS:
89 
91  static void pWriteString(ostream &os, string data1, string data2,
92  string data3);
93 
95  static void pReadString(istream &is, string &data1, string &data2,
96  string &data3);
97 
98 
99  protected:
100 
101 
102  private:
103 
104  // ATTRIBUTES:
105 
106  string seq;
107  string profSSPred;
108  string profBEPred;
109 
110  };
111 
112  // -----------------------------------------------------------------------------
113  // ProfInput
114  // -----------------------------------------------------------------------------
115 
116  // PREDICATES:
117 
118  inline char
120  return profSSPred[i];
121  }
122 
123  inline char
125  return profBEPred[i];
126  }
127 
128  inline unsigned int
129  ProfInput::size() const {
130  return seq.size();
131  }
132 
133 }} // namespace
134 
135 #endif
char getProfBE(int i)
Return the ASA prediction of Prof.
Definition: ProfInput.h:124
static void pWriteString(ostream &os, string data1, string data2, string data3)
Helper function used to write a string construct.
Definition: ProfInput.cc:147
char getProfSS(int i)
Return the SSE prediction of Prof.
Definition: ProfInput.h:119
virtual void copy(const ProfInput &orig)
Copy orig object to this object ("deep copy").
Definition: ProfInput.cc:122
friend istream & operator>>(istream &is, ProfInput &object)
Input operator.
Definition: ProfInput.cc:75
ProfInput & operator=(const ProfInput &orig)
Assignment operator.
Definition: ProfInput.cc:50
virtual unsigned int size() const
Return the size of the object referred as the number of aminoacids.
Definition: ProfInput.h:129
Implement I/O objects for handling PHD files.
Definition: ProfInput.h:34
virtual ~ProfInput()
Destructor.
Definition: ProfInput.cc:39
static void pReadString(istream &is, string &data1, string &data2, string &data3)
Helper function used to read a string construct.
Definition: ProfInput.cc:166
char getProfMixSSBE(char ssChar, char beChar)
Return the charachter for SSE/ASA combination.
Definition: ProfInput.cc:90
friend ostream & operator<<(ostream &os, const ProfInput &object)
Output operator.
Definition: ProfInput.cc:63
ProfInput()
Default constructor.
Definition: ProfInput.cc:28
virtual ProfInput * newCopy()
Construct a new "deep copy" of this object.
Definition: ProfInput.cc:132