-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCodonsTable.h
More file actions
33 lines (28 loc) · 916 Bytes
/
CodonsTable.h
File metadata and controls
33 lines (28 loc) · 916 Bytes
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
#ifndef CODONSTABLE_H
#define CODONSTABLE_H
#include<bits/stdc++.h>
using namespace std;
// struct representing a codon of 3 DNA/RNA characters and ‘\0’
struct Codon
{
char value[4]; // 4th location for null character
char AminoAcid; // corresponding AminoAcid according to Table
};
// need to create one object of that class to load the AminoAcids table
// into memory
class CodonsTable
{
private:
Codon codons[64];
public:
// constructors and destructor
CodonsTable();
~CodonsTable();
// function to load all codons from the given text file
void LoadCodonsFromFile(string codonsFileName);
Codon getAminoAcid(char * value);
void setCodon(char * value, char AminoAcid, int index);
// function to check if a value exists
bool isAminoAcidValid(char a);
};
#endif // CODONSTABLE_H