| 1 | // ==================================================================== // |
|---|
| 2 | // // |
|---|
| 3 | // File : SQ_functions.h // |
|---|
| 4 | // Purpose : Functions used for calculation of alignment quality // |
|---|
| 5 | // // |
|---|
| 6 | // // |
|---|
| 7 | // Coded by Juergen Huber in July 2003 - February 2004 // |
|---|
| 8 | // Coded by Kai Bader (baderk@in.tum.de) in 2007 - 2008 // |
|---|
| 9 | // Copyright Department of Microbiology (Technical University Munich) // |
|---|
| 10 | // // |
|---|
| 11 | // Visit our web site at: http://www.arb-home.de/ // |
|---|
| 12 | // // |
|---|
| 13 | // ==================================================================== // |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | #ifndef SQ_FUNCTIONS_H |
|---|
| 17 | #define SQ_FUNCTIONS_H |
|---|
| 18 | |
|---|
| 19 | #ifndef SQ_GROUPDATA_H |
|---|
| 20 | # include "SQ_GroupData.h" |
|---|
| 21 | #endif |
|---|
| 22 | |
|---|
| 23 | #ifndef __MAP__ |
|---|
| 24 | # include <map> |
|---|
| 25 | #endif |
|---|
| 26 | #ifndef __STRING__ |
|---|
| 27 | # include <string> |
|---|
| 28 | #endif |
|---|
| 29 | |
|---|
| 30 | #ifndef SMARTPTR_H |
|---|
| 31 | #include <smartptr.h> |
|---|
| 32 | #endif |
|---|
| 33 | |
|---|
| 34 | #ifndef ARBDB_BASE_H |
|---|
| 35 | #include <arbdb_base.h> |
|---|
| 36 | #endif |
|---|
| 37 | |
|---|
| 38 | class AP_filter; |
|---|
| 39 | class arb_progress; |
|---|
| 40 | |
|---|
| 41 | typedef SmartPtr < SQ_GroupData> SQ_GroupDataPtr; |
|---|
| 42 | typedef std::map < std::string, SQ_GroupDataPtr> SQ_GroupDataDictionary; |
|---|
| 43 | |
|---|
| 44 | GB_ERROR SQ_remove_quality_entries(GBDATA *gb_main); |
|---|
| 45 | |
|---|
| 46 | GB_ERROR SQ_pass1_no_tree(SQ_GroupData *globalData, GBDATA *gb_main, AP_filter *filter, arb_progress& progress); |
|---|
| 47 | GB_ERROR SQ_pass2_no_tree(const SQ_GroupData *globalData, GBDATA *gb_main, AP_filter *filter, arb_progress& progress); |
|---|
| 48 | |
|---|
| 49 | GB_ERROR SQ_pass1_on_tree(TreeNode *node, GBDATA *gb_main, SQ_GroupData *data, AP_filter *filter, arb_progress& progress); |
|---|
| 50 | GB_ERROR SQ_pass2_on_tree(TreeNode *node, GBDATA *gb_main, const SQ_GroupData *data, AP_filter *filter, arb_progress& progress); |
|---|
| 51 | |
|---|
| 52 | /* |
|---|
| 53 | "option" is variable which is passed to function "SQ_get_value()". |
|---|
| 54 | SQ_get_value() returns the values that are stored in the specific containers used for alignment quality evaluation. |
|---|
| 55 | */ |
|---|
| 56 | |
|---|
| 57 | struct SQ_weights { |
|---|
| 58 | int bases; |
|---|
| 59 | int diff_from_average; |
|---|
| 60 | int helix; |
|---|
| 61 | int consensus; |
|---|
| 62 | int iupac; |
|---|
| 63 | int gc; |
|---|
| 64 | }; |
|---|
| 65 | |
|---|
| 66 | GB_ERROR SQ_evaluate(GBDATA *gb_main, const SQ_weights& weights, bool marked_only); |
|---|
| 67 | /* |
|---|
| 68 | The "weight_..." -values are passed to the function "SQ_evaluate()". |
|---|
| 69 | SQ_evaluate() generates the final estimation for the quality of an alignment. |
|---|
| 70 | It takes the values from the different containers, which are generated by the other functions, weights them |
|---|
| 71 | and calculates a final value. The final value is stored in "value_of_evaluation" (see options). |
|---|
| 72 | So, with the "weight_..." -values one can customize how important a value stored in a container becomes |
|---|
| 73 | for the final result. |
|---|
| 74 | */ |
|---|
| 75 | |
|---|
| 76 | GB_ERROR SQ_mark_species(GBDATA *gb_main, int condition, bool marked_only); |
|---|
| 77 | |
|---|
| 78 | void SQ_clear_group_dictionary(); |
|---|
| 79 | |
|---|
| 80 | enum SQ_TREE_ERROR { |
|---|
| 81 | NONE = 0, ZOMBIE = 1, MISSING_NODE = 2 |
|---|
| 82 | }; |
|---|
| 83 | |
|---|
| 84 | SQ_TREE_ERROR SQ_check_tree_structure(TreeNode *node); |
|---|
| 85 | |
|---|
| 86 | #else |
|---|
| 87 | #error SQ_functions.h included twice |
|---|
| 88 | #endif |
|---|