~ubuntu-branches/ubuntu/maverick/ncbi-tools6/maverick

« back to all changes in this revision

Viewing changes to demo/seedtop.c

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2005-03-27 12:00:15 UTC
  • mfrom: (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050327120015-embhesp32nj73p9r
Tags: 6.1.20041020-3
* Fix FTBFS under GCC 4.0 caused by inconsistent use of "static" on
  functions.  (Closes: #295110.)
* Add a watch file, now that we can.  (Upstream's layout needs version=3.)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: seedtop.c,v 6.6 1999/09/22 17:54:21 shavirin Exp $ */
 
1
static char const rcsid[] = "$Id: seedtop.c,v 6.9 2004/04/01 13:43:06 lavr Exp $";
 
2
 
 
3
/* $Id: seedtop.c,v 6.9 2004/04/01 13:43:06 lavr Exp $ */
2
4
/**************************************************************************
3
5
*                                                                         *
4
6
*                             COPYRIGHT NOTICE                            *
33
35
 
34
36
Contents: main routine for pseed3, stand-alone counterpart to PHI-BLAST.
35
37
 
36
 
$Revision: 6.6 $
 
38
$Revision: 6.9 $
37
39
 
38
40
$Log: seedtop.c,v $
 
41
Revision 6.9  2004/04/01 13:43:06  lavr
 
42
Spell "occurred", "occurrence", and "occurring"
 
43
 
 
44
Revision 6.8  2003/05/30 17:31:10  coulouri
 
45
add rcsid
 
46
 
 
47
Revision 6.7  2003/05/13 16:02:42  coulouri
 
48
make ErrPostEx(SEV_FATAL, ...) exit with nonzero status
 
49
 
39
50
Revision 6.6  1999/09/22 17:54:21  shavirin
40
51
Now functions will collect messages in ValNodePtr before printing out.
41
52
 
143
154
        Int4  numPatOccur; /*number of pattern occurrences in query string*/
144
155
        Int4  effectiveOccurrences; /*number of occurrences not overlapping
145
156
                                      in more than half the pattern*/
146
 
        Int4  occurIndex;  /*index over pattern ocuurences*/
 
157
        Int4  occurIndex;  /*index over pattern occurrences*/
147
158
        Int4  twiceNumMatches; /*stores return value from find_hits*/
148
159
        Int4  matchIndex;  /*index for matches to a single sequence*/
149
160
        Int4 totalOccurrences = 0, newOccurrences; /*total occurrences of pattern in database*/
179
190
        queryfile = myargs[1].strvalue;
180
191
        if ((infp = FileOpen(queryfile, "r")) == NULL)
181
192
        {
182
 
          ErrPostEx(SEV_FATAL, 0, 0, "seed: Unable to open input file %s\n", queryfile);
 
193
          ErrPostEx(SEV_FATAL, 1, 0, "seed: Unable to open input file %s\n", queryfile);
183
194
          return (1);
184
195
        }
185
196
 
186
197
        patfile = myargs[2].strvalue;
187
198
        if ((patfp = FileOpen(patfile, "r")) == NULL)
188
199
        {
189
 
          ErrPostEx(SEV_FATAL, 0, 0, "seed: Unable to open pattern file %s\n", patfile);
 
200
          ErrPostEx(SEV_FATAL, 1, 0, "seed: Unable to open pattern file %s\n", patfile);
190
201
          return (1);
191
202
        }
192
203
        outputfile = myargs[3].strvalue;
195
206
        {
196
207
          if ((outfp = FileOpen(outputfile, "w")) == NULL)
197
208
            {
198
 
              ErrPostEx(SEV_FATAL, 0, 0, "seed: Unable to open output file %s\n", outputfile);
 
209
              ErrPostEx(SEV_FATAL, 1, 0, "seed: Unable to open output file %s\n", outputfile);
199
210
              return (1);
200
211
            }
201
212
        }
218
229
        /* seedSearch->cutoffScore = myargs[8].intvalue; */
219
230
        eThresh = (Nlm_FloatHi) myargs[11].floatvalue;
220
231
        if (eThresh > MAX_EVALUE) {
221
 
          ErrPostEx(SEV_FATAL, 0, 0, "E-value threshold is too high\n");
 
232
          ErrPostEx(SEV_FATAL, 1, 0, "E-value threshold is too high\n");
222
233
          return 1;
223
234
        }
224
235
 
256
267
                }
257
268
              if (query_bsp == NULL)
258
269
                {
259
 
                  ErrPostEx(SEV_FATAL, 0, 0, "Unable to obtain bioseq\n");
 
270
                  ErrPostEx(SEV_FATAL, 1, 0, "Unable to obtain bioseq\n");
260
271
                  return 2;
261
272
                }
262
273
              query = BlastGetSequenceFromBioseq(query_bsp, &queryLength);
330
341
                if ((twiceNumMatches=find_hits(list, &query[seed-1], queryLength-seed+1, FALSE, patternSearch)) < 2 || 
331
342
                    list[1] != 0) {
332
343
                  fprintf(outfp,"twiceNumMatches=%d list[1]=%d\n", i, list[1]);
333
 
                  ErrPostEx(SEV_FATAL, 0, 0, "pattern does not match the query at the place\n");
 
344
                  ErrPostEx(SEV_FATAL, 1, 0, "pattern does not match the query at the place\n");
334
345
                  return 1;
335
346
                }
336
347
                if (program_flag != PAT_MATCH_FLAG) {