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

📄 sc_to_e.c

📁 序列对齐 Compare a protein sequence to a protein sequence database or a DNA sequence to a DNA sequenc
💻 C
字号:
/* copyright (c) 1996, 1997, 1998, 1999 William R. Pearson and the   U. of Virginia *//* $Name: fa35_03_06 $ - $Id: sc_to_e.c,v 1.2 2006/04/12 18:00:02 wrp Exp $ *//* sc_to_e  uses statistical parameters from search and	    score, length, and database size to calculate E()*/#include <stdio.h>#include <stdlib.h>#include <math.h>double mean_var, mu, rho;main(argc, argv)     int argc; char **argv;{  char line[128];  int score, length, db_size;  double z_val, s_to_zv(), zv_to_E();  if (argc == 4) {    sscanf(argv[1],"%lf",&rho);    sscanf(argv[2],"%lf",&mu);    sscanf(argv[3],"%lf",&mean_var);  }  else {    fprintf(stderr," enter rho mu mean_var: ");    fgets(line,sizeof(line),stdin);    sscanf(line,"%lf %lf %lf",&rho, &mu, &mean_var);  }  while (1) {    fprintf(stderr," enter score length db_size: ");    if (fgets(line,sizeof(line),stdin)==NULL) exit(0);    if (line[0]=='\n') exit(0);    sscanf(line,"%d %d %d",&score, &length, &db_size);    if (db_size < 1) db_size = 50000;    z_val = s_to_zv(score, length);    printf(" s: %d (%d) E(%d): %4.2g\n",score,length,db_size,zv_to_E(z_val,db_size));  }}double s_to_zv(int score, int length){  return ((double)score - rho * log((double)length) - mu)/sqrt(mean_var);}double zv_to_E(double zv, int db_size){  double e;  e = exp(-1.282554983 * zv - .577216);  return (double)db_size * (e > .01 ? 1.0 - exp(-e) : e);}

⌨️ 快捷键说明

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