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_forward_one(vector<string> Aligned_Sequences, int start, int length) {
	int end = start + length;
	if (end > Aligned_Sequences[0].size()) {
		return Aligned_Sequences[0].size();
	}
	bool exist_equal = false;
	while (true) {
		for (int i = 0; i < Aligned_Sequences.size(); ++i) {
			string substring = Aligned_Sequences[i].substr(start, end - start);
			string rp_substring = replace(substring, "-", "");
			if (rp_substring.size() == length) {
				return end;
			}
		}
		end++;
		if (end > Aligned_Sequences[0].size()) {
			return Aligned_Sequences[0].size();
		}
	}
}
int Find_length_index_forward_one ( vector < string > Aligned_Sequences , int start , int length ) { int end = start + length ; if ( end > Aligned_Sequences [ 0 ] . size ( ) ) { return Aligned_Sequences [ 0 ] . size ( ) ; } bool exist_equal = false ; while ( true ) { for ( int i = 0 ; i < Aligned_Sequences . size ( ) ; ++ i ) { string substring = Aligned_Sequences [ i ] . substr ( start , end - start ) ; string rp_substring = replace ( substring , " " , " " ) ; if ( rp_substring . size ( ) == length ) { return end ; } } end ++ ; if ( end > Aligned_Sequences [ 0 ] . size ( ) ) { return Aligned_Sequences [ 0 ] . size ( ) ; } } }
find the index that all sequences length below maxlength.
find the index that all sequences length below maxlength .
//exist at least one sequence, its length is equal to requirements.
