| 1 | /* |
|---|
| 2 | Copyright (c) 2006-2018 Elmar Pruesse <elmar.pruesse@ucdenver.edu> |
|---|
| 3 | |
|---|
| 4 | This file is part of SINA. |
|---|
| 5 | SINA is free software: you can redistribute it and/or modify it under |
|---|
| 6 | the terms of the GNU General Public License as published by the Free |
|---|
| 7 | Software Foundation, either version 3 of the License, or (at your |
|---|
| 8 | option) any later version. |
|---|
| 9 | |
|---|
| 10 | SINA is distributed in the hope that it will be useful, but WITHOUT ANY |
|---|
| 11 | WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 12 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|---|
| 13 | for more details. |
|---|
| 14 | |
|---|
| 15 | You should have received a copy of the GNU General Public License |
|---|
| 16 | along with SINA. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 17 | |
|---|
| 18 | Additional permission under GNU GPL version 3 section 7 |
|---|
| 19 | |
|---|
| 20 | If you modify SINA, or any covered work, by linking or combining it |
|---|
| 21 | with components of ARB (or a modified version of that software), |
|---|
| 22 | containing parts covered by the terms of the |
|---|
| 23 | ARB-public-library-license, the licensors of SINA grant you additional |
|---|
| 24 | permission to convey the resulting work. Corresponding Source for a |
|---|
| 25 | non-source form of such a combination shall include the source code |
|---|
| 26 | for the parts of ARB used as well as that of the covered work. |
|---|
| 27 | */ |
|---|
| 28 | |
|---|
| 29 | #ifndef _ALIGNMENT_STATS_H_ |
|---|
| 30 | #define _ALIGNMENT_STATS_H_ |
|---|
| 31 | |
|---|
| 32 | #include "aligned_base.h" |
|---|
| 33 | |
|---|
| 34 | #include <vector> |
|---|
| 35 | #include <string> |
|---|
| 36 | |
|---|
| 37 | namespace sina { |
|---|
| 38 | |
|---|
| 39 | class alignment_stats { |
|---|
| 40 | public: |
|---|
| 41 | struct freqs { |
|---|
| 42 | unsigned int num_a{0}; |
|---|
| 43 | unsigned int num_g{0}; |
|---|
| 44 | unsigned int num_c{0}; |
|---|
| 45 | unsigned int num_u{0}; |
|---|
| 46 | unsigned int num_mutations{0}; |
|---|
| 47 | unsigned int num_transversions{0}; |
|---|
| 48 | }; |
|---|
| 49 | alignment_stats(); |
|---|
| 50 | alignment_stats(std::string name_, |
|---|
| 51 | unsigned int ntaxa, unsigned int alen, |
|---|
| 52 | const unsigned int *na, const unsigned int *nc, const unsigned int *ng, |
|---|
| 53 | const unsigned int *nu, const unsigned int *nM, const unsigned int *nT, |
|---|
| 54 | std::vector<int> pairs_); |
|---|
| 55 | |
|---|
| 56 | const std::vector<float>& getWeights() const { return weights; } |
|---|
| 57 | const std::vector<int>& getPairs() const { return pairs; } |
|---|
| 58 | const aligned_base::matrix_type getSubstMatrix(double identity) const; |
|---|
| 59 | int getWidth() const {return width;} |
|---|
| 60 | std::string getName() const {return name;} |
|---|
| 61 | private: |
|---|
| 62 | std::string name; |
|---|
| 63 | unsigned int num_taxa{0}; |
|---|
| 64 | unsigned int width{0}; |
|---|
| 65 | |
|---|
| 66 | freqs global_freqs; |
|---|
| 67 | std::vector<freqs> column_freqs; |
|---|
| 68 | |
|---|
| 69 | std::vector<int> pairs; |
|---|
| 70 | |
|---|
| 71 | std::vector<float> weights; |
|---|
| 72 | float maxweight{0}, minweight{0}, sumweight{0}; |
|---|
| 73 | int weighted_columns{0}; |
|---|
| 74 | }; |
|---|
| 75 | |
|---|
| 76 | } // namespace sina |
|---|
| 77 | #endif //_ALIGNMENT_STATS_H_ |
|---|
| 78 | |
|---|
| 79 | /* |
|---|
| 80 | Local Variables: |
|---|
| 81 | mode:c++ |
|---|
| 82 | c-file-style:"stroustrup" |
|---|
| 83 | c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) |
|---|
| 84 | indent-tabs-mode:nil |
|---|
| 85 | fill-column:99 |
|---|
| 86 | End: |
|---|
| 87 | */ |
|---|
| 88 | // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : |
|---|