utils/utils.cpp
//find the index that all sequences length below maxlength.

find the index that all sequences length below maxlength.
find the index that all sequences length below maxlength .
int Find_length_index_backward_one(vector<string> Aligned_Sequences, int start, int length) {
	int end = start - length + 1;
	if (end < 0) {
		return 0;
	}
	bool exist_equal = false;
	while (true) {
		for (int i = 0; i < Aligned_Sequences.size(); ++i) {
			string substring = Aligned_Sequences[i].substr(end, start - end + 1);
			string rp_substring = replace(substring, "-", "");
			if (rp_substring.size() == length) {
				return end;
			}
		}
		end--;
		if (end < 0) {
			return 0;
		}
	}
}
int Find_length_index_backward_one ( vector < string > Aligned_Sequences , int start , int length ) { int end = start - length + 1 ; if ( end < 0 ) { return 0 ; } bool exist_equal = false ; while ( true ) { for ( int i = 0 ; i < Aligned_Sequences . size ( ) ; ++ i ) { string substring = Aligned_Sequences [ i ] . substr ( end , start - end + 1 ) ; string rp_substring = replace ( substring , " " , " " ) ; if ( rp_substring . size ( ) == length ) { return end ; } } end -- ; if ( end < 0 ) { return 0 ; } } }
find the index that all sequences length below maxlength.
find the index that all sequences length below maxlength .