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

« back to all changes in this revision

Viewing changes to demo/blastpgp.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: blastpgp.c,v 6.133 2005/08/31 20:34:02 coulouri Exp $";
 
1
static char const rcsid[] = "$Id: blastpgp.c,v 6.135 2006/05/03 14:40:49 madden Exp $";
2
2
 
3
 
/* $Id: blastpgp.c,v 6.133 2005/08/31 20:34:02 coulouri Exp $ */
 
3
/* $Id: blastpgp.c,v 6.135 2006/05/03 14:40:49 madden Exp $ */
4
4
/**************************************************************************
5
5
*                                                                         *
6
6
*                             COPYRIGHT NOTICE                            *
26
26
* appreciated.                                                            *
27
27
*                                                                         *
28
28
**************************************************************************
29
 
 * $Revision: 6.133 $ 
 
29
 * $Revision: 6.135 $ 
30
30
 * $Log: blastpgp.c,v $
 
31
 * Revision 6.135  2006/05/03 14:40:49  madden
 
32
 * Changed usage of -t flag to also include specification of whether
 
33
 * unified p-values should be used to calculate the significance of
 
34
 * alignments when composition-based statistics is used. (from Mike Gertz)
 
35
 *
 
36
 * Revision 6.134  2006/01/24 18:33:51  papadopo
 
37
 * from Mike Gertz: Use enumerated values, rather than #define'd constants, to specify the composition adjustment method
 
38
 *
31
39
 * Revision 6.133  2005/08/31 20:34:02  coulouri
32
40
 *     In PGPReadBlastOptions:
33
41
 *       - set the value of options->kappa_expect_value.
529
537
#include <ddvcreate.h>
530
538
#include <blfmtutl.h>
531
539
#include <objscoremat.h>
 
540
#include <algo/blast/composition_adjustment/composition_constants.h>
532
541
 
533
542
/* Used by the callback function. */
534
543
FILE *global_fp=NULL;
687
696
    {"Use lower case filtering of FASTA sequence",                     /* ARG_LCASE */
688
697
     "F", NULL,NULL,TRUE,'U',ARG_BOOLEAN, 0.0,0,NULL},
689
698
    { "Use composition based statistics\n"                             /* ARG_COMP_BASED_STATS */
 
699
      "As first character:\n"
690
700
      "0 or F or f: no composition-based statistics\n"
691
701
      "1 or T or t: Composition-based statistics as in NAR  29:2994--3005, 2001\n"
692
702
      "2: Composition-based score adjustment as in Bioinformatics 21:902-911, 2005, conditioned on sequence properties in round 1\n"
693
 
      "3: Composition-based score adjustment as in Bioinformatics 21:902-911, 2005, unconditionally in round 1\n",
694
 
 
 
703
      "3: Composition-based score adjustment as in Bioinformatics 21:902-911, "
 
704
      "2005, unconditionally in round 1\n"
 
705
      "As second character, if first character is equivalent to 1, 2, or 3:\n"
 
706
      "U or u: unified p-value combining alignment p-value and "
 
707
      "compositional p-value in round 1 only\n",
695
708
      "1", NULL, NULL, FALSE, 't', ARG_STRING, 0.0, 0, NULL},
696
709
    { "ASN.1 Scoremat input of checkpoint data:\n"
697
710
      "0: no scoremat input\n"
1062
1075
    case 'F':
1063
1076
    case 'f':
1064
1077
    case '0':
1065
 
        options->tweak_parameters = NO_COMP_ADJUSTMENT;
 
1078
        options->tweak_parameters = eNoCompositionBasedStats;
1066
1079
        break;
1067
1080
    case 'T':
1068
1081
    case 't':
1069
1082
    case '1':
1070
 
        options->tweak_parameters = COMP_BASED_STATISTICS;
 
1083
        options->tweak_parameters = eCompositionBasedStats;
1071
1084
        break;
1072
1085
    case '2':
1073
1086
        ErrPostEx(SEV_WARNING, 1, 0, "the -t 2 argument "
1074
1087
                  "is currently experimental\n");
1075
 
        options->tweak_parameters = COMP_MATRIX_ADJUSTMENT;
 
1088
        options->tweak_parameters = eCompositionMatrixAdjust;
1076
1089
        break;
1077
1090
    case '3':
1078
1091
        ErrPostEx(SEV_WARNING, 1, 0, "the -t 3 argument "
1079
1092
                  "is currently experimental\n");
1080
 
        options->tweak_parameters = COMP_BASED_STATISTICS |
1081
 
                                    COMP_MATRIX_ADJUSTMENT;
 
1093
        options->tweak_parameters = eCompoForceFullMatrixAdjust;
1082
1094
        break;
1083
1095
    default:
1084
1096
        ErrPostEx(SEV_FATAL, 1, 0, "invalid argument for composition-"
1085
1097
                  "based statistics; see -t options\n");
1086
1098
        break;
1087
1099
    }
 
1100
    options->unified_p = 0;
 
1101
    if (options->tweak_parameters > eNoCompositionBasedStats) {
 
1102
        switch (myargs[ARG_COMP_BASED_STATS].strvalue[1]) {
 
1103
        case 'U':
 
1104
        case 'u':
 
1105
            options->unified_p = 1;
 
1106
            ErrPostEx(SEV_WARNING, 1, 0, "unified p-values "
 
1107
                      "are currently experimental\n");
 
1108
            break;
 
1109
        case '\0':
 
1110
            break;
 
1111
        default:
 
1112
            ErrPostEx(SEV_WARNING, 1, 0, "unrecognized second character"
 
1113
                      "in value of -t, ignoring it\n");
 
1114
            break;
 
1115
        }
 
1116
    }
1088
1117
    if ((options->tweak_parameters > 1) &&
1089
1118
        ((NULL != myargs[ARG_CHECKPOINT_INPUT].strvalue) ||
1090
1119
         (NULL != myargs[ARG_ALIGNMENT_IN].strvalue))) {