#include <MAl_addon.h>
Collaboration diagram for MAl_addon:
Public Member Functions | |
MAl_addon (MAl *m) | |
~MAl_addon () | |
int | get_min_col () |
int | get_max_col () |
int | get_num_rows () |
char | get_most_freq_base_on_col (int col) |
int | get_num_bases_on_col (int col, char base) |
size_t | get_num_DNPs_on_col (int col) |
char | get_entry (int row, int col) |
int | get_qual (int row, int col) |
void | set_DNP (int row, int col, bool status, int dnpID, int type) |
bool | is_DNP (int row, int col) |
int | get_row_start (int row) |
int | get_row_end (int row) |
Private Attributes | |
MAl * | mal |
size_t | min_col |
size_t | max_col |
map< char, int > | base_index |
vector< char > | index_base |
vector< cons_struct > | consensus |
Classes | |
struct | cons_struct |
Definition at line 8 of file MAl_addon.h.
|
Definition at line 7 of file MAl_addon.cc. References base_index, consensus, MAl_Readonly::get_base_global(), MAl_Readonly::get_beginGood_global(), MAl_Readonly::get_endGood_global(), MAl_Readonly::get_num_seq(), index_base, is_DNP(), mal, max_col, and min_col. 00007 : mal(m) 00008 { 00009 //Base index stuff 00010 base_index[ 'a' ] = 0; 00011 index_base.push_back('a'); 00012 00013 base_index[ 't' ] = 1; 00014 index_base.push_back('t'); 00015 00016 base_index[ 'g' ] = 2; 00017 index_base.push_back('g'); 00018 00019 base_index[ 'c' ] = 3; 00020 index_base.push_back('c'); 00021 00022 base_index[ '-' ] = 4; 00023 index_base.push_back('-'); 00024 00025 base_index[ '*' ] = 5; 00026 index_base.push_back('*'); 00027 00028 base_index[ 'x' ] = 6; 00029 index_base.push_back('x'); 00030 00031 base_index[ 'n' ] = 7; 00032 index_base.push_back('n'); 00033 00034 //Min and max col, and bookeeping of cons 00035 min_col = numeric_limits<size_t>::max(); 00036 max_col = 0; 00037 00038 for( size_t i = 0; i < mal->get_num_seq(); i++ ) { 00039 if (mal->get_beginGood_global( i ) < min_col ) { 00040 min_col = mal->get_beginGood_global( i ); 00041 } 00042 if (mal->get_endGood_global( i ) > max_col ) { 00043 max_col = mal->get_endGood_global( i ); 00044 } 00045 00046 if ( max_col > consensus.size() ) { 00047 00048 for( size_t j = consensus.size(); j < max_col; j++ ) { 00049 consensus.push_back( cons_struct() ); 00050 } 00051 00052 } 00053 // cerr<<"i: "<<i<<endl; 00054 // cerr<<"mal->get_beginGood_global( i ): "<<mal->get_beginGood_global( i )<<endl; 00055 // cerr<<"mal->get_endGood_global( i ): "<<mal->get_endGood_global( i )<<endl; 00056 // cerr<<"mal->get_seq_begin_global( i ): "<<mal->get_seq_begin_global( i )<<endl; 00057 // cerr<<"mal->get_seq_end_global( i ): "<<mal->get_seq_end_global( i )<<endl; 00058 for( size_t j = mal->get_beginGood_global( i ); 00059 j < mal->get_endGood_global( i ); j++ ) { 00060 00061 00062 assert( base_index[ mal->get_base_global(i,j) ] < 8 ); 00063 00064 consensus[ j ].num[ base_index[ mal->get_base_global(i,j) ] ]++; 00065 if ( is_DNP(i, j) ) { 00066 consensus[ j ].num_DNPs++; 00067 } 00068 00069 } 00070 00071 } 00072 assert( max_col == consensus.size() ); 00073 00074 00075 //Set cons bases 00076 for( size_t i = min_col; i < consensus.size(); i++ ) { 00077 int max(0); 00078 00079 for( size_t j = 0; j < 8; j++ ) { 00080 if ( consensus[ i ].num[ j ] > max ) { 00081 max = consensus[ i ].num[ j ]; 00082 consensus[ i ].cons = index_base[ j ]; 00083 } 00084 00085 } 00086 assert( max > 0 ); 00087 00088 } 00089 00090 }
|
|
Definition at line 91 of file MAl_addon.cc.
|
|
Definition at line 126 of file MAl_addon.cc. References MAl_Readonly::get_base_global(), and mal. Referenced by DNPclass::pick_base_row_and_qual_columns(), and DNPclass::set_DNPs(). 00127 { 00128 return mal->get_base_global( row, col ); 00129 }
|
|
Definition at line 101 of file MAl_addon.cc. References max_col. Referenced by DNPclass::evaluate_DNP_candidate_positions(), DNPclass::find_DNP_candidate_positions(), and ConsAlgo::start(). 00102 { 00103 return max_col; 00104 }
|
|
Definition at line 96 of file MAl_addon.cc. References min_col. Referenced by DNPclass::find_DNP_candidate_positions(), and ConsAlgo::start(). 00097 { 00098 return min_col; 00099 }
|
|
Definition at line 111 of file MAl_addon.cc. References consensus. Referenced by DNPclass::column_is_candidate(), and ConsAlgo::start(). 00112 { 00113 return consensus[ col ].cons; 00114 }
|
|
Definition at line 116 of file MAl_addon.cc. References base_index, and consensus. Referenced by DNPclass::column_is_candidate(). 00117 { 00118 return consensus[ col ].num[ base_index[ base ] ]; 00119 }
|
|
Definition at line 121 of file MAl_addon.cc. References consensus. Referenced by ConsAlgo::start(). 00122 { 00123 return consensus[ col ].num_DNPs; 00124 }
|
|
Definition at line 106 of file MAl_addon.cc. References MAl_Readonly::get_num_seq(), and mal. Referenced by DNPclass::pick_base_row_and_qual_columns(). 00107 { 00108 return mal->get_num_seq(); 00109 }
|
|
Definition at line 131 of file MAl_addon.cc. References MAl_Readonly::get_qual_global(), and mal. Referenced by DNPclass::pick_base_row_and_qual_columns(), and DNPclass::set_DNPs(). 00132 { 00133 return mal->get_qual_global( row, col ); 00134 }
|
|
Definition at line 153 of file MAl_addon.cc. References MAl_Readonly::get_endGood_global(), and mal. Referenced by DNPclass::pick_base_row_and_qual_columns(). 00154 { 00155 return mal->get_endGood_global( row ); 00156 }
|
|
Definition at line 148 of file MAl_addon.cc. References MAl_Readonly::get_beginGood_global(), and mal. Referenced by DNPclass::pick_base_row_and_qual_columns(). 00149 { 00150 return mal->get_beginGood_global( row ); 00151 }
|
|
Definition at line 143 of file MAl_addon.cc. References MAl_Readonly::is_DNP_global(), and mal. Referenced by MAl_addon(), and DNPclass::set_DNPs(). 00144 { 00145 return mal->is_DNP_global( row, col ); 00146 }
|
|
Definition at line 137 of file MAl_addon.cc. References mal, MAl::set_DNP_global(), MAl::set_DNP_ID_global(), and MAl::set_DNP_type_global(). Referenced by DNPclass::set_DNPs(). 00138 { 00139 mal->set_DNP_global( row, col, status ); 00140 mal->set_DNP_ID_global( row, col, dnpID ); 00141 mal->set_DNP_type_global( row, col, type ); 00142 }
|
|
Definition at line 48 of file MAl_addon.h. Referenced by get_num_bases_on_col(), and MAl_addon(). |
|
Definition at line 50 of file MAl_addon.h. Referenced by get_most_freq_base_on_col(), get_num_bases_on_col(), get_num_DNPs_on_col(), and MAl_addon(). |
|
Definition at line 49 of file MAl_addon.h. Referenced by MAl_addon(). |
|
Definition at line 45 of file MAl_addon.h. Referenced by get_entry(), get_num_rows(), get_qual(), get_row_end(), get_row_start(), is_DNP(), MAl_addon(), and set_DNP(). |
|
Definition at line 47 of file MAl_addon.h. Referenced by get_max_col(), and MAl_addon(). |
|
Definition at line 46 of file MAl_addon.h. Referenced by get_min_col(), and MAl_addon(). |