2 /* copyright (c) 1996, 1997, 1998, 1999 William R. Pearson and the
5 /* $Name: fa_34_26_5 $ - $Id: showrss.c,v 1.12 2006/04/12 18:00:02 wrp Exp $ */
22 zs_to_E(double zs, int n1, int isdna, long entries,struct db_str db);
23 extern double zs_to_bit(double zs, int n0, int n1);
24 extern double zs_to_p(double zs);
26 extern double (*find_zp)(int score, double escore, int length, double comp, void *);
28 extern char *prog_func;
30 void showbest (FILE *fp, unsigned char **aa0, unsigned char *aa1, int maxn,
31 struct beststr **bptr, int nbest, int qlib, struct mngmsg *m_msg,
32 struct pstruct pst, struct db_str db,
33 char *gstring2, void **f_str)
40 if ((rlabel=strrchr(m_msg->label,' '))==NULL) rlabel = m_msg->label;
42 fprintf(fp,"\n %s - %d shuffles; ",prog_func,m_msg->shuff_max);
43 if (m_msg->shuff_wid > 0)
44 fprintf(fp," window shuffle, window size: %d\n",m_msg->shuff_wid);
46 fprintf(fp," uniform shuffle\n");
50 fprintf(fp," unshuffled %s score: %d; bits(s=%d|n_l=%d): %4.1f p(%d) < %g\n",
51 rlabel,bbp->score[0],bbp->score[0], bbp->n1,
52 zs_to_bit(bbp->zscore,m_msg->n0,bbp->n1),bbp->score[0],zs_to_p(bbp->zscore));
54 fprintf(fp,"For %ld sequences, a score >= %d is expected %4.4g times\n\n",
55 pst.zdb_size,bbp->score[0],zs_to_E(bbp->zscore,bbp->n1,0l,pst.zdb_size,db));
58 void showalign (FILE *fp, unsigned char *aa0, unsigned char *aa1, int maxn,
59 struct beststr **bptr, int nbest,int qlib, struct mngmsg m_msg,
60 struct pstruct pst, void *f_str, char *gstring2)
65 aancpy(char *to, char *from, int count,
71 while (count-- && *from) {
72 if (*from <= pst.nsq) *tp++ = pst.sq[*(from++)];