reduce warning messages in sequence.cxx
authorDiane Trout <diane@caltech.edu>
Sat, 25 Feb 2006 02:47:46 +0000 (02:47 +0000)
committerDiane Trout <diane@caltech.edu>
Sat, 25 Feb 2006 02:47:46 +0000 (02:47 +0000)
alg/sequence.cxx
mussagl.pro

index 920194690342dfb42684187b0ab85c4efe0fe16f..fb68dbed7e7ae59d2c53dd7ac9976d40d82bf01c 100644 (file)
@@ -122,20 +122,20 @@ string Sequence::filter_sequence(const string &old_seq,
   conversionTable[256] = '\0';
 
   // we want these to map to themselves - ie not to change
-  conversionTable['A'] = 'A';
-  conversionTable['T'] = 'T';
-  conversionTable['G'] = 'G';
-  conversionTable['C'] = 'C';
+  conversionTable[(int)'A'] = 'A';
+  conversionTable[(int)'T'] = 'T';
+  conversionTable[(int)'G'] = 'G';
+  conversionTable[(int)'C'] = 'C';
   // this is to upcase
-  conversionTable['a'] = 'A';
-  conversionTable['t'] = 'T';
-  conversionTable['g'] = 'G';
-  conversionTable['c'] = 'C';
+  conversionTable[(int)'a'] = 'A';
+  conversionTable[(int)'t'] = 'T';
+  conversionTable[(int)'g'] = 'G';
+  conversionTable[(int)'c'] = 'C';
 
   // finally, the actual conversion loop
-  for(int seq_index = 0; seq_index < count; seq_index++)
+  for(string::size_type seq_index = 0; seq_index < count; seq_index++)
   {
-    new_seq += conversionTable[ old_seq[seq_index+start]];
+    new_seq += conversionTable[ (int)old_seq[seq_index+start]];
   }
   return new_seq;
 }
@@ -150,7 +150,7 @@ Sequence::load_annot(string file_path, int start_index, int end_index)
   fstream data_file;
   string file_data_line;
   annot an_annot;
-  int space_split_i;
+  string::size_type space_split_i;
   string annot_value;
   list<annot>::iterator list_i;
   string err_msg;
@@ -193,31 +193,31 @@ Sequence::load_annot(string file_path, int start_index, int end_index)
         file_data_line = file_data_line.substr(space_split_i+1);
 
         cout << "seq, annots: " << an_annot.start << ", " << an_annot.end
-            << endl;
+                  << endl;
 
         // get annot name
         space_split_i = file_data_line.find(" ");
-       if (space_split_i == string::npos)  // no entries for name & type
-       {
-         cout << "seq, annots - no name or type\n";
-         an_annot.name = "";
-         an_annot.type = "";
-       }
-       else
-       {
-         annot_value = file_data_line.substr(0,space_split_i);
-         an_annot.name = annot_value;
-         file_data_line = file_data_line.substr(space_split_i+1);
+        if (space_split_i == string::npos)  // no entries for name & type
+        {
+          cout << "seq, annots - no name or type\n";
+          an_annot.name = "";
+          an_annot.type = "";
+        }
+        else
+        {
+          annot_value = file_data_line.substr(0,space_split_i);
+          an_annot.name = annot_value;
+          file_data_line = file_data_line.substr(space_split_i+1);
           // get annot type
-         space_split_i = file_data_line.find(" ");
-         if (space_split_i == string::npos)  // no entry for type
-           an_annot.type = "";
-         else
-         {
-           annot_value = file_data_line.substr(0,space_split_i);
-           an_annot.type = annot_value;
-         }
-       }
+          space_split_i = file_data_line.find(" ");
+          if (space_split_i == string::npos)  // no entry for type
+            an_annot.type = "";
+          else
+          {
+            annot_value = file_data_line.substr(0,space_split_i);
+            an_annot.type = annot_value;
+          }
+        }
 
 
         // add annot to list if it falls within the range of sequence specified
@@ -296,11 +296,11 @@ Sequence::rev_comp() const
   conversionTable[256] = '\0';
 
   // add in the characters for the bases we want to convert
-  conversionTable['A'] = 'T';
-  conversionTable['T'] = 'A';
-  conversionTable['G'] = 'C';
-  conversionTable['C'] = 'G';
-  conversionTable['N'] = 'N';
+  conversionTable[(int)'A'] = 'T';
+  conversionTable[(int)'T'] = 'A';
+  conversionTable[(int)'G'] = 'C';
+  conversionTable[(int)'C'] = 'G';
+  conversionTable[(int)'N'] = 'N';
 
   // finally, the actual conversion loop
   for(seq_i = len - 1; seq_i >= 0; seq_i--)
@@ -357,7 +357,6 @@ Sequence::save(fstream &save_file)
 {
   //fstream save_file;
   list<annot>::iterator annots_i;
-  int i;
 
   // not sure why, or if i'm doing something wrong, but can't seem to pass
   // file pointers down to this method from the mussa control class
@@ -386,7 +385,7 @@ Sequence::load_museq(string load_file_path, int seq_num)
   string file_data_line;
   int seq_counter;
   annot an_annot;
-  int space_split_i;
+  string::size_type space_split_i;
   string annot_value;
 
   annots.clear();
@@ -477,21 +476,21 @@ Sequence::rc_motif(string a_motif)
   conversionTable[256] = '\0';
 
   // add in the characters for the bases we want to convert (IUPAC)
-  conversionTable['A'] = 'T';
-  conversionTable['T'] = 'A';
-  conversionTable['G'] = 'C';
-  conversionTable['C'] = 'G';
-  conversionTable['N'] = 'N';
-  conversionTable['M'] = 'K';
-  conversionTable['R'] = 'Y';
-  conversionTable['W'] = 'W';
-  conversionTable['S'] = 'S';
-  conversionTable['Y'] = 'R';
-  conversionTable['K'] = 'M';
-  conversionTable['V'] = 'B';
-  conversionTable['H'] = 'D';
-  conversionTable['D'] = 'H';
-  conversionTable['B'] = 'V';
+  conversionTable[(int)'A'] = 'T';
+  conversionTable[(int)'T'] = 'A';
+  conversionTable[(int)'G'] = 'C';
+  conversionTable[(int)'C'] = 'G';
+  conversionTable[(int)'N'] = 'N';
+  conversionTable[(int)'M'] = 'K';
+  conversionTable[(int)'R'] = 'Y';
+  conversionTable[(int)'W'] = 'W';
+  conversionTable[(int)'S'] = 'S';
+  conversionTable[(int)'Y'] = 'R';
+  conversionTable[(int)'K'] = 'M';
+  conversionTable[(int)'V'] = 'B';
+  conversionTable[(int)'H'] = 'D';
+  conversionTable[(int)'D'] = 'H';
+  conversionTable[(int)'B'] = 'V';
 
   // finally, the actual conversion loop
   for(seq_i = len - 1; seq_i >= 0; seq_i--)
@@ -589,7 +588,8 @@ void
 Sequence::motif_scan(string a_motif, vector<int> * motif_match_starts)
 {
   char * seq_c;
-  int seq_i, motif_i, motif_len;
+  string::size_type seq_i;
+  int motif_i, motif_len;
 
   // faster to loop thru the sequence as a old c string (ie char array)
   seq_c = (char*)sequence.c_str();
index a16210857366f6e8da7300e8956d6b0c6ddcf213..73826dd4356e435bfcb339f794f829da53a736ef 100644 (file)
@@ -12,21 +12,23 @@ INCLUDEPATH += . alg qui
 
 # Input
 HEADERS += mussa_exceptions.hh \
-           qui/PathWindow.h 
-#           alg/flp.hh \
-#           alg/mussa_class.hh \
-#           alg/nway_paths.hh \
-#           alg/sequence.hh \
+           qui/PathWindow.h \
+           qui/PathScene.h \
+           alg/flp.hh \
+           alg/mussa_class.hh \
+           alg/nway_paths.hh \
+           alg/sequence.hh
 SOURCES += mussagl.cxx \
-           qui/PathWindow.cxx 
-#           alg/flp.cxx \
-#           alg/flp_seqcomp.cxx \
-#           alg/mussa_class.cxx \
-#           alg/nway_entropy.cxx \
-#           alg/nway_other.cxx \
-#           alg/nway_paths.cxx \
+           qui/PathWindow.cxx \
+           qui/PathScene.cxx \
+           alg/flp.cxx \
+           alg/flp_seqcomp.cxx \
+           alg/mussa_class.cxx \
+           alg/nway_entropy.cxx \
+           alg/nway_other.cxx \
+           alg/nway_paths.cxx \
 #           alg/nway_refine.cxx \
-#           alg/sequence.cxx \
+           alg/sequence.cxx 
 #           test/test_flp.cxx \
 #           test/test_main.cxx \
 #           test/test_mussa.cxx \