NCBI C++ ToolKit
|
Default implementation of the BlastHSPWriter interface to save hits from a BLAST search, and subsequently return them in sorted order. More...
#include <algo/blast/core/hspfilter_collector.h>
#include <algo/blast/core/blast_util.h>
#include "blast_hits_priv.h"
Go to the source code of this file.
Go to the SVN repository for this file.
Classes | |
struct | BlastHSPCollectorData |
Data structure used by the writer. More... | |
Typedefs | |
typedef struct BlastHSPCollectorData | BlastHSPCollectorData |
Data structure used by the writer. More... | |
Functions | |
static int | s_BlastHSPCollectorInit (void *data, void *hsp_results) |
The following are implementations for BlastHSPWriter ADT. More... | |
static int | s_BlastHSPCollectorFinal (void *data, void *results) |
Perform post-run clean-ups. More... | |
static int | s_BlastHSPCollectorRun (void *data, BlastHSPList *hsp_list) |
Perform writing task ownership of the HSP list and sets the dereferenced pointer to NULL. More... | |
static int | s_ScoreCompareHSPWithContext (const void *h1, const void *h2) |
Callback used for sorting HSPs by score, with HSPs from different contexts segregated from each other. More... | |
static int | s_BlastHSPCollectorRun_RPS (void *data, BlastHSPList *hsplist_in) |
Perform writing task for RPS case For RPS BLAST saving procedure is different, because HSPs from different subjects are bundled in one HSP list ownership of the HSP list and sets the dereferenced pointer to NULL. More... | |
static BlastHSPWriter * | s_BlastHSPCollectorFree (BlastHSPWriter *writer) |
Free the writer. More... | |
static BlastHSPWriter * | s_BlastHSPCollectorNew (void *params, BlastQueryInfo *query_info, BLAST_SequenceBlk *sequence) |
create the writer More... | |
BlastHSPCollectorParams * | BlastHSPCollectorParamsNew (const BlastHitSavingOptions *hit_options, Int4 compositionBasedStats, Boolean gapped_calculation) |
The following are exported functions to be used by APP. More... | |
BlastHSPCollectorParams * | BlastHSPCollectorParamsFree (BlastHSPCollectorParams *opts) |
Deallocates the BlastHSPCollectorParams structure passed in. More... | |
BlastHSPWriterInfo * | BlastHSPCollectorInfoNew (BlastHSPCollectorParams *params) |
WriterInfo to create a default writer: the collecter. More... | |
Default implementation of the BlastHSPWriter interface to save hits from a BLAST search, and subsequently return them in sorted order.
Definition in file hspfilter_collector.c.
typedef struct BlastHSPCollectorData BlastHSPCollectorData |
Data structure used by the writer.
BlastHSPWriterInfo* BlastHSPCollectorInfoNew | ( | BlastHSPCollectorParams * | params | ) |
WriterInfo to create a default writer: the collecter.
params | The collector parameters. |
Definition at line 353 of file hspfilter_collector.c.
References malloc(), BlastHSPWriterInfo::NewFnPtr, BlastHSPWriterInfo::params, and s_BlastHSPCollectorNew().
Referenced by BOOST_AUTO_TEST_CASE(), CSetupFactory::CreateHspWriter(), CRedoAlignmentTestFixture::runRedoAlignmentCoreUnitTest(), testHSPStream(), CTracebackSearchTestFixture::x_GetSampleHspStream(), CTracebackSearchTestFixture::x_GetSelfHitHspStream(), and CTracebackTestFixture::x_MakeStream().
BlastHSPCollectorParams* BlastHSPCollectorParamsFree | ( | BlastHSPCollectorParams * | opts | ) |
Deallocates the BlastHSPCollectorParams structure passed in.
opts | structure to deallocate [in] |
Definition at line 344 of file hspfilter_collector.c.
Referenced by BlastHSPCullingParamsNew().
BlastHSPCollectorParams* BlastHSPCollectorParamsNew | ( | const BlastHitSavingOptions * | hit_options, |
Int4 | compositionBasedStats, | ||
Boolean | gapped_calculation | ||
) |
The following are exported functions to be used by APP.
Sets up parameter set for use by collector.
Definition at line 325 of file hspfilter_collector.c.
References BlastHspNumMax(), GetPrelimHitlistSize(), BlastHitSavingOptions::hitlist_size, BlastHSPCollectorParams::hsp_num_max, malloc(), NULL, BlastHSPCollectorParams::prelim_hitlist_size, BlastHSPCollectorParams::program, and BlastHitSavingOptions::program_number.
Referenced by BlastHSPCullingParamsNew(), BOOST_AUTO_TEST_CASE(), CSetupFactory::CreateHspWriter(), CRedoAlignmentTestFixture::runRedoAlignmentCoreUnitTest(), testHSPStream(), CTracebackSearchTestFixture::x_GetSampleHspStream(), CTracebackSearchTestFixture::x_GetSelfHitHspStream(), and CTracebackTestFixture::x_MakeStream().
Perform post-run clean-ups.
data | The buffered data structure [in] |
results | The HSP results to propagate [in][out] |
Definition at line 68 of file hspfilter_collector.c.
References data, NULL, and BlastHSPCollectorData::results.
Referenced by s_BlastHSPCollectorNew().
|
static |
Free the writer.
writer | The writer to free [in] |
Definition at line 279 of file hspfilter_collector.c.
References BlastHSPWriter::data, data, NULL, and sfree.
Referenced by s_BlastHSPCollectorNew().
The following are implementations for BlastHSPWriter ADT.
Perform pre-run stage-specific initialization
data | The internal data structure [in][out] |
results | The HSP results to operate on [in] |
Definition at line 54 of file hspfilter_collector.c.
References data, BlastHSPCollectorData::results, and results.
Referenced by s_BlastHSPCollectorNew().
|
static |
create the writer
params | Pointer to the hit paramters [in] |
query_info | BlastQueryInfo (not used) [in] |
Definition at line 295 of file hspfilter_collector.c.
References Blast_ProgramIsRpsBlast(), BlastHSPWriter::data, data, BlastHSPWriter::FinalFnPtr, BlastHSPWriter::FreeFnPtr, BlastHSPWriter::InitFnPtr, malloc(), NULL, BlastHSPCollectorParams::program, BlastHSPWriter::RunFnPtr, s_BlastHSPCollectorFinal(), s_BlastHSPCollectorFree(), s_BlastHSPCollectorInit(), s_BlastHSPCollectorRun(), and s_BlastHSPCollectorRun_RPS().
Referenced by BlastHSPCollectorInfoNew().
|
static |
Perform writing task ownership of the HSP list and sets the dereferenced pointer to NULL.
data | To store results to [in][out] |
hsp_list | Pointer to the HSP list to save in the collector. [in] |
Definition at line 82 of file hspfilter_collector.c.
References Blast_GetQueryIndexFromContext(), Blast_HitListNew(), Blast_HitListUpdate(), Blast_HSPListFree(), Blast_HSPListIsSortedByScore(), Blast_HSPListNew(), Blast_HSPListSaveHSP(), calloc(), BlastHSP::context, data, ErrPostEx, BlastHSPList::hsp_array, BlastHSPCollectorParams::hsp_num_max, BlastHSPList::hspcnt, NULL, BlastHSPList::oid, BlastHSPCollectorData::params, BlastHSPCollectorParams::prelim_hitlist_size, BlastHSPCollectorParams::program, BlastHSPCollectorData::results, results, SEV_WARNING, and sfree.
Referenced by s_BlastHSPCollectorNew().
|
static |
Perform writing task for RPS case For RPS BLAST saving procedure is different, because HSPs from different subjects are bundled in one HSP list ownership of the HSP list and sets the dereferenced pointer to NULL.
data | To store results to [in][out] |
hsp_list | Pointer to the HSP list to save in the collector. [in] |
Definition at line 204 of file hspfilter_collector.c.
References ASSERT, Blast_HitListNew(), Blast_HitListUpdate(), Blast_HSPListFree(), Blast_HSPListIsSortedByScore(), Blast_HSPListNew(), Blast_HSPListSaveHSP(), Blast_ProgramIsRpsBlast(), BlastHSP::context, data, BlastHSPList::hsp_array, BlastHSPList::hspcnt, BlastHSPList::oid, BlastHSPCollectorData::params, BlastHSPCollectorParams::prelim_hitlist_size, BlastHSPCollectorParams::program, BlastHSPList::query_index, BlastHSPCollectorData::results, results, and s_ScoreCompareHSPWithContext().
Referenced by s_BlastHSPCollectorNew().
Callback used for sorting HSPs by score, with HSPs from different contexts segregated from each other.
Definition at line 174 of file hspfilter_collector.c.
References BLAST_CMP, BlastHSP::context, result, and ScoreCompareHSPs().
Referenced by s_BlastHSPCollectorRun_RPS().