~ubuntu-branches/ubuntu/intrepid/ncbi-tools6/intrepid

« back to all changes in this revision

Viewing changes to algo/blast/core/blast_options.c

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2008-03-19 19:42:00 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20080319194200-7t0o0fgni3pijh1x
Tags: 6.1.20080302-1
* New upstream release
* debian/lib{ncbi6,vibrant6a}.symbols: update and clean up.
* debian/lib{ncbi,vibrant}6-dev.install: ship new headers.
* debian/ncbi-tools-bin.docs, doc/man/tbl2asn.1: belatedly ship
  tbl2asn.txt, and restore tbl2asn.1's reference thereto.
* doc/man/*.1: correct usage of ' and -.
* doc/man/{blast,cleanasn,nps2gps,tbl2asn}.1: resync with help output.
* debian/control: tighten dependencies between binary packages.
* debian/{control,rules}: require cdbs 0.4.51; drop workaround for #462130.
* debian/{control,rules,*.override}: rename Lintian overrides to
  $pkg.lintian-overrides and employ dh_lintian from debhelper (>= 6.0.7)
  in lieu of custom logic.
* debian/*.doc-base*: modernize (and correct) section assignments per
  doc-base 0.8.10: science -> Science/Biology, net -> System/Administration.
* debian/makemenu: drop obsolete Encoding key from generated .desktop files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: blast_options.c,v 1.205 2007/05/22 20:55:36 kazimird Exp $
 
1
/* $Id: blast_options.c,v 1.207 2007/10/25 15:55:36 kazimird Exp $
2
2
 * ===========================================================================
3
3
 *
4
4
 *                            PUBLIC DOMAIN NOTICE
34
34
 
35
35
#ifndef SKIP_DOXYGEN_PROCESSING
36
36
static char const rcsid[] = 
37
 
    "$Id: blast_options.c,v 1.205 2007/05/22 20:55:36 kazimird Exp $";
 
37
    "$Id: blast_options.c,v 1.207 2007/10/25 15:55:36 kazimird Exp $";
38
38
#endif /* SKIP_DOXYGEN_PROCESSING */
39
39
 
40
40
#include <algo/blast/core/blast_options.h>
458
458
      (*options)->gap_trigger = BLAST_GAP_TRIGGER_NUCL;
459
459
      (*options)->x_dropoff = BLAST_UNGAPPED_X_DROPOFF_NUCL;
460
460
   }
461
 
   (*options)->ungapped_extension = TRUE;
 
461
 
462
462
   (*options)->program_number = program;
463
463
 
464
464
   return 0;
473
473
 
474
474
   ASSERT(options);
475
475
 
476
 
   /* For some blastn variants (i.e., megablast), and for PHI BLAST there is no
477
 
    * ungapped extension. */
 
476
   /* PHI-BLAST has no ungapped extension phase.  Megablast may not have it,
 
477
    but generally does now. */
478
478
   if (program_number != eBlastTypeBlastn  &&
479
479
       (!Blast_ProgramIsPhiBlast(program_number)) &&
480
480
       options->x_dropoff <= 0.0)
515
515
}
516
516
 
517
517
Int2
518
 
BlastExtensionOptionsNew(EBlastProgramType program, BlastExtensionOptions* *options)
 
518
BlastExtensionOptionsNew(EBlastProgramType program, BlastExtensionOptions* *options, Boolean gapped)
519
519
 
520
520
{
521
521
        *options = (BlastExtensionOptions*) 
541
541
 
542
542
    /** @todo how to determine this for PSI-BLAST bootstrap run (i.e. when
543
543
     * program is blastp? */
544
 
    if (Blast_QueryIsPssm(program) && ! Blast_SubjectIsTranslated(program)) {
 
544
    if (gapped && (Blast_QueryIsPssm(program) && ! Blast_SubjectIsTranslated(program))) {
545
545
        (*options)->compositionBasedStats = eCompositionBasedStats;
546
546
    }
547
547
 
985
985
   if (word_size)
986
986
      options->word_size = word_size;
987
987
   if ((program_number == eBlastTypeTblastn ||
988
 
        program_number == eBlastTypeBlastp) && 
 
988
        program_number == eBlastTypeBlastp ||
 
989
        program_number == eBlastTypeBlastx) && 
989
990
       word_size > 5)
990
991
       options->lut_type = eCompressedAaLookupTable;
991
992
 
1141
1142
    } else if (program_number != eBlastTypeBlastn && options->word_size > 5)
1142
1143
    {
1143
1144
        if (program_number == eBlastTypeBlastp ||
1144
 
            program_number == eBlastTypeTblastn)
 
1145
            program_number == eBlastTypeTblastn ||
 
1146
            program_number == eBlastTypeBlastx)
1145
1147
        {
1146
1148
            if (options->word_size > 7) {
1147
1149
                Blast_MessageWrite(blast_msg, eBlastSevError, 
1148
1150
                                   kBlastMessageNoContext,
1149
1151
                                   "Word-size must be less than "
1150
 
                                   "8 for a tblastn search");
 
1152
                                   "8 for a tblastn, blastp or blastx search");
1151
1153
                return BLASTERR_OPTION_VALUE_INVALID;
1152
1154
            }
1153
1155
        }
1169
1171
    }
1170
1172
 
1171
1173
    if (program_number == eBlastTypeBlastp ||
1172
 
        program_number == eBlastTypeTblastn)
 
1174
        program_number == eBlastTypeTblastn ||
 
1175
        program_number == eBlastTypeBlastx)
1173
1176
    {
1174
1177
        if (options->word_size > 5 &&
1175
1178
            options->lut_type != eCompressedAaLookupTable) {
1176
 
           Blast_MessageWrite(blast_msg, eBlastSevError, kBlastMessageNoContext,
1177
 
                         "Blastp or Tblastn with word size > 5 requires a "
1178
 
                         "compressed alphabet lookup table");
 
1179
           Blast_MessageWrite(blast_msg, eBlastSevError,
 
1180
                              kBlastMessageNoContext,
 
1181
                              "Blastp, Blastx or Tblastn with word size"
 
1182
                              " > 5 requires a "
 
1183
                              "compressed alphabet lookup table");
1179
1184
           return BLASTERR_OPTION_VALUE_INVALID;
1180
1185
        }
1181
1186
        else if (options->lut_type == eCompressedAaLookupTable &&
1412
1417
   if ((status=BlastInitialWordOptionsNew(program_number, word_options)))
1413
1418
      return status;
1414
1419
 
1415
 
   if ((status = BlastExtensionOptionsNew(program_number, ext_options)))
1416
 
      return status;
1417
 
 
1418
1420
   if ((status=BlastScoringOptionsNew(program_number, score_options)))
1419
1421
      return status;
1420
1422
 
 
1423
   if ((status = BlastExtensionOptionsNew(program_number, ext_options,
 
1424
                                       (*score_options)->gapped_calculation)))
 
1425
      return status;
 
1426
 
1421
1427
   if ((status=BlastHitSavingOptionsNew(program_number, hit_options,
1422
1428
                                        (*score_options)->gapped_calculation)))
1423
1429
      return status;
1464
1470
        }
1465
1471
    }
1466
1472
 
 
1473
    if (ext_options->compositionBasedStats != eNoCompositionBasedStats)
 
1474
    {
 
1475
            if (!Blast_QueryIsPssm(program_number) && program_number != eBlastTypeTblastn && 
 
1476
                 program_number != eBlastTypeBlastp) {
 
1477
                        Blast_MessageWrite(blast_msg, eBlastSevWarning, kBlastMessageNoContext,
 
1478
                            "Compositional adjustments are only supported with blastp or tblastn");
 
1479
                        return BLASTERR_OPTION_VALUE_INVALID;
 
1480
            }
 
1481
            if (!score_options->gapped_calculation) {
 
1482
                        Blast_MessageWrite(blast_msg, eBlastSevWarning, kBlastMessageNoContext,
 
1483
                            "Compositional adjustments are only supported for gapped searches");
 
1484
                        return BLASTERR_OPTION_VALUE_INVALID;
 
1485
            }
 
1486
            
 
1487
    }
 
1488
 
1467
1489
    return 0;
1468
1490
}
1469
1491