NCBI C++ ToolKit
Classes | Macros | Typedefs | Functions
hspfilter_besthit.h File Reference

Implementation of a number of BlastHSPWriters to save hits from a BLAST search, and subsequently return them in sorted order. More...

#include <algo/blast/core/ncbi_std.h>
#include <algo/blast/core/blast_program.h>
#include <algo/blast/core/blast_options.h>
#include <algo/blast/core/blast_hspfilter.h>
#include <algo/blast/core/blast_hits.h>
#include <connect/ncbi_core.h>
+ Include dependency graph for hspfilter_besthit.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  BlastHSPBestHitParams
 Keeps parameters used in best hit algorithm. More...
 

Macros

#define kBestHit_OverhangDflt   0.1
 The "best hit" writer. More...
 
#define kBestHit_OverhangMin   0.0
 Minimum value for overhang. More...
 
#define kBestHit_OverhangMax   0.5
 Maximum value for overhang. More...
 
#define kBestHit_ScoreEdgeDflt   0.1
 Default value for score_edge. More...
 
#define kBestHit_ScoreEdgeMin   0.0
 Minimum value for score_edge. More...
 
#define kBestHit_ScoreEdgeMax   0.5
 Maximum value for score_edge. More...
 

Typedefs

typedef struct BlastHSPBestHitParams BlastHSPBestHitParams
 Keeps parameters used in best hit algorithm. More...
 

Functions

BlastHSPBestHitParamsBlastHSPBestHitParamsNew (const BlastHitSavingOptions *hit_options, const BlastHSPBestHitOptions *best_hit_opts, Int4 compositionBasedStats, Boolean gapped_calculation)
 create a set of parameters More...
 
BlastHSPBestHitParamsBlastHSPBestHitParamsFree (BlastHSPBestHitParams *opts)
 Deallocates the BlastHSPBestHitParams structure passed in. More...
 
BlastHSPWriterInfoBlastHSPBestHitInfoNew (BlastHSPBestHitParams *params)
 WriterInfo and PipeInfo to create a best hit writer/pipe. More...
 
BlastHSPPipeInfoBlastHSPBestHitPipeInfoNew (BlastHSPBestHitParams *params)
 

Detailed Description

Implementation of a number of BlastHSPWriters to save hits from a BLAST search, and subsequently return them in sorted order.

Definition in file hspfilter_besthit.h.

Macro Definition Documentation

◆ kBestHit_OverhangDflt

#define kBestHit_OverhangDflt   0.1

The "best hit" writer.

Prune the hsp_list for each query and keeps only the best ones. 1. For a pair of hits A and B, check based on 10% overhangs whether A can be dropped because of B due to end points of A being within 10% extension of B and vice versa. Note that this would allow A to be dropped even if it is at most 20% longer than B.

2. If A can be dropped because of B, check if Evalue(A) >= Evalue(B); that is A has the same or worse evalue than B. Do the same check for whether B can be dropped because of A.

3. If A can still be dropped because of B, check if density(A) <= density(B). Do the same check for whether B can be dropped because of A.

4. If only one can be dropped, then drop that one. If both are mutually replaceable, use length criteria and drop the shorter one only if it is at least 10% shorter (90% coverage).

So, essentially length coverage is being used a tie-breaker and if the tie-breaker does not break the tie, both alignments are kept. Above is not very different than what you have now, just rearranged in conditions so that we do not have non-deterministic behavior between a pair of alignments. We could still have issues with cascades where A was dropped because of B and then B gets dropped because of C, but A would not have been dropped because of C becuase of condition 4. However, I think this will be extremely rare. Default value for overhang

Definition at line 80 of file hspfilter_besthit.h.

◆ kBestHit_OverhangMax

#define kBestHit_OverhangMax   0.5

Maximum value for overhang.

Definition at line 84 of file hspfilter_besthit.h.

◆ kBestHit_OverhangMin

#define kBestHit_OverhangMin   0.0

Minimum value for overhang.

Definition at line 82 of file hspfilter_besthit.h.

◆ kBestHit_ScoreEdgeDflt

#define kBestHit_ScoreEdgeDflt   0.1

Default value for score_edge.

Definition at line 87 of file hspfilter_besthit.h.

◆ kBestHit_ScoreEdgeMax

#define kBestHit_ScoreEdgeMax   0.5

Maximum value for score_edge.

Definition at line 91 of file hspfilter_besthit.h.

◆ kBestHit_ScoreEdgeMin

#define kBestHit_ScoreEdgeMin   0.0

Minimum value for score_edge.

Definition at line 89 of file hspfilter_besthit.h.

Typedef Documentation

◆ BlastHSPBestHitParams

Keeps parameters used in best hit algorithm.

Function Documentation

◆ BlastHSPBestHitInfoNew()

BlastHSPWriterInfo* BlastHSPBestHitInfoNew ( BlastHSPBestHitParams params)

WriterInfo and PipeInfo to create a best hit writer/pipe.

Parameters
paramsSpecifies writer parameters. [in]
Returns
the newly allocated writer/pipe info

Definition at line 619 of file hspfilter_besthit.c.

References malloc(), BlastHSPWriterInfo::NewFnPtr, BlastHSPWriterInfo::params, and s_BlastHSPBestHitNew().

Referenced by BOOST_AUTO_TEST_CASE(), and CSetupFactory::CreateHspWriter().

◆ BlastHSPBestHitParamsFree()

BlastHSPBestHitParams* BlastHSPBestHitParamsFree ( BlastHSPBestHitParams opts)

Deallocates the BlastHSPBestHitParams structure passed in.

Parameters
optsstructure to deallocate [in]
Returns
NULL

Definition at line 610 of file hspfilter_besthit.c.

References NULL, and sfree.

Referenced by BOOST_AUTO_TEST_CASE().

◆ BlastHSPBestHitParamsNew()

BlastHSPBestHitParams* BlastHSPBestHitParamsNew ( const BlastHitSavingOptions hit_options,
const BlastHSPBestHitOptions best_hit_opts,
Int4  compositionBasedStats,
Boolean  gapped_calculation 
)

create a set of parameters

Parameters
programBlast program type.[in]
hit_optionsfield hitlist_size and hsp_num_max needed, a pointer to this structure will be stored on resulting structure.[in]
best_hit_optsSpecifies the ratio of overhang to length, which is used to determine if hit A is contained in hit B
compostionBasedStatsthe compsotion based stats needed. [in]
gapped_calculationif gapped_calculation is needed. [in]
Returns
the pointer to the allocated parameter

create a set of parameters

Definition at line 592 of file hspfilter_besthit.c.

References BlastHspNumMax(), GetPrelimHitlistSize(), BlastHitSavingOptions::hitlist_size, BlastHSPBestHitParams::hsp_num_max, malloc(), NULL, BlastHSPBestHitOptions::overhang, BlastHSPBestHitParams::overhang, BlastHSPBestHitParams::prelim_hitlist_size, BlastHSPBestHitParams::program, BlastHitSavingOptions::program_number, BlastHSPBestHitOptions::score_edge, and BlastHSPBestHitParams::score_edge.

Referenced by CSetupFactory::CreateHspPipe(), CSetupFactory::CreateHspWriter(), and s_GetBestHitParams().

◆ BlastHSPBestHitPipeInfoNew()

BlastHSPPipeInfo* BlastHSPBestHitPipeInfoNew ( BlastHSPBestHitParams params)
Modified on Sun Apr 21 03:44:54 2024 by modify_doxy.py rev. 669887