NEFFy
NEFF Calculator and MSA File Converter
Loading...
Searching...
No Matches
msaReader.h
Go to the documentation of this file.
1
10#ifndef MSAREADER_H
11#define MSAREADER_H
12
13#include <vector>
14#include <string>
15#include <iostream>
16#include "common.h"
17
19{
20protected:
21 std::string file;
25 std::vector<Sequence> Sequences; // the sequences read from the file
26
29 int isUnaligned();
30
34
36 void makeUppercase();
37
41
42 virtual void readFile(std::ifstream& file)=0; //??
43
44public:
50 MSAReader(std::string _file, Alphabet _alphabet, bool _checkValidation, bool _omitGaps = false);
51
54 std::vector<Sequence> read();
55};
56
57// Derived class for reading a2m format
59{
60public:
62private:
63 void readFile(std::ifstream& file) override;
64};
65
66// Derived class for reading a3m format
68{
69public:
71private:
72 void readFile(std::ifstream& file) override;
73};
74
75// Derived class for reading stockholm format
77{
78public:
80private:
81 void readFile(std::ifstream& file) override;
82};
83
84// Derived class for reading fasta format
86{
87public:
89private:
90 void readFile(std::ifstream& file) override;
91};
92
93// Derived class for reading clustal format
95{
96public:
98private:
99 void readFile(std::ifstream& file) override;
100};
101
102// Derived class for reading aln format
104{
105public:
107private:
108 void readFile(std::ifstream& file) override;
109};
110
111// Derived class for reading pfam format
113{
114public:
116private:
117 void readFile(std::ifstream& file) override;
118};
119
120#endif
Definition msaReader.h:59
void readFile(std::ifstream &file) override
Definition msaReader.cpp:105
Definition msaReader.h:68
void readFile(std::ifstream &file) override
Definition msaReader.cpp:148
Definition msaReader.h:104
void readFile(std::ifstream &file) override
Definition msaReader.cpp:420
Definition msaReader.h:95
void readFile(std::ifstream &file) override
Definition msaReader.cpp:391
Definition msaReader.h:86
void readFile(std::ifstream &file) override
Definition msaReader.cpp:336
Definition msaReader.h:113
void readFile(std::ifstream &file) override
Definition msaReader.cpp:435
Definition msaReader.h:77
void readFile(std::ifstream &file) override
Definition msaReader.cpp:237
Definition msaReader.h:19
bool checkValidation
Definition msaReader.h:23
void makeUppercase()
Convert all lowercase letters to uppercase in the sequences.
Definition msaReader.cpp:48
std::vector< Sequence > read()
Read the MSA file.
Definition msaReader.cpp:25
void validateSequences(Alphabet alphabet)
Validate the sequences for any invalid characters or unaligned sequences.
Definition msaReader.cpp:56
int isUnaligned()
Check if the MSA sequences are aligned.
Definition msaReader.cpp:72
Alphabet alphabet
Definition msaReader.h:22
virtual void readFile(std::ifstream &file)=0
bool omitGaps
Definition msaReader.h:24
std::vector< Sequence > Sequences
Definition msaReader.h:25
std::string file
Definition msaReader.h:21
MSAReader(std::string _file, Alphabet _alphabet, bool _checkValidation, bool _omitGaps=false)
Constructor.
Definition msaReader.cpp:22
std::string containsInvalidLetters(Alphabet alphabet)
Check if the sequences contain any invalid characters.
Definition msaReader.cpp:88
This file contains declaration of common utility functions used in the MSA project.
Alphabet
Definition common.h:41
Footer