NCBI C++ ToolKit
Classes | Typedefs | Functions
hspfilter_collector.c File Reference

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"
+ Include dependency graph for hspfilter_collector.c:

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 BlastHSPWriters_BlastHSPCollectorFree (BlastHSPWriter *writer)
 Free the writer. More...
 
static BlastHSPWriters_BlastHSPCollectorNew (void *params, BlastQueryInfo *query_info, BLAST_SequenceBlk *sequence)
 create the writer More...
 
BlastHSPCollectorParamsBlastHSPCollectorParamsNew (const BlastHitSavingOptions *hit_options, Int4 compositionBasedStats, Boolean gapped_calculation)
 The following are exported functions to be used by APP. More...
 
BlastHSPCollectorParamsBlastHSPCollectorParamsFree (BlastHSPCollectorParams *opts)
 Deallocates the BlastHSPCollectorParams structure passed in. More...
 
BlastHSPWriterInfoBlastHSPCollectorInfoNew (BlastHSPCollectorParams *params)
 WriterInfo to create a default writer: the collecter. More...
 

Detailed Description

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 Documentation

◆ BlastHSPCollectorData

Data structure used by the writer.

Function Documentation

◆ BlastHSPCollectorInfoNew()

BlastHSPWriterInfo* BlastHSPCollectorInfoNew ( BlastHSPCollectorParams params)

◆ BlastHSPCollectorParamsFree()

BlastHSPCollectorParams* BlastHSPCollectorParamsFree ( BlastHSPCollectorParams opts)

Deallocates the BlastHSPCollectorParams structure passed in.

Parameters
optsstructure to deallocate [in]
Returns
NULL

Definition at line 344 of file hspfilter_collector.c.

References NULL, and sfree.

Referenced by BlastHSPCullingParamsNew().

◆ BlastHSPCollectorParamsNew()

BlastHSPCollectorParams* BlastHSPCollectorParamsNew ( const BlastHitSavingOptions hit_options,
Int4  compositionBasedStats,
Boolean  gapped_calculation 
)

◆ s_BlastHSPCollectorFinal()

static int s_BlastHSPCollectorFinal ( void *  data,
void *  results 
)
static

Perform post-run clean-ups.

Parameters
dataThe buffered data structure [in]
resultsThe 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().

◆ s_BlastHSPCollectorFree()

static BlastHSPWriter* s_BlastHSPCollectorFree ( BlastHSPWriter writer)
static

Free the writer.

Parameters
writerThe writer to free [in]
Returns
NULL.

Definition at line 279 of file hspfilter_collector.c.

References BlastHSPWriter::data, data, NULL, and sfree.

Referenced by s_BlastHSPCollectorNew().

◆ s_BlastHSPCollectorInit()

static int s_BlastHSPCollectorInit ( void *  data,
void *  hsp_results 
)
static

The following are implementations for BlastHSPWriter ADT.

Perform pre-run stage-specific initialization

Parameters
dataThe internal data structure [in][out]
resultsThe 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().

◆ s_BlastHSPCollectorNew()

static BlastHSPWriter* s_BlastHSPCollectorNew ( void *  params,
BlastQueryInfo query_info,
BLAST_SequenceBlk sequence 
)
static

◆ s_BlastHSPCollectorRun()

static int s_BlastHSPCollectorRun ( void *  data,
BlastHSPList hsp_list 
)
static

◆ s_BlastHSPCollectorRun_RPS()

static int s_BlastHSPCollectorRun_RPS ( void *  data,
BlastHSPList hsplist_in 
)
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.

Parameters
dataTo store results to [in][out]
hsp_listPointer 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().

◆ s_ScoreCompareHSPWithContext()

static int s_ScoreCompareHSPWithContext ( const void *  h1,
const void *  h2 
)
static

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().

Modified on Fri Sep 20 14:57:37 2024 by modify_doxy.py rev. 669887