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;
}
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;
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
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--)
{
//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
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();
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--)
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();