define window for showing a mussa alignment
[mussa.git] / gui / SeqView.cpp
index 24f7819cbbca0cdef288f6fd1bdc103d1d50fbc4..419d21e2d887ae70b9709a14a8c2bf56c81de1d2 100644 (file)
@@ -24,7 +24,6 @@ SeqView::setup(string name, int sq_num,
                vector<fltk_motif> *some_motifs)
 {
   int seq_i;
-  list<ExtendedConservedPath >::iterator pathz_i;
 
   analysis_name = name;
   seq_num = sq_num;
@@ -46,7 +45,9 @@ SeqView::setup(string name, int sq_num,
   for(seq_i = 0; seq_i < seq_num; ++seq_i)
     raw_sequence.push_back( (*S)[seq_i].get_seq() );
 
-  for(pathz_i = P.begin(); pathz_i != P.end(); ++pathz_i)
+  for(list<ExtendedConservedPath >::iterator pathz_i = P.begin(); 
+      pathz_i != P.end(); 
+      ++pathz_i)
   {
     show_aligns.push_back(true);
   }  
@@ -217,7 +218,6 @@ void
 SeqView::draw_match_lines(double ch_width)
 {
   int i, y_loc;
-  list<ExtendedConservedPath >::iterator pathz_i;
   int i2, i3;
   int x_start, y_start, x_end, y_end;
   int window_length, win_i;
@@ -233,22 +233,16 @@ SeqView::draw_match_lines(double ch_width)
 
 
   align_counter = 0;
-  for(pathz_i = P.begin(); pathz_i != P.end(); ++pathz_i)
+  for(list<ExtendedConservedPath >::iterator pathz_i = P.begin(); 
+      pathz_i != P.end(); 
+      ++pathz_i)
   {
     if (show_aligns[align_counter])
     {
       ExtendedConservedPath& a_path = *pathz_i;
       window_length = a_path.window_size;
-
       // determine which parts of the path are RC relative to first species
-      rc_list.clear();
-      for(i2 = 0; i2 < a_path.size()-1; i2++)
-      {
-        if (a_path[i2] < 0)
-          rc_list.push_back(true);
-        else
-          rc_list.push_back(false);
-      }
+      rc_list = a_path.reverseComplimented();
       
       // loop over each bp in the conserved region for all sequences
       for(win_i = 0; win_i < window_length; win_i++)
@@ -428,7 +422,7 @@ SeqView::align_offsets(int align_num)
     for(i = 0; i < seq_num ; i++)
     {
       //cout << (*pathz_i)[i+1] << endl;
-      seq_align_offsets.push_back( abs((*pathz_i)[i+1]) );
+      seq_align_offsets.push_back( abs((*pathz_i).track_indexes[i]) );
       // for testing purposes: to see everything in the short test sequences
       //seq_align_offsets.push_back(0);
     }