-
Notifications
You must be signed in to change notification settings - Fork 1
/
protein.cpp
48 lines (39 loc) · 913 Bytes
/
protein.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "protein.h"
#include <fstream>
#include <sstream>
#include <iostream>
using namespace std;
Protein::Protein() {
}
/*une protéine a comme attributs sa taille, sa sequence et son titre*/
Protein::Protein(char* sequence, int length, string header) {
this->length = length;
this->sequence = sequence;
this->header = header;
}
Protein::~Protein() {}
/*Setters*/
void Protein::setSequence(char* sequence, int length) {
this->length = length;
this->sequence = sequence;
}
void Protein::setHeader(string header) {
this->header = header;
}
/*Getters*/
const char Protein::getResidue(int i) const {
return sequence[i];
}
char* Protein::getSequence() const {
return sequence;
}
/*Pour imprimer(uniquement le titre (header) )*/
void Protein::print(ostream& out) {
out << ">";
out << "s";
out << header << "\n";
}
/*retourne la taille...*/
const int Protein::size() const {
return length;
}