offset_array_size,
222init_hitlist, ungapped_stats);
231init_hitlist, ungapped_stats);
246 Int4offset_array_size,
272init_hitlist, ungapped_stats);
279init_hitlist, ungapped_stats);
302 Int4first_offset = 0;
305 Int4hsp_q, hsp_s, hsp_len;
307 Int4last_hit, s_last_off, diff;
308 Int4diag_offset, diag_coord, diag_mask;
311 Int4hits_extended = 0;
316diag_offset = diag->
offset;
325wordsize =
lookup->wordsize;
326last_offset =
subject->length - wordsize;
328 while(first_offset <= last_offset) {
334 for(
i= 0;
i<
lookup->num_buckets; ++
i) {
344 for(j = 0; j < hits; ++j) {
351diag_coord = (query_offset - subject_offset) & diag_mask;
354 if(diag_array[diag_coord].flag) {
356 if((
Int4) (subject_offset + diag_offset) <
357diag_array[diag_coord].last_hit) {
363subject_offset + diag_offset;
364diag_array[diag_coord].
flag= 0;
370last_hit = diag_array[diag_coord].
last_hit- diag_offset;
371diff = subject_offset - last_hit;
373 if(diff >= window) {
377subject_offset + diag_offset;
384 if(diff < wordsize) {
394subject_offset, query_offset,
395dropoff, &hsp_q, &hsp_s,
397wordsize, &right_extend,
405query_offset, subject_offset,
413diag_array[diag_coord].
flag= 1;
415s_last_off - (wordsize - 1) + diag_offset;
421subject_offset + diag_offset;
435ungapped_hsps->
total);
458 Int4hsp_q, hsp_s, hsp_len = 0;
460 Int4last_hit, s_last_off, diff;
461 Int4diag_offset, diag_coord, diag_mask;
464 Int4hits_extended = 0;
473diag_offset = diag->
offset;
485wordsize =
lookup->word_length;
486use_pssm =
lookup->use_pssm;
492wordsize =
lookup->word_length;
496scan_range[1] =
subject->seq_ranges[0].left;
497scan_range[2] =
subject->seq_ranges[0].right - wordsize;
499 if(scan_range[2] < scan_range[1])
500scan_range[2] = scan_range[1];
502 while(scan_range[1] <= scan_range[2]) {
504hits = scansub(lookup_wrap,
subject,
505offset_pairs, array_size, scan_range);
509 for(
i= 0;
i< hits; ++
i) {
510 Uint4query_offset = offset_pairs[
i].qs_offsets.q_off;
511 Uint4subject_offset = offset_pairs[
i].qs_offsets.s_off;
516diag_coord = (query_offset - subject_offset) & diag_mask;
519 if(diag_array[diag_coord].flag) {
521 if((
Int4) (subject_offset + diag_offset) <
522diag_array[diag_coord].last_hit) {
528subject_offset + diag_offset;
529diag_array[diag_coord].
flag= 0;
535last_hit = diag_array[diag_coord].
last_hit- diag_offset;
536diff = subject_offset - last_hit;
538 if(diff >= window) {
542subject_offset + diag_offset;
549 if(diff < wordsize) {
566 if(query_offset - diff <
571subject_offset + diag_offset;
575cutoffs = word_params->
cutoffs+ curr_context;
578subject_offset, query_offset,
582wordsize, &right_extend,
590query_offset, subject_offset, hsp_len,
597diag_array[diag_coord].
flag= 1;
599s_last_off - (wordsize - 1) + diag_offset;
605subject_offset + diag_offset;
617ungapped_hsps->
total);
636 Int4first_offset = 0;
638 Int4hsp_q, hsp_s, hsp_len;
642 Int4diag_offset, diag_coord, diag_mask, diff;
644 Int4hits_extended = 0;
649diag_offset = diag->
offset;
656wordsize =
lookup->wordsize;
657last_offset =
subject->length - wordsize;
659 while(first_offset <= last_offset) {
664 for(
i= 0;
i<
lookup->num_buckets;
i++) {
674 for(j = 0; j < hits; ++j) {
677diag_coord = (subject_offset - query_offset) & diag_mask;
678diff = subject_offset -
679(diag_array[diag_coord].
last_hit- diag_offset);
686subject_offset, query_offset,
687dropoff, &hsp_q, &hsp_s,
688&hsp_len, wordsize,
TRUE,
692 if(score >= cutoff) {
694query_offset, subject_offset,
698s_last_off - (wordsize - 1) + diag_offset;
708ungapped_hsps->
total);
729 Int4hsp_q, hsp_s, hsp_len;
733 Int4diag_offset, diag_coord, diag_mask, diff;
735 Int4hits_extended = 0;
742diag_offset = diag->
offset;
752wordsize =
lookup->word_length;
753use_pssm =
lookup->use_pssm;
759wordsize =
lookup->word_length;
763scan_range[1] =
subject->seq_ranges[0].left;
764scan_range[2] =
subject->seq_ranges[0].right - wordsize;
766 while(scan_range[1] <= scan_range[2]) {
768hits = scansub(lookup_wrap,
subject,
769offset_pairs, array_size, scan_range);
773 for(
i= 0;
i< hits; ++
i) {
774 Uint4query_offset = offset_pairs[
i].qs_offsets.q_off;
775 Uint4subject_offset = offset_pairs[
i].qs_offsets.s_off;
776diag_coord = (subject_offset - query_offset) & diag_mask;
777diff = subject_offset -
778(diag_array[diag_coord].
last_hit- diag_offset);
788subject_offset, query_offset,
790&hsp_q, &hsp_s, &hsp_len,
791wordsize, use_pssm, &s_last_off);
796query_offset, subject_offset, hsp_len,
800s_last_off - (wordsize - 1) + diag_offset;
810ungapped_hsps->
total);
838 Int4score = maxscore;
843s =
subject->sequence + s_off;
844q =
query->sequence + q_off;
846 for(
i= 0;
i<
n;
i++) {
847score += matrix[q[
i]][s[
i]];
849 if(score > maxscore) {
859 if(score <= 0 || (maxscore - score) >= dropoff)
863*length = best_i + 1;
864*s_last_off = s_off +
i;
893 Int4score = maxscore;
897 n=
MIN(s_off, q_off);
900s =
subject->sequence + s_off -
n;
901q =
query->sequence + q_off -
n;
903 for(
i=
n;
i>= 0;
i--) {
904score += matrix[q[
i]][s[
i]];
906 if(score > maxscore) {
915 if((maxscore - score) >= dropoff)
919*length =
n- best_i + 1;
945 Int4score = maxscore;
948 n=
MIN(
subject->length - s_off, query_size - q_off);
949s =
subject->sequence + s_off;
951 for(
i= 0;
i<
n;
i++) {
952score += matrix[q_off +
i][s[
i]];
954 if(score > maxscore) {
964 if(score <= 0 || (maxscore - score) >= dropoff)
968*length = best_i + 1;
969*s_last_off = s_off +
i;
992 Int4score = maxscore;
995 n=
MIN(s_off, q_off);
997s =
subject->sequence + s_off -
n;
999 for(
i=
n;
i>= 0;
i--) {
1000score += matrix[q_off -
n+
i][s[
i]];
1002 if(score > maxscore) {
1011 if((maxscore - score) >= dropoff)
1015*length =
n- best_i + 1;
1028 Int4score = 0, left_score, total_score, sum = 0;
1029 Int4left_disp = 0, right_disp = 0;
1030 Int4q_left_off = q_off, q_right_off =
1031q_off + word_size, q_best_left_off = q_off;
1032 Int4s_left_off, s_right_off;
1033 Int4init_hit_width = 0;
1038 for(
i= 0;
i< word_size;
i++) {
1040sum += matrix[q_off +
i][s[s_off +
i]];
1042sum += matrix[q[q_off +
i]][s[s_off +
i]];
1046q_best_left_off = q_left_off;
1047q_right_off = q_off +
i;
1048}
else if(sum <= 0) {
1050q_left_off = q_off +
i+ 1;
1054init_hit_width = q_right_off - q_left_off + 1;
1056q_left_off = q_best_left_off;
1058s_left_off = q_left_off + (s_off - q_off);
1059s_right_off = q_right_off + (s_off - q_off);
1063s_left_off - 1, q_left_off - 1,
1064dropoff, &left_disp, score);
1067s_right_off + 1, q_right_off + 1,
1068dropoff, &right_disp, left_score,
1072s_left_off - 1, q_left_off - 1,
1073dropoff, &left_disp, score);
1076s_right_off + 1, q_right_off + 1,
1077dropoff, &right_disp, left_score,
1081*hsp_q = q_left_off - left_disp;
1082*hsp_s = s_left_off - left_disp;
1083*hsp_len = left_disp + right_disp + init_hit_width;
1098 Int4left_d = 0, right_d = 0;
1099 Int4left_score = 0, right_score = 0;
1108 for(
i= 0;
i< word_size;
i++) {
1110score += matrix[q_right_off +
i][s[s_right_off +
i]];
1112score += matrix[q[q_right_off +
i]][s[s_right_off +
i]];
1114 if(score > left_score) {
1120q_right_off += right_d;
1121s_right_off += right_d;
1124*right_extend =
FALSE;
1125*s_last_off = s_right_off;
1130s_right_off - 1, q_right_off - 1,
1131dropoff, &left_d, 0);
1134s_right_off - 1, q_right_off - 1,
1135dropoff, &left_d, 0);
1138 if(left_d >= (s_right_off - s_left_off)) {
1140*right_extend =
TRUE;
1143s_right_off, q_right_off,
1144dropoff, &right_d, left_score,
1148s_right_off, q_right_off,
1149dropoff, &right_d, left_score,
1154*hsp_q = q_right_off - left_d;
1155*hsp_s = s_right_off - left_d;
1156*hsp_len = left_d + right_d;
1157 return MAX(left_score, right_score);
static Int4 s_BlastAaExtendOneHit(Int4 **matrix, const BLAST_SequenceBlk *subject, const BLAST_SequenceBlk *query, Int4 s_off, Int4 q_off, Int4 dropoff, Int4 *hsp_q, Int4 *hsp_s, Int4 *hsp_len, Int4 word_size, Boolean use_pssm, Int4 *s_last_off)
Perform a one-hit extension.
static Int2 s_BlastRPSWordFinder_OneHit(const BLAST_SequenceBlk *subject, const BLAST_SequenceBlk *query, const LookupTableWrap *lookup_wrap, Blast_ExtendWord *ewp, Int4 **matrix, Int4 cutoff, Int4 dropoff, BlastInitHitList *ungapped_hsps, BlastUngappedStats *ungapped_stats)
Scan a subject sequence for word hits and trigger one-hit extensions (spcialized for RPS blast).
static Int4 s_BlastAaExtendLeft(Int4 **matrix, const BLAST_SequenceBlk *subject, const BLAST_SequenceBlk *query, Int4 s_off, Int4 q_off, Int4 dropoff, Int4 *length, Int4 maxscore)
Beginning at s_off and q_off in the subject and query, respectively, extend to the left until the cum...
static Int4 s_BlastPSSMExtendRight(Int4 **matrix, const BLAST_SequenceBlk *subject, Int4 query_size, Int4 s_off, Int4 q_off, Int4 dropoff, Int4 *length, Int4 maxscore, Int4 *s_last_off)
Identical to BlastAaExtendRight, except the score matrix is position-specific.
static Int2 s_BlastAaWordFinder_OneHit(const BLAST_SequenceBlk *subject, const BLAST_SequenceBlk *query, const LookupTableWrap *lookup_wrap, Blast_ExtendWord *ewp, Int4 **matrix, const BlastInitialWordParameters *word_params, BlastQueryInfo *query_info, BlastOffsetPair *offset_pairs, Int4 array_size, BlastInitHitList *ungapped_hsps, BlastUngappedStats *ungapped_stats)
Scan a subject sequence for word hits and trigger one-hit extensions.
static Int2 s_BlastAaWordFinder_TwoHit(const BLAST_SequenceBlk *subject, const BLAST_SequenceBlk *query, const LookupTableWrap *lookup_wrap, Blast_ExtendWord *ewp, Int4 **matrix, const BlastInitialWordParameters *word_params, BlastQueryInfo *query_info, BlastOffsetPair *offset_pairs, Int4 array_size, BlastInitHitList *ungapped_hsps, BlastUngappedStats *ungapped_stats)
Scan a subject sequence for word hits and trigger two-hit extensions.
static Int4 s_BlastPSSMExtendLeft(Int4 **matrix, const BLAST_SequenceBlk *subject, Int4 s_off, Int4 q_off, Int4 dropoff, Int4 *length, Int4 maxscore)
Identical to BlastAaExtendLeft, except the query is represented by a position-specific score matrix.
Int2 BlastAaWordFinder(BLAST_SequenceBlk *subject, BLAST_SequenceBlk *query, BlastQueryInfo *query_info, LookupTableWrap *lut_wrap, Int4 **matrix, const BlastInitialWordParameters *word_params, Blast_ExtendWord *ewp, BlastOffsetPair *offset_pairs, Int4 offset_array_size, BlastInitHitList *init_hitlist, BlastUngappedStats *ungapped_stats)
Scan a subject sequence for word hits (blastp)
static Int4 s_BlastAaExtendRight(Int4 **matrix, const BLAST_SequenceBlk *subject, const BLAST_SequenceBlk *query, Int4 s_off, Int4 q_off, Int4 dropoff, Int4 *length, Int4 maxscore, Int4 *s_last_off)
Beginning at s_off and q_off in the subject and query, respectively, extend to the right until the cu...
static Int2 s_BlastRPSWordFinder_TwoHit(const BLAST_SequenceBlk *subject, const BLAST_SequenceBlk *query, const LookupTableWrap *lookup_wrap, Blast_ExtendWord *ewp, Int4 **matrix, Int4 cutoff, Int4 dropoff, BlastInitHitList *ungapped_hsps, BlastUngappedStats *ungapped_stats)
Scan a subject sequence for word hits and trigger two-hit extensions (specialized for RPS blast).
Int2 BlastRPSWordFinder(BLAST_SequenceBlk *subject, BLAST_SequenceBlk *query, BlastQueryInfo *query_info, LookupTableWrap *lut_wrap, Int4 **matrix, const BlastInitialWordParameters *word_params, Blast_ExtendWord *ewp, BlastOffsetPair *offset_pairs, Int4 offset_array_size, BlastInitHitList *init_hitlist, BlastUngappedStats *ungapped_stats)
Scan a subject sequence for word hits (rpsblast and rpstblastn)
static Int4 s_BlastAaExtendTwoHit(Int4 **matrix, const BLAST_SequenceBlk *subject, const BLAST_SequenceBlk *query, Int4 s_left_off, Int4 s_right_off, Int4 q_right_off, Int4 dropoff, Int4 *hsp_q, Int4 *hsp_s, Int4 *hsp_len, Boolean use_pssm, Int4 word_size, Boolean *right_extend, Int4 *s_last_off)
Perform a two-hit extension.
Protein ungapped extension code.
Routines for creating protein BLAST lookup tables.
Routines for creating protein BLAST lookup tables.
Int4 BlastRPSScanSubject(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *sequence, Int4 *offset)
Scans the RPS query sequence from "offset" to the end of the sequence.
Int4(* TAaScanSubjectFunction)(const LookupTableWrap *lookup_wrap, const BLAST_SequenceBlk *subject, BlastOffsetPair *offset_pairs, Int4 max_hits, Int4 *s_range)
Generic prototype for nucleotide subject scanning routines.
#define NUM_FRAMES
Number of frames to which we translate in translating searches.
void Blast_UngappedStatsUpdate(BlastUngappedStats *ungapped_stats, Int4 total_hits, Int4 extended_hits, Int4 saved_hits)
Fill data in the ungapped hits diagnostics structure.
void Blast_InitHitListSortByScore(BlastInitHitList *init_hitlist)
Sort array of initial HSPs by score.
Int2 Blast_ExtendWordExit(Blast_ExtendWord *ewp, Int4 subject_length)
Update the word extension structure after scanning of each subject sequence.
void BlastSaveInitHsp(BlastInitHitList *ungapped_hsps, Int4 q_start, Int4 s_start, Int4 q_off, Int4 s_off, Int4 len, Int4 score)
Add a new initial (ungapped) HSP to an initial hit list.
@ eAaLookupTable
standard protein (blastp) lookup table
Int4 BSearchContextInfo(Int4 n, const BlastQueryInfo *A)
Search BlastContextInfo structures for the specified offset.
Various auxiliary BLAST utility functions.
Int4 BLAST_FrameToContext(Int2 frame, EBlastProgramType program)
Convert translation frame or strand into a context number suitable for indexing into the BlastQueryIn...
static int lookup(const char *name, const struct lookup_int *table)
uint8_t Uint1
1-byte (8-bit) unsigned integer
int16_t Int2
2-byte (16-bit) signed integer
int32_t Int4
4-byte (32-bit) signed integer
uint32_t Uint4
4-byte (32-bit) unsigned integer
while(yy_chk[yy_base[yy_current_state]+yy_c] !=yy_current_state)
#define MIN(a, b)
returns smaller of a and b.
Uint1 Boolean
bool replacment for C
#define TRUE
bool replacment for C indicating true.
#define FALSE
bool replacment for C indicating false.
#define ASSERT
macro for assert.
#define MAX(a, b)
returns larger of a and b.
Structure containing parameters needed for initial word extension.
DiagStruct * hit_level_array
Array to hold latest hits and their lengths for all diagonals.
Int4 diag_mask
Used to mask off everything above min_diag_length (mask = min_diag_length-1).
Boolean multiple_hits
Used by BlastExtendWordNew to decide whether or not to prepare the structure for multiple-hit type se...
Int4 window
The "window" size, within which two (or more) hits must be found in order to be extended.
Int4 offset
"offset" added to query and subject position so that "last_hit" doesn't have to be zeroed out every t...
Structure to hold a sequence.
The basic lookup table structure for blastp searches.
The lookup table structure for protein searches using a compressed alphabet.
Int4 query_offset
Offset of this query, strand or frame in the concatenated super-query.
Structure to hold all initial HSPs for a given subject sequence.
Int4 total
Total number of hits currently saved.
Parameter block that contains a pointer to BlastInitialWordOptions and the values derived from it.
BlastUngappedCutoffs * cutoffs
cutoff values (one per context)
The query related information.
BlastContextInfo * contexts
Information per context.
The basic lookup table structure for RPS blast searches.
All the ungapped cutoff values that can change from context to context.
Int4 cutoff_score
Cutoff score for saving ungapped hits.
Int4 x_dropoff
Raw X-dropoff value used in the ungapped extension.
Structure containing hit counts from the ungapped stage of a BLAST search.
Structure for keeping initial word extension information.
BLAST_DiagTable * diag_table
Diagonal array and related parameters.
Structure for keeping last hit information for a diagonal.
signed int last_hit
Offset of the last hit.
unsigned int flag
Reset the next extension?
Wrapper structure for different types of BLAST lookup tables.
void * lut
Pointer to the actual lookup table structure.
ELookupTableType lut_type
What kind of a lookup table it is?
structure used for bucket sorting offsets retrieved from the RPS blast lookup table.
Int4 num_filled
number of offset pairs currently in bucket
BlastOffsetPair * offset_pairs
list of offset pairs
This symbol enables the verbose option in makeblastdb and other BLAST+ search command line applicatio...
Uint4 q_off
Query offset.
Uint4 s_off
Subject offset.
struct BlastOffsetPair::@6 qs_offsets
Query/subject offset pair.
static CS_CONTEXT * context
RetroSearch 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