NCBI C Toolkit Cross Reference

C/algo/blast/api/blast_prelim.c


  1 /* $Id: blast_prelim.c,v 1.8 2006/05/24 21:17:50 camacho Exp $
  2 * ===========================================================================
  3 *
  4 *                            PUBLIC DOMAIN NOTICE
  5 *               National Center for Biotechnology Information
  6 *
  7 *  This software/database is a "United States Government Work" under the
  8 *  terms of the United States Copyright Act.  It was written as part of
  9 *  the author's offical duties as a United States Government employee and
 10 *  thus cannot be copyrighted.  This software/database is freely available
 11 *  to the public for use. The National Library of Medicine and the U.S.
 12 *  Government have not placed any restriction on its use or reproduction.
 13 *
 14 *  Although all reasonable efforts have been taken to ensure the accuracy
 15 *  and reliability of the software and data, the NLM and the U.S.
 16 *  Government do not and cannot warrant the performance or results that
 17 *  may be obtained by using this software or data. The NLM and the U.S.
 18 *  Government disclaim all warranties, express or implied, including
 19 *  warranties of performance, merchantability or fitness for any particular
 20 *  purpose.
 21 *
 22 *  Please cite the author in any work or product based on this material.
 23 *
 24 *  Author: Ilya Dondoshansky
 25 *
 26 *****************************************************************************/
 27 
 28 /** @file blast_prelim.c
 29  * Preliminary stage of a BLAST search performed by one of the threads
 30  * in a multi-threaded search.
 31  */
 32 
 33 #ifndef SKIP_DOXYGEN_PROCESSING
 34 static char const rcsid[] = "$Id: blast_prelim.c,v 1.8 2006/05/24 21:17:50 camacho Exp $";
 35 #endif /* SKIP_DOXYGEN_PROCESSING */
 36 
 37 #include <algo/blast/api/blast_prelim.h>
 38 #include <algo/blast/core/blast_util.h>
 39 #include <algo/blast/core/blast_gapalign.h>
 40 #include <algo/blast/core/blast_setup.h>
 41 #include <algo/blast/core/blast_engine.h>
 42 
 43 /** @addtogroup CToolkitAlgoBlast
 44  *
 45  * @{
 46  */
 47 
 48 BlastPrelimSearchThreadData* 
 49 BlastPrelimSearchThreadDataInit(EBlastProgramType program,
 50    BLAST_SequenceBlk* query, BlastQueryInfo* query_info,
 51    const BlastSeqSrc* seq_src, LookupTableWrap* lut, 
 52    const BlastScoringOptions* score_options, 
 53    const BlastInitialWordOptions* word_options,
 54    const BlastExtensionOptions* ext_options, 
 55    const BlastHitSavingOptions* hit_options,
 56    const BlastEffectiveLengthsOptions* eff_len_options,
 57    const PSIBlastOptions* psi_options, 
 58    const BlastDatabaseOptions* db_options,
 59    BlastScoreBlk* sbp, BlastDiagnostics* diagnostics,
 60    BlastHSPStream* hsp_stream)
 61 {
 62    BlastPrelimSearchThreadData* data = (BlastPrelimSearchThreadData*)
 63       calloc(1, sizeof(BlastPrelimSearchThreadData));
 64    
 65    data->program = program;
 66    data->query = query;
 67    data->query_info = BlastQueryInfoDup(query_info);
 68    data->seq_src = BlastSeqSrcCopy(seq_src);
 69    data->lut = lut;
 70    data->score_options = score_options;
 71    data->word_options = word_options;
 72    data->ext_options = ext_options;
 73    data->hit_options = hit_options;
 74    data->eff_len_options = eff_len_options;
 75    data->psi_options = psi_options;
 76    data->db_options = db_options;
 77    data->sbp = sbp;
 78    data->diagnostics = diagnostics;
 79    data->hsp_stream = hsp_stream;
 80    
 81    return data;
 82 }
 83 
 84 
 85 BlastPrelimSearchThreadData* 
 86 BlastPrelimSearchThreadDataFree(BlastPrelimSearchThreadData* data)
 87 {
 88    if (!data)
 89       return NULL;
 90 
 91    BlastSeqSrcFree(data->seq_src);
 92    BlastQueryInfoFree(data->query_info);
 93    sfree(data);
 94    return NULL;
 95 }
 96 
 97 void* Blast_PrelimSearchThreadRun(void* data)
 98 {
 99    void* ret_status = NULL;
100    Int2 status = 0;
101    BlastPrelimSearchThreadData* search_data = 
102       (BlastPrelimSearchThreadData*) data;
103    
104    status = Blast_RunPreliminarySearch(search_data->program, search_data->query, 
105                 search_data->query_info, search_data->seq_src, 
106                 search_data->score_options, search_data->sbp, search_data->lut, 
107                 search_data->word_options, search_data->ext_options, 
108                 search_data->hit_options, search_data->eff_len_options, 
109                 search_data->psi_options, search_data->db_options, 
110                 search_data->hsp_stream, search_data->diagnostics);
111 
112    BlastPrelimSearchThreadDataFree(search_data);
113 
114    return ret_status;
115 }
116 /* @} */
117 
118 

source navigation ]   [ diff markup ]   [ identifier search ]   [ freetext search ]   [ file search ]  

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.