~ubuntu-branches/debian/experimental/ncbi-tools6/experimental

« back to all changes in this revision

Viewing changes to demo/megablast.c

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2008-07-14 19:43:15 UTC
  • mfrom: (2.1.12 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080714194315-ed44u9ek7txva2rz
Tags: 6.1.20080302-3
tools/readdb.c: enable madvise()-based code on all glibc (hence all
Debian) systems, not just Linux.  (Closes: #490437.)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
static char const rcsid[] = "$Id: megablast.c,v 6.193 2006/08/29 18:13:12 papadopo Exp $";
2
 
/* $Id: megablast.c,v 6.193 2006/08/29 18:13:12 papadopo Exp $
 
1
static char const rcsid[] = "$Id: megablast.c,v 6.201 2007/10/23 16:03:23 madden Exp $";
 
2
/* $Id: megablast.c,v 6.201 2007/10/23 16:03:23 madden Exp $
3
3
**************************************************************************
4
4
*                                                                         *
5
5
*                             COPYRIGHT NOTICE                            *
26
26
*                                                                         *
27
27
************************************************************************** 
28
28
 * $Log: megablast.c,v $
 
29
 * Revision 6.201  2007/10/23 16:03:23  madden
 
30
 * No longer set ungapped_extension as an initial word option
 
31
 *
 
32
 * Revision 6.200  2007/10/03 17:12:36  papadopo
 
33
 * do not ignore the value of -H when configuring the current blast engine
 
34
 *
 
35
 * Revision 6.199  2007/03/20 14:56:58  camacho
 
36
 * Call GeneticCodeSingletonInit/GeneticCodeSingletonFini
 
37
 *
 
38
 * Revision 6.198  2007/03/15 14:24:35  coulouri
 
39
 * added call to FreeSeqLocSetComponents to free query sequences referenced by query_slp list
 
40
 *
 
41
 * Revision 6.197  2007/03/12 16:14:23  madden
 
42
 * Pass a NULL Blast_PsiCheckpointLoc* to Blast_DatabaseSearch [from Mike Gertz].
 
43
 *
 
44
 * Revision 6.196  2007/03/05 14:54:39  camacho
 
45
 * - Call Blast_FindRepeatFilterSeqLoc with a NULL pointer for a PSI-BLAST
 
46
 *   checkpoint file.
 
47
 *
 
48
 * Revision 6.195  2007/02/14 20:21:56  papadopo
 
49
 * remove discontig. megablast with stride 4 from new engine
 
50
 *
 
51
 * Revision 6.194  2007/02/08 17:07:22  papadopo
 
52
 * change signature of FillInitialWordOptions; ungapped extensions are always turned on now by default
 
53
 *
29
54
 * Revision 6.193  2006/08/29 18:13:12  papadopo
30
55
 * make 2-hit extension the default for discontiguous megablast
31
56
 *
1208
1233
#ifdef DO_NOT_SUPPRESS_BLAST_OP
1209
1234
  { "Length of a discontiguous word template (contiguous word if 0)",
1210
1235
        "0", NULL, NULL, FALSE, 't', ARG_INT, 0.0, 0, NULL},       /* ARG_TEMPL_LEN */
1211
 
  {"Generate words for every base of the database (default is every base; may only be used with discontiguous words)",
 
1236
  {"Make discontiguous megablast generate words for every base of the database (mandatory with the current BLAST engine)",
1212
1237
        "T", NULL, NULL, TRUE, 'g', ARG_BOOLEAN, 0.0, 0, NULL},    /* ARG_EVERYBASE */
1213
1238
  {"Use non-greedy (dynamic programming) extension for affine gap scores",
1214
1239
        "F", NULL, NULL, TRUE, 'n', ARG_BOOLEAN, 0.0, 0, NULL},    /* ARG_DYNAMIC */
1259
1284
   Boolean lcase_masking;
1260
1285
   MBXmlPtr mbxp = NULL;
1261
1286
   Boolean traditional_formatting;
1262
 
   
1263
1287
 
1264
1288
        blast_program = "blastn";
1265
1289
        blast_database = myargs [ARG_DB].strvalue;
1912
1936
   lookup_options->mb_template_type = 
1913
1937
      (Uint1) myargs[ARG_TEMPL_TYPE].intvalue;
1914
1938
 
1915
 
   if (myargs[ARG_EVERYBASE].intvalue && myargs[ARG_TEMPL_LEN].intvalue != 0)
1916
 
      lookup_options->full_byte_scan = FALSE;
1917
 
   
1918
1939
   BLAST_FillQuerySetUpOptions(query_setup_options, kProgram, 
1919
1940
      myargs[ARG_FILTER].strvalue, myargs[ARG_STRAND].intvalue);
1920
1941
 
1921
1942
   BLAST_FillInitialWordOptions(word_options, kProgram, 
1922
 
      greedy, myargs[ARG_WINDOW].intvalue,
 
1943
      myargs[ARG_WINDOW].intvalue,
1923
1944
      lambda*myargs[ARG_XDROP_UNGAPPED].intvalue/NCBIMATH_LN2);
1924
1945
 
1925
1946
   if (lookup_options->mb_template_length > 0) {
1929
1950
         word_options->window_size = 40;
1930
1951
   }
1931
1952
 
1932
 
   BLAST_FillExtensionOptions(ext_options, kProgram, (greedy ? 1 : 0), 
 
1953
   BLAST_FillExtensionOptions(ext_options, kProgram, greedy,
1933
1954
      lambda*myargs[ARG_XDROP].intvalue/NCBIMATH_LN2, 
1934
1955
      lambda*myargs[ARG_XDROP_FINAL].intvalue/NCBIMATH_LN2);
1935
1956
 
1936
 
   /* For discontiguous megablast we need to use a less drastic 
1937
 
      method of elimination redundant hits (at least to be compatiable 
1938
 
      with old code).  For two hits we do not perform an ungapped 
1939
 
      extension either. */
1940
 
   word_options->ungapped_extension = TRUE;
1941
 
   if (lookup_options->mb_template_length > 0)
1942
 
   {
1943
 
      if (word_options->window_size > 0)
1944
 
          word_options->ungapped_extension = FALSE;
1945
 
   }
1946
 
 
1947
1957
   BLAST_FillHitSavingOptions(hit_options, 
1948
1958
      myargs[ARG_EVALUE].floatvalue, 
1949
1959
      MAX(myargs[ARG_DESCRIPTIONS].intvalue, 
1951
1961
      score_options->gapped_calculation, 
1952
1962
      0,                /* turn off culling */
1953
1963
      diag_separation);
 
1964
   hit_options->hsp_num_max = myargs[ARG_MAXHSP].intvalue;
1954
1965
 
1955
1966
   if (myargs[ARG_MINSCORE].intvalue)
1956
1967
        hit_options->cutoff_score = myargs[ARG_MINSCORE].intvalue;
1995
2006
   Blast_SummaryReturn* full_sum_returns = NULL;
1996
2007
   EAlignView align_view = eAlignViewMax;
1997
2008
 
 
2009
   GeneticCodeSingletonInit();
 
2010
 
1998
2011
   if (myargs[ARG_OUTTYPE].intvalue == 3 ||
1999
2012
       myargs[ARG_OUTTYPE].intvalue == 4 ||
2000
2013
       myargs[ARG_OUTTYPE].intvalue == 5)
2165
2178
      /* Combine repeat mask with lower case mask */
2166
2179
      if (repeat_mask)
2167
2180
          lcase_mask = ValNodeLink(&lcase_mask, repeat_mask);
2168
 
      
 
2181
 
2169
2182
       /* The main search is here. */
2170
 
      if((status = Blast_DatabaseSearch(query_slp, dbname, lcase_mask, options, tf_data,
2171
 
                               &seqalign_arr, &filter_loc, sum_returns)) != 0)
 
2183
      if((status = Blast_DatabaseSearch(query_slp,
 
2184
                                        (Blast_PsiCheckpointLoc *) NULL,
 
2185
                                        dbname, lcase_mask, options,
 
2186
                                        tf_data, &seqalign_arr,
 
2187
                                        &filter_loc, sum_returns)) != 0)
2172
2188
      {
2173
2189
            /* Jump out if fatal error or unknown reason for exit. */
2174
2190
            if (sum_returns && sum_returns->error)
2230
2246
      Blast_SummaryReturnUpdate(sum_returns, &full_sum_returns);
2231
2247
      Blast_SummaryReturnClean(sum_returns);
2232
2248
      filter_loc = Blast_ValNodeMaskListFree(filter_loc);
 
2249
      FreeSeqLocSetComponents(query_slp);
2233
2250
      query_slp = SeqLocSetFree(query_slp);
2234
2251
   } /* End loop on sets of queries */
2235
2252
   
2259
2276
          FileClose(outfp);
2260
2277
   }
2261
2278
 
 
2279
   GeneticCodeSingletonFini();
2262
2280
   options = SBlastOptionsFree(options);
2263
2281
 
2264
2282
   return status;