+// This file is part of the Mussa source distribution.
+// http://mussa.caltech.edu/
+// Contact author: Tristan De Buysscher, tristan@caltech.edu
+
+// This program and all associated source code files are Copyright (C) 2005
+// the California Institute of Technology, Pasadena, CA, 91125 USA. It is
+// under the GNU Public License; please see the included LICENSE.txt
+// file for more information, or contact Tristan directly.
+
+
+// This file is part of the Mussa source distribution.
+// http://mussa.caltech.edu/
+// Contact author: Tristan De Buysscher, tristan@caltech.edu
+
+// This program and all associated source code files are Copyright (C) 2005
+// the California Institute of Technology, Pasadena, CA, 91125 USA. It is
+// under the GNU Public License; please see the included LICENSE.txt
+// file for more information, or contact Tristan directly.
+
+
// ----------------------------------------
// ---------- sequence.cc -----------
// ----------------------------------------
Sequence::set_seq(string a_seq)
{
sequence = a_seq;
+ length = sequence.length();
}
cout << "motif is: " << a_motif << endl;
a_motif = motif_validate(a_motif);
- cout << "motif is: " << a_motif << endl;
+ //cout << "motif is: " << a_motif << endl;
- motif_scan(a_motif, &motif_match_starts);
- a_motif_rc = rc_motif(a_motif);
- // make sure not to do search again if it is a palindrome
- if (a_motif_rc != a_motif)
- motif_scan(a_motif_rc, &motif_match_starts);
+ if (a_motif != "")
+ {
+ cout << "Sequence: none blank motif\n";
+ motif_scan(a_motif, &motif_match_starts);
+ a_motif_rc = rc_motif(a_motif);
+ // make sure not to do search again if it is a palindrome
+ if (a_motif_rc != a_motif)
+ motif_scan(a_motif_rc, &motif_match_starts);
+ }
return motif_match_starts;
}
// faster to loop thru the sequence as a old c string (ie char array)
seq_c = (char*)sequence.c_str();
+ //cout << "Sequence: motif, seq len = " << sequence.length() << endl;
motif_len = a_motif.length();
//cout << "motif_length: " << motif_len << endl;
motif_i = 0;
- cout << "motif: " << a_motif << endl;
+ //cout << "motif: " << a_motif << endl;
- //cout << "length: " << length << endl;
+ //cout << "Sequence: motif, length= " << length << endl;
seq_i = 0;
while (seq_i < length)
{
+ cout << seq_c[seq_i];
//if ((seq_i > 10885) && (seq_i < 10917))
//cout << seq_c[seq_i] << "?" << a_motif[motif_i] << ":" << motif_i << " ";
// this is pretty much a straight translation of Nora's python code