~ubuntu-branches/ubuntu/edgy/ncbi-tools6/edgy

« back to all changes in this revision

Viewing changes to demo/formatrpsdb.c

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2006-07-19 23:28:07 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20060719232807-et3cdmcjgmnyleyx
Tags: 6.1.20060507-3ubuntu1
Re-merge with Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
static char const rcsid[] = "$Id: formatrpsdb.c,v 1.18 2005/06/20 19:43:03 papadopo Exp $";
 
1
static char const rcsid[] = "$Id: formatrpsdb.c,v 1.20 2006/01/25 16:22:18 camacho Exp $";
2
2
 
3
3
/*****************************************************************************
4
4
 
38
38
 
39
39
***************************************************************************
40
40
    $Log: formatrpsdb.c,v $
 
41
    Revision 1.20  2006/01/25 16:22:18  camacho
 
42
    Calculate kbp_ideal values rather than loading them from pre-computed values
 
43
 
 
44
    Revision 1.19  2005/12/22 14:22:19  papadopo
 
45
    change signature of BLAST_FillLookupTableOptions
 
46
 
41
47
    Revision 1.18  2005/06/20 19:43:03  papadopo
42
48
    explicitly specify use of PSSMs during lookup table construction
43
49
 
260
266
    BLAST_ScoreBlk *sbp;
261
267
    PssmPtr pssm = seq->pssm;
262
268
    PssmParametersPtr params = seq->params;
263
 
    Int4 *open, *extend;
264
 
    Int4 array_size;
265
 
    Nlm_FloatHi *lambda, *K, *H;
266
269
    ValNodePtr freq_list;
267
270
    ValNodePtr score_list;
268
271
    CharPtr matrix_name;
322
325
    if (sbp->kbp_gap_std[0] == NULL || sbp->kbp_gap_psi[0] == NULL)
323
326
        return -3;
324
327
        
325
 
    array_size = BlastKarlinGetMatrixValues(sbp->name, &open, &extend, 
326
 
                                            &lambda, &K, &H, NULL);
327
 
    if (array_size > 0) {
328
 
        for (i = 0; i < array_size; i++) {
329
 
            if (open[i] == INT2_MAX && extend[i] == INT2_MAX) {
330
 
                sbp->kbp_ideal = BlastKarlinBlkCreate();
331
 
                sbp->kbp_ideal->Lambda = lambda[i];
332
 
                sbp->kbp_ideal->K = K[i];
333
 
                sbp->kbp_ideal->H = H[i];
334
 
                break;
335
 
            }
336
 
        }
337
 
        MemFree(open);
338
 
        MemFree(extend);
339
 
        MemFree(lambda);
340
 
        MemFree(K);
341
 
        MemFree(H);
342
 
    }
343
328
    if (sbp->kbp_ideal == NULL)
344
329
       sbp->kbp_ideal = BlastKarlinBlkStandardCalcEx(sbp);
345
330
 
647
632
                                     eBlastTypePsiBlast,
648
633
                                     FALSE, /* no megablast */
649
634
                                     threshold, /* neighboring threshold */
650
 
                                     BLAST_WORDSIZE_PROT,
651
 
                                     FALSE /* no variable words */
 
635
                                     BLAST_WORDSIZE_PROT
652
636
                                    ) != 0) {
653
637
        ErrPostEx(SEV_ERROR, 0, 0, "Cannot set lookup table options");
654
638
        return 1;