Function calls to actually perform a BLAST search (high level). More...
Go to the source code of this file.
Go to the SVN repository for this file.
static BlastCoreAuxStruct * s_BlastCoreAuxStructFree (BlastCoreAuxStruct *aux_struct) Deallocates all memory in BlastCoreAuxStruct. More...Function calls to actually perform a BLAST search (high level).
The hierarchy of function calls, starting from the top level in the BLAST core, is described below.
Preliminary stage of the BLAST search: Blast_RunPreliminarySearch BLAST_GapAlignSetUp BLAST_PreliminarySearchEngine if (RPS BLAST) { s_RPSPreliminarySearchEngine s_BlastSearchEngineCore } else { for (all sequences in the database) s_BlastSearchEngineCore } Full BLAST search, including preliminary search and traceback: Blast_RunFullSearch BLAST_GapAlignSetUp BLAST_PreliminarySearchEngine BLAST_ComputeTraceback
Definition in file blast_engine.c.
◆ CONV_NUCL2PROT_COORDINATES #define CONV_NUCL2PROT_COORDINATES ( length ) (length) / CODON_LENGTHConverts nucleotide coordinates to protein.
Definition at line 79 of file blast_engine.c.
◆ BlastCoreAuxStructStructure to be passed to s_BlastSearchEngineCore, containing pointers to various preallocated structures and arrays.
◆ SubjectSplitStructStructure used for subject sequence split.
◆ BLAST_PreliminarySearchEngine() Int4 BLAST_PreliminarySearchEngine ( EBlastProgramType program_number, BLAST_SequenceBlk * query, BlastQueryInfo * query_info, const BlastSeqSrc * seq_src, BlastGapAlignStruct * gap_align, BlastScoringParameters * score_params, LookupTableWrap * lookup_wrap, const BlastInitialWordOptions * word_options, BlastExtensionParameters * ext_params, BlastHitSavingParameters * hit_params, BlastEffectiveLengthsParameters * eff_len_params, const PSIBlastOptions * psi_options, const BlastDatabaseOptions * db_options, BlastHSPStream * hsp_stream, BlastDiagnostics * diagnostics, TInterruptFnPtr interrupt_search, SBlastProgress * progress_info )Perform the preliminary stage of the BLAST search.
Definition at line 1335 of file blast_engine.c.
References ASSERT, BLAST_SequenceBlk::bases_offset, Blast_HSPListFree(), Blast_HSPListGetBitScores(), Blast_HSPListGetEvalues(), Blast_HSPListReapByQueryCoverage(), Blast_HSPListReapByRawScore(), Blast_HSPListReevaluateUngapped(), BLAST_LinkHsps(), BLAST_OneSubjectUpdateParameters(), Blast_ProgramIsMapping(), Blast_ProgramIsNucleotide(), Blast_ProgramIsRpsBlast(), BLAST_SEQSRC_EOF, BLAST_SEQSRC_ERROR, Blast_SubjectIsTranslated(), BLASTERR_INTERRUPTED, BLASTERR_SEQSRC, BlastHSPStreamWrite(), BlastInitialWordParametersFree(), BlastInitialWordParametersNew(), BlastLinkHSPParametersUpdate(), BlastSeqSrcGetAvgSeqLen(), BlastSeqSrcGetNumSeqs(), BlastSeqSrcGetSequence(), BlastSeqSrcGetTotLen(), BlastSeqSrcIteratorFree(), BlastSeqSrcIteratorNewEx(), BlastSeqSrcIteratorNext(), BlastSeqSrcReleaseSequence(), BlastSequenceBlkFree(), CalculateLinkHSPCutoffs(), LookupTableWrap::check_index_oid, CODON_LENGTH, BlastDiagnostics::cutoffs, DoAnchoredSearch(), eBlastEncodingProtein, BlastSeqSrcGetSeqArg::encoding, LookupTableWrap::end_search_indication, eNoResults, ePrelimSearch, FALSE, BlastScoringOptions::gapped_calculation, BLAST_SequenceBlk::gen_code_string, GenCodeSingletonFind(), BlastDatabaseOptions::genetic_code, BlastHitList::heapified, BlastHSPResults::hitlist_array, BlastHSPList::hspcnt, if(), LAST_VOL_IDX_INIT, BLAST_SequenceBlk::length, BlastHitSavingParameters::link_hsp_params, BlastHitList::low_score, BlastHitSavingParameters::low_score, BlastHitSavingOptions::low_score_perc, BlastScoreBlk::matrix_only_scoring, MAX, NULL, BlastHSPResults::num_queries, BlastSeqSrcGetSeqArg::oid, BlastExtensionParameters::options, BlastHitSavingParameters::options, BlastScoringParameters::options, query, BlastHSPStream::results, s_AdjustSubjectForSraSearch(), s_AdjustSubjectForTranslatedSraSearch(), s_Blast_HSPListReapByPrelimEvalue(), s_BlastCoreAuxStructFree(), s_BlastSearchEngineCore(), s_BlastSetUpAuxStructures(), s_FillReturnCutoffsInfo(), s_GetMinimumSubjSeqLen(), s_RPSPreliminarySearchEngine(), BlastGapAlignStruct::sbp, BlastSeqSrcGetSeqArg::seq, SBlastProgress::stage, and TRUE.
Referenced by Blast_RunFullSearch(), and Blast_RunPreliminarySearchWithInterrupt().
◆ Blast_RunFullSearch() Int4 Blast_RunFullSearch ( EBlastProgramType program_number, BLAST_SequenceBlk * query, BlastQueryInfo * query_info, const BlastSeqSrc * seq_src, BlastScoreBlk * sbp, const BlastScoringOptions * score_options, LookupTableWrap * lookup_wrap, const BlastInitialWordOptions * word_options, const BlastExtensionOptions * ext_options, const BlastHitSavingOptions * hit_options, const BlastEffectiveLengthsOptions * eff_len_options, const PSIBlastOptions * psi_options, const BlastDatabaseOptions * db_options, BlastHSPStream * hsp_stream, const BlastRPSInfo * rps_info, BlastDiagnostics * diagnostics, BlastHSPResults ** results, TInterruptFnPtr interrupt_search, SBlastProgress * progress_info )The high level function performing the BLAST search against a BLAST database after all the setup has been done.
Definition at line 1727 of file blast_engine.c.
References BLAST_ComputeTraceback(), BLAST_GapAlignSetUp(), BLAST_PreliminarySearchEngine(), Blast_ProgramIsPhiBlast(), BlastHSPStreamClose(), BlastUngappedStats::lookup_hits, LookupTableWrap::lut, NULL, SPHIPatternSearchBlk::num_patterns_db, query, results, s_BlastRunFullSearchCleanUp(), and BlastDiagnostics::ungapped_stat.
◆ Blast_RunPreliminarySearch() Int2 Blast_RunPreliminarySearch ( EBlastProgramType program, BLAST_SequenceBlk * query, BlastQueryInfo * query_info, const BlastSeqSrc * seq_src, const BlastScoringOptions * score_options, BlastScoreBlk * sbp, LookupTableWrap * lookup_wrap, const BlastInitialWordOptions * word_options, const BlastExtensionOptions * ext_options, const BlastHitSavingOptions * hit_options, const BlastEffectiveLengthsOptions * eff_len_options, const PSIBlastOptions * psi_options, const BlastDatabaseOptions * db_options, BlastHSPStream * hsp_stream, BlastDiagnostics * diagnostics )The high level function performing the BLAST search against a BLAST database after all the setup has been done.
Definition at line 1610 of file blast_engine.c.
References Blast_RunPreliminarySearchWithInterrupt(), NULL, and query.
◆ Blast_RunPreliminarySearchWithInterrupt() Int2 Blast_RunPreliminarySearchWithInterrupt ( EBlastProgramType program, BLAST_SequenceBlk * query, BlastQueryInfo * query_info, const BlastSeqSrc * seq_src, const BlastScoringOptions * score_options, BlastScoreBlk * sbp, LookupTableWrap * lookup_wrap, const BlastInitialWordOptions * word_options, const BlastExtensionOptions * ext_options, const BlastHitSavingOptions * hit_options, const BlastEffectiveLengthsOptions * eff_len_options, const PSIBlastOptions * psi_options, const BlastDatabaseOptions * db_options, BlastHSPStream * hsp_stream, BlastDiagnostics * diagnostics, TInterruptFnPtr interrupt_search, SBlastProgress * progress_info )Same as above, with support for user interrupt function.
Definition at line 1633 of file blast_engine.c.
References Blast_DiagnosticsFree(), Blast_DiagnosticsInit(), Blast_DiagnosticsUpdate(), BLAST_GapAlignSetUp(), BLAST_GapAlignStructFree(), BLAST_PreliminarySearchEngine(), BlastEffectiveLengthsParametersFree(), BlastExtensionParametersFree(), BlastHitSavingParametersFree(), BlastScoringParametersFree(), NULL, query, and BlastGapAlignStruct::sbp.
Referenced by Blast_RunPreliminarySearch(), and CPrelimSearchRunner::operator()().
◆ s_AdjustSubjectForSraSearch() ◆ s_AdjustSubjectForTranslatedSraSearch()Definition at line 1209 of file blast_engine.c.
References CODON_LENGTH, BlastSeg::end, FALSE, BlastSeg::frame, BlastSeg::gapped_start, BlastHSPList::hsp_array, BlastHSPList::hspcnt, i, BlastSeg::offset, offset, BlastHSP::query, BlastHSP::subject, and TRUE.
Referenced by BLAST_PreliminarySearchEngine().
◆ s_AllocateSeqRange() ◆ s_BackupSubject()Definition at line 145 of file blast_engine.c.
References SubjectSplitStruct::allocated, ASSERT, eHardSubjMasking, eSoftSubjMasking, SubjectSplitStruct::full_range, SubjectSplitStruct::hard_ranges, SubjectSplitStruct::hm_index, SSeqRange::left, SubjectSplitStruct::next, SubjectSplitStruct::num_hard_ranges, SubjectSplitStruct::num_seq_ranges, SubjectSplitStruct::num_soft_ranges, SubjectSplitStruct::offset, SSeqRange::right, SubjectSplitStruct::seq_ranges, SubjectSplitStruct::sequence, SubjectSplitStruct::sm_index, SubjectSplitStruct::soft_ranges, and subject.
Referenced by s_BlastSearchEngineCore(), and s_BlastSearchEngineOneContext().
◆ s_Blast_HSPListReapByPrelimEvalue() ◆ s_BlastCoreAuxStructFree() ◆ s_BlastRunFullSearchCleanUp() ◆ s_BlastSearchEngineCore() static Int2 s_BlastSearchEngineCore ( EBlastProgramType program_number, BLAST_SequenceBlk * query, BlastQueryInfo * query_info_in, BLAST_SequenceBlk * subject, LookupTableWrap * lookup, BlastGapAlignStruct * gap_align, const BlastScoringParameters * score_params, const BlastInitialWordParameters * word_params, const BlastExtensionParameters * ext_params, const BlastHitSavingParameters * hit_params, const BlastDatabaseOptions * db_options, BlastDiagnostics * diagnostics, BlastCoreAuxStruct * aux_struct, BlastHSPList ** hsp_list_out_ptr, TInterruptFnPtr interrupt_search, SBlastProgress * progress_info ) staticThe core of the BLAST search: comparison between the (concatenated) query against one subject sequence.
Translation of the subject sequence into 6 frames is done inside, if necessary. If subject sequence is too long, it can be split into several chunks.
Definition at line 702 of file blast_engine.c.
References BLAST_ContextToFrame(), BLAST_GetAllTranslations(), Blast_HSPListAppend(), Blast_HSPListFree(), Blast_HSPListGetEvalues(), Blast_HSPListReapByRawScore(), BLAST_LinkHsps(), Blast_ProgramIsNucleotide(), Blast_ProgramIsPhiBlast(), Blast_ProgramIsRpsBlast(), Blast_SubjectIsTranslated(), BLASTERR_INTERRUPTED, BlastHspNumMax(), BlastQueryInfoNew(), context, ContextOffsetsToOffsetArray(), CONV_NUCL2PROT_COORDINATES, eBlastEncodingNcbi2na, eBlastTypeBlastx, eBlastTypeMapping, eBlastTypeRpsBlast, eBlastTypeRpsTblastn, eNoSubjMasking, FALSE, SubjectSplitStruct::full_range, BlastScoringOptions::gapped_calculation, BlastDiagnostics::gapped_stat, BlastScoreBlk::gbp, BlastGappedStats::good_extensions, BlastHSPList::hspcnt, i, BlastScoringOptions::is_ooframe, SSeqRange::left, BlastHitSavingParameters::link_hsp_params, lookup(), BlastScoreBlk::matrix_only_scoring, NULL, BlastRPSLookupTable::num_profiles, SubjectSplitStruct::num_seq_ranges, BlastGappedStats::num_seqs_passed, BlastHitSavingParameters::options, BlastScoringParameters::options, query, SSeqRange::right, BlastRPSLookupTable::rps_seq_offsets, s_AllocateSeqRange(), s_BackupSubject(), s_Blast_HSPListReapByPrelimEvalue(), s_BlastSearchEngineCoreCleanUp(), s_BlastSearchEngineOneContext(), s_RestoreSubject(), s_RPSOffsetArrayToContextOffsets(), BlastGapAlignStruct::sbp, BlastScoringParameters::scale_factor, SubjectSplitStruct::seq_ranges, SubjectSplitStruct::sequence, subject, and TRUE.
Referenced by BLAST_PreliminarySearchEngine(), and s_RPSPreliminarySearchEngine().
◆ s_BlastSearchEngineCoreCleanUp()Clean up function for s_BlastSearchEngineCore.
Definition at line 613 of file blast_engine.c.
References BlastQueryInfoFree(), eBlastTypeRpsTblastn, and sfree.
Referenced by s_BlastSearchEngineCore().
◆ s_BlastSearchEngineOneContext() static Int2 s_BlastSearchEngineOneContext ( EBlastProgramType program_number, BLAST_SequenceBlk * query, BlastQueryInfo * query_info, BLAST_SequenceBlk * subject, Int4 orig_length, LookupTableWrap * lookup, BlastGapAlignStruct * gap_align, const BlastScoringParameters * score_params, const BlastInitialWordParameters * word_params, const BlastExtensionParameters * ext_params, const BlastHitSavingParameters * hit_params, BlastDiagnostics * diagnostics, BlastCoreAuxStruct * aux_struct, BlastHSPList ** hsp_list_out_ptr, TInterruptFnPtr interrupt_search, SBlastProgress * progress_info ) staticSearches only one context of a database sequence, but does all chunks if it is split.
Definition at line 423 of file blast_engine.c.
References ASSERT, BLAST_GetUngappedHSPList(), Blast_HSPListAdjustOddBlastnScores(), Blast_HSPListAdjustOffsets(), Blast_HSPListFree(), Blast_HSPListPurgeHSPsWithCommonEndpoints(), Blast_HSPListsMerge(), Blast_HSPListSortByScore(), Blast_HSPListSubjectBestHit(), Blast_ProgramIsMapping(), Blast_ProgramIsNucleotide(), Blast_SubjectIsTranslated(), BLASTERR_INTERRUPTED, BlastHspNumMax(), BlastInitHitListReset(), SBlastScoreMatrix::data, DBSEQ_CHUNK_OVERLAP, eBlastTypeRpsTblastn, BlastCoreAuxStruct::ewp, BlastScoringOptions::gapped_calculation, BlastDiagnostics::gapped_stat, BlastCoreAuxStruct::GetGappedScore, GetOffsetArraySize(), SubjectSplitStruct::hard_ranges, SubjectSplitStruct::hm_index, BlastHitSavingOptions::hsp_filt_opt, BlastHSPList::hspcnt, BlastCoreAuxStruct::init_hitlist, INT4_MIN, BlastScoringOptions::is_ooframe, BlastCoreAuxStruct::JumperGapped, SSeqRange::left, lookup(), BlastCoreAuxStruct::mapper_wordhits, BlastScoreBlk::matrix, BlastQueryInfo::max_length, NULL, SubjectSplitStruct::offset, BlastCoreAuxStruct::offset_pairs, BlastHSPList::oid, BlastHitSavingParameters::options, BlastScoringParameters::options, BlastGapAlignStruct::positionBased, BlastScoreBlk::psi_matrix, SPsiBlastScoreMatrix::pssm, query, s_BackupSubject(), s_GetNextSubjectChunk(), s_RestoreSubject(), s_TranslateHSPsToDNAPCoord(), BlastGapAlignStruct::sbp, SubjectSplitStruct::sequence, subject, BlastHSPFilteringOptions::subject_besthit_opts, SUBJECT_SPLIT_DONE, SUBJECT_SPLIT_NO_RANGE, SUBJECT_SPLIT_OK, BlastInitHitList::total, TRUE, BlastDiagnostics::ungapped_stat, and BlastCoreAuxStruct::WordFinder.
Referenced by s_BlastSearchEngineCore().
◆ s_BlastSetUpAuxStructures()Setup of the auxiliary BLAST structures; also calculates internally used parameters from options.
Definition at line 971 of file blast_engine.c.
References ASSERT, BLAST_GetGappedScore(), BLAST_InitHitListNew(), BLAST_SmithWatermanGetGappedScore(), BlastAaWordFinder(), BlastChooseNaExtend(), BlastChooseNucleotideScanSubject(), BlastChooseProteinScanSubject(), BlastExtendWordNew(), BlastNaWordFinder(), BlastRPSWordFinder(), calloc(), eAaLookupTable, eCompressedAaLookupTable, eIndexedMBLookupTable, eJumperWithTraceback, ePhiLookupTable, ePhiNaLookupTable, BlastExtensionOptions::ePrelimGapExt, eRPSLookupTable, eSmithWatermanScoreOnly, BlastCoreAuxStruct::ewp, BlastCoreAuxStruct::GetGappedScore, GetOffsetArraySize(), BlastCoreAuxStruct::init_hitlist, BlastCoreAuxStruct::JumperGapped, JumperNaWordFinder(), LookupTableWrap::lut_type, malloc(), BlastCoreAuxStruct::mapper_wordhits, MapperWordHitsNew(), MB_IndexedWordFinder(), NULL, BlastQueryInfo::num_queries, BlastCoreAuxStruct::offset_pairs, PHI_MAX_HIT, PHIBlastWordFinder(), PHIGetGappedScore(), query, LookupTableWrap::read_indexed_db, ShortRead_IndexedWordFinder(), and BlastCoreAuxStruct::WordFinder.
Referenced by BLAST_PreliminarySearchEngine().
◆ s_FillReturnCutoffsInfo()Fills the output information about the cutoffs uses in a BLAST search.
Definition at line 928 of file blast_engine.c.
References BlastRawCutoffs::cutoff_score, BlastInitialWordParameters::cutoff_score_min, BlastHitSavingParameters::cutoff_score_min, BlastExtensionParameters::gap_x_dropoff, BlastExtensionParameters::gap_x_dropoff_final, if(), BlastScoringParameters::scale_factor, BlastRawCutoffs::ungapped_cutoff, BlastRawCutoffs::x_drop_gap, BlastRawCutoffs::x_drop_gap_final, BlastRawCutoffs::x_drop_ungapped, and BlastInitialWordParameters::x_dropoff_max.
Referenced by BLAST_PreliminarySearchEngine(), and s_RPSPreliminarySearchEngine().
◆ s_GetMinimumSubjSeqLen() ◆ s_GetNextSubjectChunk()Definition at line 221 of file blast_engine.c.
References ASSERT, COMPRESSION_RATIO, DBSEQ_CHUNK_OVERLAP, eSoftSubjMasking, SubjectSplitStruct::full_range, SubjectSplitStruct::hard_ranges, SubjectSplitStruct::hm_index, i, SSeqRange::left, len, MAX_DBSEQ_LEN, SubjectSplitStruct::next, SubjectSplitStruct::num_hard_ranges, SubjectSplitStruct::num_soft_ranges, SubjectSplitStruct::offset, SSeqRange::right, s_AllocateSeqRange(), SubjectSplitStruct::sequence, SubjectSplitStruct::sm_index, SubjectSplitStruct::soft_ranges, subject, SUBJECT_SPLIT_DONE, SUBJECT_SPLIT_NO_RANGE, and SUBJECT_SPLIT_OK.
Referenced by s_BlastSearchEngineOneContext().
◆ s_RestoreSubject() ◆ s_RPSOffsetArrayToContextOffsets()Set up context offsets for the auxiliary BlastQueryInfo structure that is created for the concatenated database in RPS BLAST search.
Calls the public function OffsetArrayToContextOffsets with a blastp program, because subjects are protein sequences. This guarantees that all frames are set to 0.
Definition at line 392 of file blast_engine.c.
References eBlastTypeBlastp, info, and OffsetArrayToContextOffsets().
Referenced by s_BlastSearchEngineCore().
◆ s_RPSPreliminarySearchEngine() static Int2 s_RPSPreliminarySearchEngine ( EBlastProgramType program_number, BLAST_SequenceBlk * query, BlastQueryInfo * query_info, const BlastSeqSrc * seq_src, const BlastScoringParameters * score_params, LookupTableWrap * lookup_wrap, BlastCoreAuxStruct * aux_struct, const BlastInitialWordParameters * word_params, const BlastExtensionParameters * ext_params, BlastGapAlignStruct * gap_align, const BlastHitSavingParameters * hit_params, BlastHSPStream * hsp_stream, BlastDiagnostics * diagnostics, TInterruptFnPtr interrupt_search, SBlastProgress * progress_info ) staticPerforms the preliminary stage of an RPS BLAST search, after all set up has already been done.
Definition at line 1096 of file blast_engine.c.
References Blast_GetOneQueryStructs(), Blast_HSPListFree(), Blast_ProgramIsRpsBlast(), BLASTERR_INTERRUPTED, BlastExtendWordFree(), BlastExtendWordNew(), BlastHSPStreamWrite(), BlastQueryInfoFree(), BlastSeqSrcGetNumSeqs(), BlastSeqSrcGetTotLen(), BlastSequenceBlkFree(), BlastDiagnostics::cutoffs, BlastCoreAuxStruct::ewp, FALSE, BlastHSPList::hspcnt, if(), INT4_MAX, lookup(), LookupTableWrap::lut, NULL, BlastQueryInfo::num_queries, BlastGapAlignStruct::positionBased, query, BlastHSPList::query_index, RPSPsiMatrixAttach(), RPSPsiMatrixDetach(), s_BlastSearchEngineCore(), s_FillReturnCutoffsInfo(), BlastGapAlignStruct::sbp, and TRUE.
Referenced by BLAST_PreliminarySearchEngine().
◆ s_TranslateHSPsToDNAPCoord()Adjust HSP coordinates for out-of-frame gapped extension.
Definition at line 324 of file blast_engine.c.
References Blast_InitHitListSortByScore(), BSearchContextInfo(), CODON_LENGTH, BlastQueryInfo::contexts, eBlastTypeBlastx, BlastInitHitList::init_hsp_array, offset, BlastInitHSP::offsets, BlastOffsetPair::q_off, BlastUngappedData::q_start, BlastOffsetPair::qs_offsets, BlastContextInfo::query_offset, BlastOffsetPair::s_off, BlastUngappedData::s_start, BlastInitHitList::total, and BlastInitHSP::ungapped_data.
Referenced by s_BlastSearchEngineOneContext().
◆ kBlastMajorVersion ◆ kBlastMinorVersion ◆ kBlastPatchVersion ◆ SUBJECT_SPLIT_DONE ◆ SUBJECT_SPLIT_NO_RANGE ◆ SUBJECT_SPLIT_OKRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4