NCBI C++ ToolKit
rmblast_traceback_unit_test.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: rmblast_traceback_unit_test.cpp 92012 2020-12-17 15:27:34Z grichenk $
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 official 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 * ===========================================================================
25 *
26 * Author: Robert Hubley ( boiler plate: Tom Madden )
27 *
28 * File Description:
29 * Unit test module for traceback calculation in RMBlast
30 *
31 * ===========================================================================
32 */
33 #include <ncbi_pch.hpp>
34 #include <corelib/test_boost.hpp>
35 
36 #include <corelib/ncbitime.hpp>
38 #include <objmgr/scope.hpp>
40 #include <objmgr/util/sequence.hpp>
41 
46 #include <serial/serial.hpp>
47 #include <serial/iterator.hpp>
48 #include <serial/objostr.hpp>
49 
52 #include <blast_objmgr_priv.hpp>
53 
57 
70 
75 
78 
79 #include "test_objmgr.hpp"
80 #include "blast_test_util.hpp"
81 
82 using namespace std;
83 using namespace ncbi;
84 using namespace ncbi::objects;
85 using namespace ncbi::blast;
86 
88 
89 public:
98 
99 
101  m_ScoreBlk=NULL;
102  m_LookupSegments=NULL;
103  m_BlastMessage=NULL;
104  m_ScoreParams = NULL;
105  m_ExtParams=NULL;
106  m_HitParams=NULL;
107  m_EffLenParams=NULL;
108  m_GapAlign=NULL;
109  }
110 
112  m_LookupSegments = BlastSeqLocFree(m_LookupSegments);
113  m_BlastMessage = Blast_MessageFree(m_BlastMessage);
114  m_ScoreBlk = BlastScoreBlkFree(m_ScoreBlk);
115  m_ScoreParams = BlastScoringParametersFree(m_ScoreParams);
116  m_HitParams = BlastHitSavingParametersFree(m_HitParams);
117  m_ExtParams = BlastExtensionParametersFree(m_ExtParams);
118  m_EffLenParams = BlastEffectiveLengthsParametersFree(m_EffLenParams);
119  m_GapAlign = BLAST_GapAlignStructFree(m_GapAlign);
120  }
121 
127 
128  BlastHSPWriter* writer = BlastHSPWriterNew(&writer_info, NULL, NULL);
129  BOOST_REQUIRE(writer_info == NULL);
130  return BlastHSPStreamNew(opt.GetProgramType(), opt.GetExtnOpts(),
131  FALSE, 1, writer);
132  }
133 
134  void x_SetupMain(const CBlastOptions &opt,
135  const CBLAST_SequenceBlk &query_blk,
136  const CBlastQueryInfo &query_info) {
138  opt.GetQueryOpts(),
139  opt.GetScoringOpts(),
140  query_blk, query_info, 1.0, &m_LookupSegments, NULL,
141  &m_ScoreBlk, &m_BlastMessage, &BlastFindMatrixPath);
142  }
143 
145  const BlastSeqSrc* seq_src,
146  const CBlastQueryInfo &query_info) {
147  BLAST_GapAlignSetUp(opt.GetProgramType(), seq_src,
148  opt.GetScoringOpts(),
149  opt.GetEffLenOpts(),
150  opt.GetExtnOpts(),
151  opt.GetHitSaveOpts(),
152  query_info, m_ScoreBlk, &m_ScoreParams,
153  &m_ExtParams, &m_HitParams, &m_EffLenParams,
154  &m_GapAlign);
155  }
156 
158  BlastHSPStream *hsp_stream,
159  const CBLAST_SequenceBlk &query_blk,
160  const CBlastQueryInfo &query_info,
161  const BlastSeqSrc* seq_src,
162  BlastHSPResults** results) {
164  hsp_stream, query_blk, query_info, seq_src,
165  m_GapAlign, m_ScoreParams, m_ExtParams, m_HitParams, m_EffLenParams,
166  opt.GetDbOpts(), NULL, NULL, NULL, results, 0, 0);
167  }
168 
169 };
170 
171 BOOST_FIXTURE_TEST_SUITE(traceback, CTracebackTestFixture)
172 
173 
174 /* Perform an RMBlast style traceback with complexity adjustment and score cutoff
175  * -RMH- */
176 BOOST_AUTO_TEST_CASE(testRMBlastTraceBack) {
177  const int k_num_hsps_start = 7;
178  const int k_num_hsps_end = 6;
179 
180  // Look for the custom matrix 20p43g.matrix in the unit test data directory
181  CAutoEnvironmentVariable a("BLASTMAT", "data");
182 
183  CSeq_id qid("gi|1945388");
184  unique_ptr<SSeqLoc> qsl(
185  CTestObjMgr::Instance().CreateSSeqLoc(qid, eNa_strand_both));
186  CSeq_id sid("gi|1732684");
187  unique_ptr<SSeqLoc> ssl(
188  CTestObjMgr::Instance().CreateSSeqLoc(sid, eNa_strand_both));
189 
191  opts->SetTraditionalMegablastDefaults();
192  opts->SetGappedMode(true);
193  opts->SetMatchReward(0);
194  opts->SetMismatchPenalty(0);
195  // NOTE: Unfortunately for the time being the
196  // blast_state::Blast_KarlinBlkNuclGappedCalc()
197  // function limits our use gap (open/ext) scores to values
198  // greater or equal to 2. Use of lower values
199  // causes RMBlast to abort.
200  opts->SetGapOpeningCost(12);
201  opts->SetGapExtensionCost(2);
202  opts->SetWordSize(11);
203  opts->SetCutoffScore(500);
204  opts->SetGapTracebackAlgorithm(eDynProgTbck);
205  opts->SetMatrixName("20p43g.matrix");
206  opts->SetComplexityAdjMode( true );
207 
208  CBl2Seq blaster(*qsl, *ssl, *opts);
209 
210  CBlastQueryInfo query_info;
211  CBLAST_SequenceBlk query_blk;
212  TSearchMessages blast_msg;
213 
214  const CBlastOptions& kOpts = blaster.GetOptionsHandle().GetOptions();
216  ENa_strand strand_opt = kOpts.GetStrandOption();
217 
218  SetupQueryInfo(const_cast<TSeqLocVector&>(blaster.GetQueries()),
219  prog, strand_opt, &query_info);
220  SetupQueries(const_cast<TSeqLocVector&>(blaster.GetQueries()),
221  query_info, &query_blk, prog, strand_opt, blast_msg);
222  ITERATE(TSearchMessages, m, blast_msg) {
223  BOOST_REQUIRE(m->empty());
224  }
225 
226  BlastSeqSrc* seq_src =
228  const_cast<TSeqLocVector&>(blaster.GetSubjects()),
231 
232 
233  BlastHSPList* hsp_list =
234  (BlastHSPList*) calloc(1, sizeof(BlastHSPList));
235  hsp_list->oid = 0;
236  hsp_list->hspcnt = k_num_hsps_start;
237  hsp_list->allocated = k_num_hsps_start;
238  hsp_list->hsp_max = k_num_hsps_start;
239  hsp_list->do_not_reallocate = FALSE;
240  hsp_list->hsp_array = (BlastHSP**) malloc(hsp_list->allocated*sizeof(BlastHSP*));
241 
242  BlastHSPStream* hsp_stream = x_MakeStream(blaster.GetOptionsHandle().GetOptions());
243 
244  // gapopen 12 gapextend 2
245  // word_size = 11
246  // matrix = nt/20p43g.matrix
247  // complexity adjust
248  // minscore = 500 ( removes one hsp with a complexity adj score of 414 )
249  const int query_offset[k_num_hsps_start] = { 6378, 5950, 5295, 7191, 7351, 5199, 3818 };
250  const int query_end[k_num_hsps_start] = { 6792, 6161, 5400, 7239, 7431, 5276, 3830 };
251  const int subject_offset[k_num_hsps_start] = { 4, 39, 16, 378, 1, 0, 71};
252  const int subject_end[k_num_hsps_start] = { 419, 241, 123, 428, 86, 66, 83};
253  const int score[k_num_hsps_start] = { 1582, 1391, 902, 341, 332, 286, 118 };
254  const int context[k_num_hsps_start] = { 0, 0, 0, 0, 1, 0, 1 };
255  const int subject_frame[k_num_hsps_start] = { 1, 1, 1, 1, 1, 1, 1 };
256  const int query_gapped_start[k_num_hsps_start] = { 6625, 6035, 5298, 7194, 7411, 5202, 3821 };
257  const int subject_gapped_start[k_num_hsps_start] = { 244, 116, 19, 381, 66, 3, 74 };
258 
259 
260  for (int index=0; index<k_num_hsps_start; index++)
261  {
262  hsp_list->hsp_array[index] = (BlastHSP*) calloc(1, sizeof(BlastHSP));
263  hsp_list->hsp_array[index]->query.offset =query_offset[index];
264  hsp_list->hsp_array[index]->query.end =query_end[index];
265  hsp_list->hsp_array[index]->subject.offset =subject_offset[index];
266  hsp_list->hsp_array[index]->subject.end =subject_end[index];
267  hsp_list->hsp_array[index]->score =score[index];
268  hsp_list->hsp_array[index]->context =context[index];
269  hsp_list->hsp_array[index]->subject.frame =subject_frame[index];
270  hsp_list->hsp_array[index]->query.gapped_start =query_gapped_start[index];
271  hsp_list->hsp_array[index]->subject.gapped_start =subject_gapped_start[index];
272  }
273 
274  // needed after tie-breaking algorithm for scores was changed in
275  // ScoreCompareHSP (blast_hits.c, revision 1.139)
276  Blast_HSPListSortByScore(hsp_list);
277  BlastHSPStreamWrite(hsp_stream, &hsp_list);
278 
279  x_SetupMain(blaster.GetOptionsHandle().GetOptions(), query_blk, query_info);
280 
281  // Set "database" length option to the length of subject sequence,
282  // to avoid having to calculate cutoffs and effective lengths twice.
283  Int4 oid = 0;
284  Uint4 subj_length = BlastSeqSrcGetSeqLen(seq_src, (void*)&oid);
285  blaster.SetOptionsHandle().SetDbLength(subj_length);
286 
287  x_SetupGapAlign(blaster.GetOptionsHandle().GetOptions(), seq_src, query_info);
288 
289  BlastHSPResults* results = NULL;
290 
291  x_ComputeTracebak(blaster.GetOptionsHandle().GetOptions(),
292  hsp_stream, query_blk, query_info, seq_src, &results);
293 
294  BlastHSPStreamFree(hsp_stream);
295 
296  const int query_offset_final[k_num_hsps_end] = { 6374, 5916, 5263, 6778, 5199, 3740 };
297  const int query_end_final[k_num_hsps_end] = { 6785, 6345, 5756, 7241, 5522, 4113 };
298  const int subject_offset_final[k_num_hsps_end] = { 1, 0, 1, 0, 0, 0 };
299  const int subject_end_final[k_num_hsps_end] = { 426, 419, 426, 430, 426, 425 };
300  const int score_final[k_num_hsps_end] = { 1560, 1532, 1183, 815, 637, 590 };
301  const int context_final[k_num_hsps_end] = { 0, 0, 0, 0, 0, 1 };
302  const int subject_frame_final[k_num_hsps_end] = { 1, 1, 1, 1, 1, 1};
303  const int query_gapped_start_final[k_num_hsps_end] = { 6625, 6035, 5298, 7194, 5202, 3821 };
304  const int subject_gapped_start_final[k_num_hsps_end] = { 244, 116, 19, 381, 3, 74 };
305  const int num_ident_final[k_num_hsps_end] = { 314, 304, 300, 273, 238, 247 };
306 
307  // One hsp is dropped when the function runs.
308  BlastHitList* hit_list = results->hitlist_array[0];
309  hsp_list = hit_list->hsplist_array[0];
310 
311  BOOST_REQUIRE(hsp_list != NULL);
312  BOOST_REQUIRE_EQUAL(k_num_hsps_end, hsp_list->hspcnt);
313  for (int index=0; index<k_num_hsps_end; index++)
314  {
315  BlastHSP* tmp_hsp = hsp_list->hsp_array[index];
316  BOOST_REQUIRE_EQUAL(query_offset_final[index], tmp_hsp->query.offset);
317  BOOST_REQUIRE_EQUAL(query_end_final[index], tmp_hsp->query.end);
318  BOOST_REQUIRE_EQUAL(subject_offset_final[index], tmp_hsp->subject.offset);
319  BOOST_REQUIRE_EQUAL(subject_end_final[index], tmp_hsp->subject.end);
320  BOOST_REQUIRE_EQUAL(score_final[index], tmp_hsp->score);
321  BOOST_REQUIRE_EQUAL(context_final[index], (int) tmp_hsp->context);
322  BOOST_REQUIRE_EQUAL(subject_frame_final[index], (int) tmp_hsp->subject.frame);
323  BOOST_REQUIRE_EQUAL(query_gapped_start_final[index], tmp_hsp->query.gapped_start);
324  BOOST_REQUIRE_EQUAL(subject_gapped_start_final[index], tmp_hsp->subject.gapped_start);
325  BOOST_REQUIRE_EQUAL(num_ident_final[index], tmp_hsp->num_ident);
326  }
327 
328  results = Blast_HSPResultsFree(results);
329  BOOST_REQUIRE(results == NULL);
330  seq_src = BlastSeqSrcFree(seq_src);
331  BOOST_REQUIRE(seq_src == NULL);
332 }
333 
335 
336 /*
337 * ===========================================================================
338 *
339 * $Log:$
340 *
341 * ===========================================================================
342 */
Declares the CBl2Seq (BLAST 2 Sequences) class.
BlastSeqLoc * BlastSeqLocFree(BlastSeqLoc *loc)
Deallocate all BlastSeqLoc objects in a chain.
Definition: blast_filter.c:737
Structures and functions prototypes used for BLAST gapped extension.
BlastGapAlignStruct * BLAST_GapAlignStructFree(BlastGapAlignStruct *gap_align)
Deallocates memory in the BlastGapAlignStruct structure.
BlastHSPResults * Blast_HSPResultsFree(BlastHSPResults *results)
Deallocate memory for BLAST results.
Definition: blast_hits.c:3358
void Blast_HSPListSortByScore(BlastHSPList *hsp_list)
Sort the HSPs in an HSP list by score.
Definition: blast_hits.c:1374
BlastHSPWriter * BlastHSPWriterNew(BlastHSPWriterInfo **writer_info, BlastQueryInfo *query_info, BLAST_SequenceBlk *query)
A generic function to create writer.
Declaration of ADT to save and retrieve lists of HSPs in the BLAST engine.
int BlastHSPStreamWrite(BlastHSPStream *hsp_stream, BlastHSPList **hsp_list)
Invokes the user-specified write function for this BlastHSPStream implementation.
BlastHSPStream * BlastHSPStreamFree(BlastHSPStream *hsp_stream)
Frees the BlastHSPStream structure by invoking the destructor function set by the user-defined constr...
BlastHSPStream * BlastHSPStreamNew(EBlastProgramType program, const BlastExtensionOptions *extn_opts, Boolean sort_on_read, Int4 num_queries, BlastHSPWriter *writer)
Initialize the HSP stream.
Common definitions for protein and nucleotide lookup tables.
Blast_Message * Blast_MessageFree(Blast_Message *blast_msg)
Deallocates message memory.
Definition: blast_message.c:80
Declares the CBlastNucleotideOptionsHandle class.
Definitions which are dependant on the NCBI C++ Object Manager.
@ eDynProgTbck
standard affine gapping
Declares the CBlastOptionsHandle and CBlastOptionsFactory classes.
BlastHitSavingParameters * BlastHitSavingParametersFree(BlastHitSavingParameters *parameters)
Deallocate memory for BlastHitSavingOptions*.
BlastEffectiveLengthsParameters * BlastEffectiveLengthsParametersFree(BlastEffectiveLengthsParameters *parameters)
Deallocate memory for BlastEffectiveLengthsParameters*.
BlastExtensionParameters * BlastExtensionParametersFree(BlastExtensionParameters *parameters)
Deallocate memory for BlastExtensionParameters.
BlastScoringParameters * BlastScoringParametersFree(BlastScoringParameters *parameters)
Deallocate memory for BlastScoringParameters.
EBlastProgramType
Defines the engine's notion of the different applications of the BLAST algorithm.
Definition: blast_program.h:72
Declares the CBlastProteinOptionsHandle class.
Defines interface for retrieving sequence identifiers.
Int4 BlastSeqSrcGetSeqLen(const BlastSeqSrc *seq_src, void *oid)
Retrieve sequence length (number of residues/bases)
Definition: blast_seqsrc.c:281
BlastSeqSrc * BlastSeqSrcFree(BlastSeqSrc *seq_src)
Frees the BlastSeqSrc structure by invoking the destructor function set by the user-defined construct...
Definition: blast_seqsrc.c:112
Utilities initialize/setup BLAST.
Int2 BLAST_MainSetUp(EBlastProgramType program_number, const QuerySetUpOptions *qsup_options, const BlastScoringOptions *scoring_options, BLAST_SequenceBlk *query_blk, const BlastQueryInfo *query_info, double scale_factor, BlastSeqLoc **lookup_segments, BlastMaskLoc **mask, BlastScoreBlk **sbpp, Blast_Message **blast_message, GET_MATRIX_PATH get_path)
"Main" setup routine for BLAST.
Definition: blast_setup.c:563
Int2 BLAST_GapAlignSetUp(EBlastProgramType program_number, const BlastSeqSrc *seq_src, const BlastScoringOptions *scoring_options, const BlastEffectiveLengthsOptions *eff_len_options, const BlastExtensionOptions *ext_options, const BlastHitSavingOptions *hit_options, BlastQueryInfo *query_info, BlastScoreBlk *sbp, BlastScoringParameters **score_params, BlastExtensionParameters **ext_params, BlastHitSavingParameters **hit_params, BlastEffectiveLengthsParameters **eff_len_params, BlastGapAlignStruct **gap_align)
Set up the auxiliary structures for gapped alignment / traceback only.
Definition: blast_setup.c:888
BlastScoreBlk * BlastScoreBlkFree(BlastScoreBlk *sbp)
Deallocates BlastScoreBlk as well as all associated structures.
Definition: blast_stat.c:965
Functions to do gapped alignment with traceback.
Int2 BLAST_ComputeTraceback(EBlastProgramType program_number, BlastHSPStream *hsp_stream, BLAST_SequenceBlk *query, BlastQueryInfo *query_info, const BlastSeqSrc *seq_src, BlastGapAlignStruct *gap_align, BlastScoringParameters *score_params, const BlastExtensionParameters *ext_params, BlastHitSavingParameters *hit_params, BlastEffectiveLengthsParameters *eff_len_params, const BlastDatabaseOptions *db_options, const PSIBlastOptions *psi_options, const BlastRPSInfo *rps_info, SPHIPatternSearchBlk *pattern_blk, BlastHSPResults **results, TInterruptFnPtr interrupt_search, SBlastProgress *progress_info)
Given the preliminary alignment results from a database search, redo the gapped alignment with traceb...
Definitions of special type used in BLAST.
BOOST_AUTO_TEST_SUITE_END() static int s_GetSegmentFlags(const CBioseq &bioseq)
Declares the CBlastxOptionsHandle class.
CAutoEnvironmentVariable –.
Definition: ncbienv.hpp:179
Wrapper class for BLAST_SequenceBlk .
Definition: blast_aux.hpp:309
Runs the BLAST algorithm between 2 sequences.
Definition: bl2seq.hpp:58
Handle to the nucleotide-nucleotide options to the BLAST algorithm.
Encapsulates ALL the BLAST algorithm's options.
Wrapper class for BlastQueryInfo .
Definition: blast_aux.hpp:311
CRef –.
Definition: ncbiobj.hpp:618
static CTestObjMgr & Instance()
Definition: test_objmgr.cpp:69
BlastHitSavingParameters * m_HitParams
static BlastHSPStream * x_MakeStream(const CBlastOptions &opt)
BlastExtensionParameters * m_ExtParams
BlastScoringParameters * m_ScoreParams
void x_SetupMain(const CBlastOptions &opt, const CBLAST_SequenceBlk &query_blk, const CBlastQueryInfo &query_info)
void x_SetupGapAlign(const CBlastOptions &opt, const BlastSeqSrc *seq_src, const CBlastQueryInfo &query_info)
void x_ComputeTracebak(const CBlastOptions &opt, BlastHSPStream *hsp_stream, const CBLAST_SequenceBlk &query_blk, const CBlastQueryInfo &query_info, const BlastSeqSrc *seq_src, BlastHSPResults **results)
BlastEffectiveLengthsParameters * m_EffLenParams
typedef for the messages for an entire BLAST search, which could be comprised of multiple query seque...
Declares the CDiscNucleotideOptionsHandle class.
BlastHitSavingOptions * GetHitSaveOpts() const
Returns BlastHitSavingOptions for eLocal objects, NULL for eRemote.
const CBlastOptionsHandle & GetOptionsHandle() const
Retrieve the options handle.
Definition: bl2seq.hpp:285
void SetDbLength(Int8 len)
Sets DbLength.
BlastExtensionOptions * GetExtnOpts() const
Returns BlastExtensionOptions for eLocal objects, NULL for eRemote.
void SetupQueries(TSeqLocVector &queries, BlastQueryInfo *qinfo, BLAST_SequenceBlk **seqblk, EBlastProgramType prog, objects::ENa_strand strand_opt, TSearchMessages &messages)
Populates BLAST_SequenceBlk with sequence data for use in CORE BLAST.
objects::ENa_strand GetStrandOption() const
BlastSeqSrc * MultiSeqBlastSeqSrcInit(TSeqLocVector &seq_vector, EBlastProgramType program, bool dbscan_mode=false)
Initialize the sequence source structure.
BlastEffectiveLengthsOptions * GetEffLenOpts() const
Returns BlastEffectiveLengthsOptions for eLocal objects, NULL for eRemote.
EBlastProgramType GetProgramType() const
Returns the CORE BLAST notion of program type.
const CBlastOptions & GetOptions() const
Return the object which this object is a handle for.
BlastScoringOptions * GetScoringOpts() const
Returns BlastScoringOptions for eLocal objects, NULL for eRemote.
char * BlastFindMatrixPath(const char *matrix_name, Boolean is_prot)
Returns the path to a specified matrix.
QuerySetUpOptions * GetQueryOpts() const
Returns QuerySetUpOptions for eLocal objects, NULL for eRemote.
const TSeqLocVector & GetQueries() const
Retrieve a vector of query sequences.
Definition: bl2seq.hpp:244
CBlastOptionsHandle & SetOptionsHandle()
Set the options handle.
Definition: bl2seq.hpp:278
void SetupQueryInfo(TSeqLocVector &queries, EBlastProgramType prog, objects::ENa_strand strand_opt, BlastQueryInfo **qinfo)
Allocates the query information structure and fills the context offsets, in case of multiple queries,...
BlastDatabaseOptions * GetDbOpts() const
Returns BlastDatabaseOptions for eLocal objects, NULL for eRemote.
const TSeqLocVector & GetSubjects() const
Retrieve a vector of subject sequences.
Definition: bl2seq.hpp:272
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NULL
Definition: ncbistd.hpp:225
int32_t Int4
4-byte (32-bit) signed integer
Definition: ncbitype.h:102
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
@ eNa_strand_both
in forward orientation
Definition: Na_strand_.hpp:68
Implementation of a number of BlastHSPWriters to save hits from a BLAST search, and subsequently retu...
BlastHSPCollectorParams * BlastHSPCollectorParamsNew(const BlastHitSavingOptions *hit_options, Int4 compositionBasedStats, Boolean gapped_calculation)
Sets up parameter set for use by collector.
BlastHSPWriterInfo * BlastHSPCollectorInfoNew(BlastHSPCollectorParams *params)
WriterInfo to create a default writer: the collecter.
Utility functions for lookup table generation.
static char * prog
Definition: mdb_load.c:33
void CheckForBlastSeqSrcErrors(const BlastSeqSrc *seqsrc)
Magic spell ;-) needed for some weird compilers... very empiric.
unsigned int a
Definition: ncbi_localip.c:102
#define FALSE
bool replacment for C indicating false.
Definition: ncbi_std.h:101
Defines: CTimeFormat - storage class for time format.
The Object manager core.
NOTE: This file contains work in progress and the APIs are likely to change, please do not rely on th...
Utilities to develop and debug unit tests for BLAST.
NOTE: This file contains work in progress and the APIs are likely to change, please do not rely on th...
BOOST_AUTO_TEST_CASE(testRMBlastTraceBack)
Defines a concrete strategy for the IBlastSeqInfoSrc interface for sequence identifiers retrieval fro...
Implementation of the BlastSeqSrc interface for a vector of sequence locations.
Implementation of the BlastSeqSrc interface using the C++ BLAST databases API.
NOTE: This file contains work in progress and the APIs are likely to change, please do not rely on th...
vector< SSeqLoc > TSeqLocVector
Vector of sequence locations.
Definition: sseqloc.hpp:129
Parameters for setting up effective lengths and search spaces.
Int4 compositionBasedStats
mode of compositional adjustment to use; if zero then compositional adjustment is not used
Computed values used as parameters for gapped alignments.
Structure supporting the gapped alignment.
The structure to hold all HSPs for a given sequence after the gapped alignment.
Definition: blast_hits.h:153
Boolean do_not_reallocate
Is reallocation of the hsp_array allowed?
Definition: blast_hits.h:161
Int4 oid
The ordinal id of the subject sequence this HSP list is for.
Definition: blast_hits.h:154
Int4 hspcnt
Number of HSPs saved.
Definition: blast_hits.h:158
BlastHSP ** hsp_array
Array of pointers to individual HSPs.
Definition: blast_hits.h:157
Int4 hsp_max
The maximal number of HSPs allowed to be saved.
Definition: blast_hits.h:160
Int4 allocated
The allocated size of the hsp_array.
Definition: blast_hits.h:159
The structure to contain all BLAST results, for multiple queries.
Definition: blast_hits.h:183
BlastHitList ** hitlist_array
Array of results for individual query sequences.
Definition: blast_hits.h:185
Default implementation of BlastHSPStream.
A wrap of data structure used to create a writer.
ADT definition of BlastHSPWriter.
Structure holding all information about an HSP.
Definition: blast_hits.h:126
Int4 num_ident
Number of identical base pairs in this HSP.
Definition: blast_hits.h:128
BlastSeg query
Query sequence info.
Definition: blast_hits.h:131
Int4 context
Context number of query.
Definition: blast_hits.h:133
BlastSeg subject
Subject sequence info.
Definition: blast_hits.h:132
Int4 score
This HSP's raw score.
Definition: blast_hits.h:127
The structure to contain all BLAST results for one query sequence.
Definition: blast_hits.h:169
BlastHSPList ** hsplist_array
Array of HSP lists for individual database hits.
Definition: blast_hits.h:176
Parameter block that contains a pointer to BlastHitSavingOptions and the values derived from it.
Structure used for scoring calculations.
Definition: blast_stat.h:177
Boolean gapped_calculation
gap-free search if FALSE
Scoring parameters block Contains scoring-related information that is actually used for the blast sea...
Int4 end
End of hsp.
Definition: blast_hits.h:99
Int4 gapped_start
Where the gapped extension started.
Definition: blast_hits.h:100
Int2 frame
Translation frame.
Definition: blast_hits.h:97
Int4 offset
Start of hsp.
Definition: blast_hits.h:98
Used to hold a set of positions, mostly used for filtering.
Definition: blast_def.h:204
Complete type definition of Blast Sequence Source ADT.
Definition: blast_seqsrc.c:43
Structure to hold the a message from the core of the BLAST engine.
Definition: blast_message.h:70
Declares the CTBlastnOptionsHandle class.
Utility stuff for more convenient using of Boost.Test library.
NOTE: This file contains work in progress and the APIs are likely to change, please do not rely on th...
static CS_CONTEXT * context
Definition: will_convert.c:21
voidp malloc(uInt size)
voidp calloc(uInt items, uInt size)
Modified on Wed Apr 17 13:08:35 2024 by modify_doxy.py rev. 669887