7 const uint32_t MAX_SIZE = 100000;
9 bool check_if_equal(
char** n,
int n_size, std::ifstream *f){
10 if(*n[0] ==
'\n' || *n[0] ==
'\0' || *n[0]==EOF || f[0].eof())
12 for(
int i = 1; i < n_size;i++){
13 if(*n[i] != *n[0] || *n[i] ==
'\0' || *n[i] ==
'\n' || *n[0]==EOF || f[i].eof())
19 int compare_consensus(
char** f,
int n_string, std::string out){
20 std::ifstream *cns =
new std::ifstream[n_string];
21 std::ofstream o(out+
".fa");
22 o <<
">Common_Consensus" << std::endl;
24 char** l =
new char*[n_string];
25 for(i = 0; i < n_string;i++){
26 std::cout << f[i+1] << std::endl;
28 cns[i].open(f[i + 1]);
31 std::cout <<
"Error " << f[i] <<
" is not a fasta file." << std::endl;
40 while(!check_if_equal(l, n_string, cns)){
41 for(j = 0; j<n_string;j++){
45 for(j = 0; j < n_string; j++)
47 std::cout <<
"Warning: No common regions between consensus sequences" << std::endl;
50 while(check_if_equal(l, n_string, cns)){
52 for(j = 0; j<n_string;j++){
56 for(i = 0; i < n_string; i++){
65 int main(
int argv,
char** argc){
66 compare_consensus(argc, argv - 1,
"test");
int main(int argc, char *argv[])