summaryrefslogtreecommitdiff
path: root/algo/blast/core/blast_setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'algo/blast/core/blast_setup.c')
-rw-r--r--algo/blast/core/blast_setup.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/algo/blast/core/blast_setup.c b/algo/blast/core/blast_setup.c
index 6cda6a1e..3e478246 100644
--- a/algo/blast/core/blast_setup.c
+++ b/algo/blast/core/blast_setup.c
@@ -1,5 +1,5 @@
static char const rcsid[] =
- "$Id: blast_setup.c,v 1.62 2003/10/27 23:02:11 dondosha Exp $";
+ "$Id: blast_setup.c,v 1.65 2004/01/07 21:44:36 dondosha Exp $";
/* ===========================================================================
*
* PUBLIC DOMAIN NOTICE
@@ -32,7 +32,7 @@ Author: Tom Madden
Contents: Utilities initialize/setup BLAST.
-$Revision: 1.62 $
+$Revision: 1.65 $
******************************************************************************/
@@ -394,7 +394,7 @@ Int2 BLAST_MainSetUp(Uint1 program_number,
const BlastHitSavingOptions * hit_options,
BLAST_SequenceBlk * query_blk,
BlastQueryInfo * query_info,
- BlastSeqLoc ** lookup_segments, BlastMask * *filter_out,
+ BlastSeqLoc ** lookup_segments, BlastMaskLoc * *filter_out,
BlastScoreBlk * *sbpp, Blast_Message * *blast_message)
{
BlastScoreBlk *sbp;
@@ -407,10 +407,10 @@ Int2 BLAST_MainSetUp(Uint1 program_number,
BlastSeqLoc *filter_slp = NULL; /* SeqLocPtr computed for filtering. */
BlastSeqLoc *filter_slp_combined; /* Used to hold combined SeqLoc's */
BlastSeqLoc *loc; /* Iterator variable */
- BlastMask *last_filter_out = NULL;
+ BlastMaskLoc *last_filter_out = NULL;
Uint1 *buffer; /* holds sequence for plus strand or protein. */
Boolean reverse; /* Indicates the strand when masking filtered locations */
- BlastMask *mask_slp, *next_mask_slp; /* Auxiliary locations for lower
+ BlastMaskLoc *mask_slp, *next_mask_slp; /* Auxiliary locations for lower
case masks */
Int4 context_offset;
Boolean no_forward_strand;
@@ -502,15 +502,20 @@ Int2 BLAST_MainSetUp(Uint1 program_number,
/* Attach the lower case mask locations to the filter locations
and combine them */
- if (filter_slp && mask_slp) {
- for (loc = filter_slp; loc->next; loc = loc->next) ;
- loc->next = mask_slp->loc_list;
+ if (mask_slp) {
+ if (filter_slp) {
+ for (loc = filter_slp; loc->next; loc = loc->next);
+ loc->next = mask_slp->loc_list;
+ } else {
+ filter_slp = mask_slp->loc_list;
+ }
/* Set location list to NULL, to allow safe memory deallocation */
mask_slp->loc_list = NULL;
}
filter_slp_combined = NULL;
- CombineMaskLocations(filter_slp, &filter_slp_combined);
+ CombineMaskLocations(filter_slp, &filter_slp_combined, 0);
+
filter_slp = BlastSeqLocFree(filter_slp);
/* NB: for translated searches filter locations are returned in
@@ -520,10 +525,10 @@ Int2 BLAST_MainSetUp(Uint1 program_number,
if (filter_slp_combined) {
if (!last_filter_out) {
last_filter_out = *filter_out =
- (BlastMask *) calloc(1, sizeof(BlastMask));
+ (BlastMaskLoc *) calloc(1, sizeof(BlastMaskLoc));
} else {
last_filter_out->next =
- (BlastMask *) calloc(1, sizeof(BlastMask));
+ (BlastMaskLoc *) calloc(1, sizeof(BlastMaskLoc));
last_filter_out = last_filter_out->next;
}
last_filter_out->index = index;
@@ -561,7 +566,7 @@ Int2 BLAST_MainSetUp(Uint1 program_number,
/* Free the filtering locations if masking done for lookup table only */
if (mask_at_hash) {
- *filter_out = BlastMaskFree(*filter_out);
+ *filter_out = BlastMaskLocFree(*filter_out);
}
/* Get "ideal" values if the calculated Karlin-Altschul params bad. */