NEFFy
NEFF Calculator and MSA File Converter
Loading...
Searching...
No Matches
multimerHandler.h
Go to the documentation of this file.
1
15#ifndef MULTIMER_HANDLER
16#define MULTIMER_HANDLER
17
18#include <iostream>
19#include <vector>
20#include <tuple>
21
23public:
26 MultimerHandler(std::string _stoichiom);
27
31 std::string chainIndexToStoichiomLetter(int index);
32
36 bool getHeteromerMSAs(const std::vector<std::vector<int>>& vectors);
37
39 // The letters must appear in the correct alphabetical order (e.g., A before B, B before C, etc.).
40 // If a letter appears, all preceding letters in the alphabet must also appear.
41 // Each letter is followed by a number greater than 0.
43 bool isHeteromerFormat();
44
45
48 bool isHomomerFormat();
49
52 std::vector<std::vector<int>> getHomomerIndividualMSA(const std::vector<std::vector<int>>& sequences2num) ;
53
58 std::vector<std::vector<std::vector<int>>> getHetoromerMSAs(const std::vector<std::vector<int>>& sequences2num, const std::vector<int>& chainLengths);
59
60private:
61 //stoichiometry
62 std::string stoichiom;
63
64 // Number of repeatition of each chain in the multimer
65 std::vector<int> numbers;
66
67 // Number of distinct chains for a heteromer
69
70 // Indexes of start and end of each chain
71 std::vector<int> chainIntervals;
72
78 std::vector<int> getSequenceSegment(const std::vector<int>& row, int chainIndex, int repeat=1) const;
79
85 std::vector<int> checkRepeatedChainAndReturnOneSegment(const std::vector<int>& row, int rowIndex, int chainIndex);
86
90 bool includesInPairedMSA(const std::vector<int>& row);
91
96 int checkRowCorrespondsOnlyToOneChainAndReturnChainIndex(const std::vector<int>& row, int row_index);
97
101 std::vector<int> checkMSAFormatAndReturnRowIndexIntervalsCorrespondingToChains(const std::vector<int>& chainIndexOfRows);
102};
103
104#endif // MULTIMER_HANDLER
Definition multimerHandler.h:22
int checkRowCorrespondsOnlyToOneChainAndReturnChainIndex(const std::vector< int > &row, int row_index)
// Find index of the chain corrsponding to given row; it should correspond exactly to one chain
Definition multimerHandler.cpp:139
std::vector< int > checkRepeatedChainAndReturnOneSegment(const std::vector< int > &row, int rowIndex, int chainIndex)
Verify if all segments of the repeated chains in the given row are identical, and if so,...
Definition multimerHandler.cpp:100
std::vector< int > getSequenceSegment(const std::vector< int > &row, int chainIndex, int repeat=1) const
// Extract the sequence segment from the row that corresponds to the chain specified by the given cha...
Definition multimerHandler.cpp:35
std::vector< std::vector< int > > getHomomerIndividualMSA(const std::vector< std::vector< int > > &sequences2num)
Get individual MSA for homomer format.
Definition multimerHandler.cpp:119
std::vector< std::vector< std::vector< int > > > getHetoromerMSAs(const std::vector< std::vector< int > > &sequences2num, const std::vector< int > &chainLengths)
Get individual MSA for heteromer format.
Definition multimerHandler.cpp:210
bool getHeteromerMSAs(const std::vector< std::vector< int > > &vectors)
Verify if the MSA is in the form of a paired MSA (sequences followed by the MSA of each chain)
std::string chainIndexToStoichiomLetter(int index)
Map chain index to stoichiometry letter.
Definition multimerHandler.cpp:25
bool isHomomerFormat()
Check if the stoichiometry is in homomer format (e.g., A3)
Definition multimerHandler.cpp:45
MultimerHandler(std::string _stoichiom)
// Constructor to initialize the stoichiometry
Definition multimerHandler.cpp:23
bool isHeteromerFormat()
Check if stoichiometry follows the pattern of a heteromer (e.g., A2B2C1)
Definition multimerHandler.cpp:59
std::vector< int > chainIntervals
Definition multimerHandler.h:71
std::vector< int > numbers
Definition multimerHandler.h:65
bool includesInPairedMSA(const std::vector< int > &row)
Check if the row is for the paired MSA, i.e, it includes at least two sequence segements correspondin...
Definition multimerHandler.cpp:312
std::vector< int > checkMSAFormatAndReturnRowIndexIntervalsCorrespondingToChains(const std::vector< int > &chainIndexOfRows)
Check MSA format and return MSA row index intervals corresponding to each chain.
Definition multimerHandler.cpp:182
std::string stoichiom
Definition multimerHandler.h:62
int chainsCount
Definition multimerHandler.h:68
Footer