⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 std_calculation_funcs.c

📁 马尔科夫模型的java版本实现
💻 C
📖 第 1 页 / 共 4 页
字号:
    if(normalize == NO) {    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->share);          }  }  else {    prf_column_length = 0.0;    for(a_index = 0; a_index < a_size; a_index++) {      prf_column_length += pow(((msa_seq + get_mtx_index(p, a_index, a_size+1))->share),2);    }    prf_column_length = sqrt(prf_column_length);    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->share) / prf_column_length;    }  }}void add_to_E_picasso(double *E, double Eka_base, struct msa_letter_s *msa_seq, int p,		      int k, int a_size, int normalize){  /* k is a state index, p is a sequence position index */    int a_index;  double prf_column_length;  if(normalize == NO) {    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->share);    }  }  else {    prf_column_length = 0.0;    for(a_index = 0; a_index < a_size; a_index++) {      prf_column_length += pow(((msa_seq + get_mtx_index(p, a_index, a_size+1))->share),2);    }    prf_column_length = sqrt(prf_column_length);    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->share) / prf_column_length;    }  }}void add_to_E_picasso_sym(double *E, double Eka_base, struct msa_letter_s *msa_seq, int p,		      int k, int a_size, int normalize){  /* k is a state index, p is a sequence position index */    int a_index;  double prf_column_length;  if(normalize == NO) {    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->share);    }  }  else {    prf_column_length = 0.0;    for(a_index = 0; a_index < a_size; a_index++) {      prf_column_length += pow(((msa_seq + get_mtx_index(p, a_index, a_size+1))->share),2);    }    prf_column_length = sqrt(prf_column_length);    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->share) / prf_column_length;    }  }}void add_to_E_sjolander_score(double *E, double Eka_base, struct msa_letter_s *msa_seq, int p,			      int k, int a_size, int normalize){  /* k is a state index, p is a sequence position index */    int a_index;  double prf_column_length;  if(normalize == NO) {    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->share);    }  }  else {    prf_column_length = 0.0;    for(a_index = 0; a_index < a_size; a_index++) {      prf_column_length += pow(((msa_seq + get_mtx_index(p, a_index, a_size+1))->share),2);    }    prf_column_length = sqrt(prf_column_length);    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->share) / prf_column_length;    }  }}void add_to_E_sjolander_reversed_score(double *E, double Eka_base, struct msa_letter_s *msa_seq, int p,				       int k, int a_size, int normalize){  /* k is a state index, p is a sequence position index */    int a_index;  double prf_column_length;    if(normalize == NO) {    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->share);          }  }  else {    prf_column_length = 0.0;    for(a_index = 0; a_index < a_size; a_index++) {      prf_column_length += pow(((msa_seq + get_mtx_index(p, a_index, a_size+1))->share),2);    }    prf_column_length = sqrt(prf_column_length);    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->share) / prf_column_length;    }  }}void add_to_E_dot_product_nr_occ(double *E, double Eka_base, struct msa_letter_s *msa_seq, int p,				 int k, int a_size, int normalize){  /* k is a state index, p is a sequence position index */    int a_index;  double prf_column_length;  if(normalize == NO) {    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->nr_occurences);          }  }  else {    prf_column_length = 0.0;    for(a_index = 0; a_index < a_size; a_index++) {      prf_column_length += pow(((msa_seq + get_mtx_index(p, a_index, a_size+1))->share),2);    }    prf_column_length = sqrt(prf_column_length);    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->nr_occurences) / prf_column_length;    }  }}void add_to_E_dot_product_picasso_nr_occ(double *E, double Eka_base, struct msa_letter_s *msa_seq, int p,					 int k, int a_size, int normalize){  /* k is a state index, p is a sequence position index */    int a_index;  double prf_column_length;  if(normalize == NO) {    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->nr_occurences);          }  }  else {    prf_column_length = 0.0;    for(a_index = 0; a_index < a_size; a_index++) {      prf_column_length += pow(((msa_seq + get_mtx_index(p, a_index, a_size+1))->share),2);    }    prf_column_length = sqrt(prf_column_length);    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->nr_occurences) / prf_column_length;    }  }}void add_to_E_picasso_nr_occ(double *E, double Eka_base, struct msa_letter_s *msa_seq, int p,				 int k, int a_size, int normalize){  /* k is a state index, p is a sequence position index */    int a_index;  double prf_column_length;  if(normalize == NO) {    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->nr_occurences);          }  }  else {    prf_column_length = 0.0;    for(a_index = 0; a_index < a_size; a_index++) {      prf_column_length += pow(((msa_seq + get_mtx_index(p, a_index, a_size+1))->share),2);    }    prf_column_length = sqrt(prf_column_length);    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->nr_occurences) / prf_column_length;    }  }}void add_to_E_picasso_sym_nr_occ(double *E, double Eka_base, struct msa_letter_s *msa_seq, int p,				 int k, int a_size, int normalize){  /* k is a state index, p is a sequence position index */    int a_index;  double prf_column_length;  if(normalize == NO) {    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->nr_occurences);          }  }  else {    prf_column_length = 0.0;    for(a_index = 0; a_index < a_size; a_index++) {      prf_column_length += pow(((msa_seq + get_mtx_index(p, a_index, a_size+1))->share),2);    }    prf_column_length = sqrt(prf_column_length);    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->nr_occurences) / prf_column_length;    }  }}void add_to_E_sjolander_score_nr_occ(double *E, double Eka_base, struct msa_letter_s *msa_seq, int p,				     int k, int a_size, int normalize){  /* k is a state index, p is a sequence position index */    int a_index;  double prf_column_length;    if(normalize == NO) {    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->nr_occurences);          }  }  else {    prf_column_length = 0.0;    for(a_index = 0; a_index < a_size; a_index++) {      prf_column_length += pow(((msa_seq + get_mtx_index(p, a_index, a_size+1))->share),2);    }    prf_column_length = sqrt(prf_column_length);    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->nr_occurences) / prf_column_length;    }  }}void add_to_E_sjolander_reversed_score_nr_occ(double *E, double Eka_base, struct msa_letter_s *msa_seq, int p,					      int k, int a_size, int normalize){  /* k is a state index, p is a sequence position index */    int a_index;  double prf_column_length;    if(normalize == NO) {    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->nr_occurences);          }  }  else {    prf_column_length = 0.0;    for(a_index = 0; a_index < a_size; a_index++) {      prf_column_length += pow(((msa_seq + get_mtx_index(p, a_index, a_size+1))->share),2);    }    prf_column_length = sqrt(prf_column_length);    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->nr_occurences) / prf_column_length;    }  }}void add_to_E_subst_mtx_product(double *E, double Eka_base, struct msa_letter_s *msa_seq, int p,			  int k, int a_size, int normalize, double *subst_mtx){  int a_index, a_index2;  double prf_column_length;  double subst_mtx_row_length;    if(normalize == NO) {    for(a_index = 0; a_index < a_size; a_index++) {      for(a_index2 = 0; a_index2 < a_size; a_index2++) {	*(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	  (double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->share) *	  *(subst_mtx + get_mtx_index(a_index, a_index2, a_size));      }    }  }  else {    printf("Error: no normalizing in subst_mtx_product, yet...\n");    exit(0);  }}void add_to_E_subst_mtx_product_nr_occ(double *E, double Eka_base, struct msa_letter_s *msa_seq, int p,				       int k, int a_size, int normalize, double *subst_mtx){  int a_index, a_index2;  double prf_column_length;  double subst_mtx_row_length;    if(normalize == NO) {    for(a_index = 0; a_index < a_size; a_index++) {      for(a_index2 = 0; a_index2 < a_size; a_index2++) {	*(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	  (double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->nr_occurences) *	  *(subst_mtx + get_mtx_index(a_index, a_index2, a_size));      }    }  }  else {    printf("Error: no normalizing in subst_mtx_product, yet...\n");    exit(0);  }}void add_to_E_subst_mtx_dot_product(double *E, double Eka_base, struct msa_letter_s *msa_seq, int p,			  int k, int a_size, int normalize, double *subst_mtx, char *alphabet){  /* k is a state index, p is a sequence position index */    int a_index;  double prf_column_length, subst_mtx_row_length;  int query_index;    query_index = get_alphabet_index_msa_query((msa_seq + (p * (a_size+1)))->query_letter, alphabet, a_size);  if(normalize == NO) {    for(a_index = 0; a_index < a_size; a_index++) {      *(E + get_mtx_index(k, a_index, a_size)) += Eka_base *	(double)((msa_seq + get_mtx_index(p, a_index, a_size+1))->share) *	*(subst_mtx + get_mtx_index(query_index, a_index, a_size));    }  }  else {    prf_column_length = 0.0;    for(a_index = 0; a_index < a_size; a_index++) {      prf_column_length += pow(((msa_seq + get_mtx_index(p, a_index, a_size+1))->share),2);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -