1084
SeqAlignPtr RPSAlignTraceBack(BlastSearchBlkPtr search, RPSInfoPtr rpsinfo,
1085
Uint1Ptr subject_seq, SeqLocPtr slp, BioseqPtr
1243
/* Multiplier used by Impala, should use Method of Altshul, Bundschuh, etc.? */
1244
#define PRO_K_MULTIPLIER 1.2
1246
* modify BlastResults structure.
1249
static int RPSSearchPartialPrepare( BlastSearchBlkPtr search,
1251
Uint1Ptr subject_seq,
1253
BioseqPtr subject_bsp){
1254
Int4 subject_length = 0;
1256
if(search->result_struct->hitlist_count == 0 ||
1257
search->result_struct->results[0]->hspcnt == 0) /* No brain no pain */
1260
if(search->result_struct->hitlist_count != 1) {
1261
ErrPostEx(SEV_ERROR, 0,0, "RPSSearchPartialPrepare: This function works only for hitlist_count == 1 (%d)",
1262
search->result_struct->hitlist_count);
1266
HeapSort(search->result_struct->results[0]->hsp_array,
1267
search->result_struct->results[0]->hspcnt,
1268
sizeof(BLASTResultHsp),
1269
RPSResultHspScoreCmp);
1271
subject_length = SeqLocLen(slp);
1274
search->subject_info = BLASTSubjectInfoNew(
1275
SeqIdDup(SeqIdFindBest(subject_bsp->id, SEQID_GI)),
1276
StringSave(BioseqGetTitle(subject_bsp)), subject_length);
1278
RPSCalcEValue( search, rpsinfo,subject_seq, slp, subject_bsp );
1285
* modified version, everything moved out of loop
1287
int RPSCalcEValue(BlastSearchBlkPtr search, RPSInfoPtr rpsinfo,
1288
Uint1Ptr subject_seq, SeqLocPtr slp, BioseqPtr subject_bsp)
1290
/* BLASTResultHspPtr hsp_array, hsp; */
1291
/* BLASTResultHsp *hsp_array; */
1292
BLASTResultHsp *hsp;
1293
Int4 hspcnt, index /* , index1 */ ;
1294
BLAST_KarlinBlkPtr PNTR kbp;
1295
Nlm_FloatHi searchsp_eff;
1296
RPSequencePtr rpseq;
1297
Nlm_FloatHi e_value, lambda_ratio;
1298
Int4 subject_length, subject_id;
1299
Int4Ptr PNTR posMatrix;
1302
/* hsp_array = search->result_struct->results[0]->hsp_array; */
1303
hspcnt = search->result_struct->results[0]->hspcnt;
1306
kbp = search->sbp->kbp_gap;
1307
searchsp_eff = search->searchsp_eff;
1311
subject_length = SeqLocLen(slp);
1312
subject_id = search->result_struct->results[0]->subject_id;
1315
search->result_struct->results[0]->subject_info=
1316
BLASTSubjectInfoNew(SeqIdDup(SeqIdFindBest(subject_bsp->id, SEQID_GI)),
1317
StringSave(BioseqGetTitle(subject_bsp)), subject_length);
1319
rpseq = RPSGetSequence(rpsinfo, subject_id);
1322
/* (!!!!!) It looks like this function is called second time
1323
RPSubstituteQueryLookup(search, rpseq, FALSE);
1327
if (rpsinfo->query_is_prot == TRUE) {
1328
if(!RPSimpalaStatCorrections(rpseq, &lambda_ratio, search->pbp->scalingFactor,
1329
subject_length, subject_seq)) {
1331
SeqIdWrite(rpseq->seqid, tmp, PRINTID_FASTA_LONG, sizeof(tmp));
1332
ErrPostEx(SEV_WARNING, 0, rpseq->number,
1333
"BAD matrix for the sequence %s %s",
1334
tmp, rpseq->description);
1335
RPSequenceFree(rpseq);
1339
if (rpsinfo->karlinK) {
1340
search->sbp->kbp_gap[0]->K = PRO_K_MULTIPLIER*rpsinfo->karlinK[ subject_id ];
1341
search->sbp->kbp_gap[0]->logK = log(search->sbp->kbp_gap[0]->K);
1342
/* scalingFactor should only be different than one (or zero) if
1343
the aux file was read and rpsinfo->karlinK was filled in. */
1345
/* #ifdef DEALLOC_MATRIX *
1347
if (rpseq->copyMatrix) {
1348
posMatrix = search->sbp->posMatrix;
1349
search->sbp->posMatrix = rpseq->copyMatrix;
1355
if (search->pbp->scalingFactor != 0) search->sbp->kbp_gap[0]->Lambda /= search->pbp->scalingFactor;
1356
kbp = search->sbp->kbp_gap;
1358
for (index=0; index<hspcnt; index++) {
1360
hsp = &(search->result_struct->results[0]->hsp_array[ index] ); /* sp_array[index]; */
1362
/*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ */
1363
/* CALCULATE E-VALUE HERE */
1364
e_value = BlastKarlinStoE_simple(hsp->score, kbp[0], searchsp_eff);
1365
hsp->e_value = e_value;
1366
/* fprintf(stderr,"score: %d e-value: %g\n",hsp->score,hsp->e_value); */
1367
/*\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ */
1369
} /* end of for cycle */
1372
if (rpsinfo->query_is_prot == TRUE) {
1373
/* #ifdef DEALLOC_MATRIX */
1374
/* Deallocate copyMatrix to prevent a leak. */
1375
if (rpseq->copyMatrix) {
1376
/* for (index1=0; index1<(1+rpseq->seqlen); index1++) */
1377
/* MemFree(rpseq->copyMatrix[index1]); */
1379
rpseq->copyMatrix = MemFree(rpseq->copyMatrix);
1380
search->sbp->posMatrix = posMatrix;
1383
if (rpsinfo->karlinK) {
1385
search->sbp->kbp_gap[0]->K /= PRO_K_MULTIPLIER;
1386
search->sbp->kbp_gap[0]->logK = log(search->sbp->kbp_gap[0]->K);
1390
if (search->pbp->scalingFactor != 0) search->sbp->kbp_gap[0]->Lambda *= search->pbp->scalingFactor;
1393
RPSequenceFree(rpseq);
1400
static SeqAlignPtr RPSAlignTraceBack(BlastSearchBlkPtr search, RPSInfoPtr rpsinfo,
1401
Uint1Ptr subject_seq, SeqLocPtr slp, BioseqPtr
1088
1404
SeqAlignPtr seqalign;
1089
1405
BLASTResultsStructPtr result_struct, result_struct_new;
1649
/* \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ */
1652
RPS_FIX(BlastSearchBlkPtr search, RPSInfoPtr rpsinfo,
1653
Uint1Ptr subject_seq, SeqLocPtr slp, BioseqPtr
1656
SeqAlignPtr seqalign;
1657
/* BLASTResultsStructPtr result_struct; */
1658
BLASTResultsStructPtr result_struct_new;
1659
Int4 index, index1, subject_length, rev_subject_length;
1660
Int4Ptr PNTR posMatrix;
1661
BLASTResultHitlistPtr new_result;
1663
RPSequencePtr rpseq;
1664
Nlm_FloatHi e_value, lambda_ratio;
1665
Uint1Ptr subject = NULL, rev_subject = NULL;
1669
fprintf(stderr,"[^^^] RPS_FIX -- START\n");
1671
/* result_struct = search->result_struct; */
1673
if(search->result_struct->hitlist_count == 0 || search-> result_struct->results[0]->hspcnt == 0) /* No brain no pain */
1677
result_struct_new = BLASTResultsStructNew( search->result_struct->results[0]->hspcnt, search->pbp->max_pieces, search->pbp->hsp_range_max);
1679
if(search->result_struct->hitlist_count != 1) {
1680
ErrPostEx(SEV_ERROR, 0,0, "RPSUpdateResult: This function works only for hitlist_count == 1 (%d)", search->result_struct->hitlist_count);
1684
HeapSort(search->result_struct->results[0]->hsp_array,
1685
search->result_struct->results[0]->hspcnt,
1686
sizeof(BLASTResultHsp), RPSResultHspScoreCmp);
1688
subject_length = SeqLocLen(slp);
1690
search->result_struct = result_struct_new;
1692
search->subject_info = BLASTSubjectInfoNew(SeqIdDup(SeqIdFindBest(subject_bsp->id, SEQID_GI)), StringSave(BioseqGetTitle(subject_bsp)), subject_length);
1696
rpssp = RPSapSortInit();
1698
/* First we have to update coordinates */
1699
RPSUpdateCoordinates(rpsinfo->rdfp, search->result_struct->results[0], FALSE);
1701
/* Now we will extract correct "results" one by one
1702
and make alignment then */
1704
result_struct_new->hitlist_count = 1; /* Always will be 1 */
1706
/* We have to create 4na buffer for our query, that is subject */
1707
if(!rpsinfo->query_is_prot) {
1708
spp = SeqPortNew(subject_bsp, 0, -1, Seq_strand_plus,
1710
/* make one longer to "protect" ALIGN. */
1711
subject = MemNew((1+subject_bsp->length)*sizeof(Uint1));
1712
for (index1 = 0; index1 < subject_bsp->length; index1++) {
1713
subject[index1] = SeqPortGetResidue(spp);
1716
/* Gap character in last space. */
1717
subject[subject_bsp->length] = NULLB;
1718
subject_length = subject_bsp->length;
1719
spp = SeqPortFree(spp);
1721
spp = SeqPortNew(subject_bsp, 0, -1, Seq_strand_minus, Seq_code_ncbi4na);
1722
/* make one longer to "protect" ALIGN. */
1723
rev_subject = MemNew((1+subject_bsp->length)*sizeof(Uint1));
1724
for (index1=0; index1<subject_bsp->length; index1++) {
1725
rev_subject[index1] = SeqPortGetResidue(spp);
1727
/* Gap character in last space. */
1728
rev_subject[subject_bsp->length] = NULLB;
1729
rev_subject_length = subject_bsp->length;
1730
spp = SeqPortFree(spp);
1733
/* ---------------------- */
1735
for(index = 0; index < result_struct_new->hitlist_max; index++) {
1737
new_result = RPSExtractNewResult(search->result_struct->results[0]);
1739
if(new_result == NULL) break;
1741
new_result->subject_info = BLASTSubjectInfoNew(SeqIdDup(SeqIdFindBest(subject_bsp->id, SEQID_GI)),
1742
StringSave(BioseqGetTitle(subject_bsp)), subject_length);
1743
result_struct_new->results[0] = new_result;
1745
/* subject_id == query_id in rdfp database */
1746
rpseq = RPSGetSequence(rpsinfo, new_result->subject_id);
1748
RPSubstituteQueryLookup(search, rpseq, FALSE);
1749
/* Correct statistics for proteins, should also be doen for nucleotides. */
1750
if (rpsinfo->query_is_prot == TRUE) {
1751
if(!RPSimpalaStatCorrections(rpseq, &lambda_ratio, search->pbp->scalingFactor,
1752
subject_length, subject_seq)) {
1755
/* If this function failed - and returned FALSE - matrix
1756
used for this sequence is incorrect and results may not
1757
be trusted. We will post WARNING message and skip this
1758
profile completatly */
1760
SeqIdWrite(rpseq->seqid, tmp, PRINTID_FASTA_LONG, sizeof(tmp));
1762
ErrPostEx(SEV_WARNING, 0, rpseq->number,
1763
"BAD matrix for the sequence %s %s",
1764
tmp, rpseq->description);
1767
RPSequenceFree(rpseq);
1768
BLASTResultHitlistFree(new_result);
1769
result_struct_new->results[0] = NULL;
1773
if (rpsinfo->karlinK)
1775
search->sbp->kbp_gap[0]->K = PRO_K_MULTIPLIER*rpsinfo->karlinK[new_result->subject_id];
1776
search->sbp->kbp_gap[0]->logK = log(search->sbp->kbp_gap[0]->K);
1777
/* scalingFactor should only be different than one (or zero) if
1778
the aux file was read and rpsinfo->karlinK was filled in. */
1781
if (rpseq->copyMatrix) {
1782
posMatrix = search->sbp->posMatrix;
1783
search->sbp->posMatrix = rpseq->copyMatrix;
1787
if (search->pbp->scalingFactor != 0)
1788
search->sbp->kbp_gap[0]->Lambda /= search->pbp->scalingFactor;
1790
if(rpsinfo->query_is_prot) {
1792
if(search->pbp->gapped_calculation == TRUE) {
1793
seqalign = BlastGetGapAlgnTbck(search, 0, TRUE, FALSE,
1795
subject_length, NULL, 0);
1798
seqalign = GetSeqAlignForResultHitList(search, TRUE, FALSE,
1799
search->pbp->discontinuous,
1802
} else { /* tblastn */
1804
seqalign = BlastGetGapAlgnTbck (search, 0, TRUE, FALSE,
1805
subject, subject_length,
1806
rev_subject, rev_subject_length);
1809
/* Deallocate copyMatrix to prevent a leak. */
1810
if (rpseq->copyMatrix)
1812
for (index1=0; index1<(1+rpseq->seqlen); index1++)
1813
MemFree(rpseq->copyMatrix[index1]);
1814
rpseq->copyMatrix = MemFree(rpseq->copyMatrix);
1815
search->sbp->posMatrix = posMatrix;
1816
if (rpsinfo->karlinK) {
1818
search->sbp->kbp_gap[0]->K /= PRO_K_MULTIPLIER;
1819
search->sbp->kbp_gap[0]->logK = log(search->sbp->kbp_gap[0]->K);
1823
if(seqalign != NULL && (e_value = getEvalueFromSeqAlign(seqalign)) <
1824
search->pbp->cutoff_e) {
1825
AdjustOffSetsInSeqAlign(seqalign, slp, search->query_slp);
1826
RPSAddSap(rpssp, seqalign);
1828
SeqAlignSetFree(seqalign);
1833
RPSequenceFree(rpseq);
1834
BLASTResultHitlistFree(new_result);
1836
result_struct_new->results[0] = NULL;
1839
result_struct_new->hitlist_count = 0;
1841
/* ??? -- BLASTResultsStructDelete(result_struct); */
1843
seqalign = RPSReadSapSort(rpssp);
1845
MemFree(rev_subject);
1848
RPSapSortFree(rpssp);
1850
fprintf(stderr,"[^^^] RPS_FIX -- END\n");
1859
/* \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ */
1861
* support RPS searches with Net-result-struct type of results
1863
SeqAlignPtr RPSBlastSearchEx (BlastSearchBlkPtr search,
1864
BioseqPtr query_bsp, RPSInfoPtr rpsinfo, Boolean partial)
1868
SeqAlignPtr seqalign=NULL, head = NULL, seqalign_var = NULL;
1870
Uint1Ptr subject_seq, subject_seq_start;
1872
Int4 subject_length;
1873
SeqLocPtr slp = NULL;
1874
BioseqPtr subject_bsp;
1875
RPSequencePtr rpseq;
1876
BioseqPtr bsp = NULL;
1877
SPCompressPtr spc = NULL;
1879
/* call normal RPS search if this is not SPLITDB */
1880
if( !partial ) return RPSBlastSearch(search,query_bsp,rpsinfo);
1884
if (search == NULL || search->query_invalid)
1888
subject_bsp = query_bsp; /* Reversed ... */
1890
if (rpsinfo->query_slp == NULL ||
1891
SeqLocLen(rpsinfo->query_slp) == subject_bsp->length ||
1892
ISA_na(subject_bsp->mol)) {
1893
ValNodeAddPointer(&slp, SEQLOC_WHOLE, SeqIdDup(subject_bsp->id));
1895
slp = SeqLocIntNew(SeqLocStart(rpsinfo->query_slp),
1896
SeqLocStop(rpsinfo->query_slp),
1897
SeqLocStrand(rpsinfo->query_slp),
1898
SeqIdDup(subject_bsp->id));
1900
subject_length = SeqLocLen(slp);
1902
search->subject_info = BLASTSubjectInfoDestruct(search->subject_info);
1904
/* Extracting sequence from the Bioseq */
1906
if(rpsinfo->query_is_prot) { /* For blastp search */
1907
subject_seq_start = subject_seq = NULL;
1909
subject_seq_start = (Uint1Ptr) MemNew(((subject_bsp->length)+2)*sizeof(Uint1));
1910
/* The first residue is the sentinel. */
1911
subject_seq_start[0] = NULLB;
1912
subject_seq = subject_seq_start+1;
1914
spp = SeqPortNewByLoc(slp, Seq_code_ncbistdaa);
1915
while ((residue=SeqPortGetResidue(spp)) != SEQPORT_EOF) {
1916
if (IS_residue(residue)) {
1917
subject_seq[index++] = residue;
1920
subject_seq[index] = NULLB;
1921
spp = SeqPortFree(spp);
1922
} else { /* tblastn */
1923
spp = SeqPortNewByLoc(slp, Seq_code_ncbi4na);
1924
subject_bsp = BioseqFindCore(SeqLocId(slp));
1925
if (subject_bsp != NULL && subject_bsp->repr == Seq_repr_delta)
1926
SeqPortSet_do_virtual(spp, TRUE);
1927
spc = SPCompressDNA(spp);
1930
subject_seq_start = subject_seq = spc->buffer;
1931
spp = SeqPortFree(spp);
1933
/* Adjusting translation buffer */
1934
spc->lbytes = MemFree(spc->lbytes);
1936
MemFree(search->translation_buffer);
1937
search->translation_buffer = MemNew((3+(subject_length/3))*sizeof(Uint1));
1938
search->translation_buffer_size = 1 + (subject_length/3);
1941
if(search->context[0].query->sequence_start != NULL) {
1942
MemFree(search->context[0].query->sequence_start);
1943
search->context[0].query->sequence_start = NULL;
1946
/* Cleaning up word finder */
1949
RPSLookupCleanUp(search->wfp->lookup);
1953
search->subject_info = BLASTSubjectInfoNew(SeqIdDup(SeqIdFindBest(subject_bsp->id, SEQID_GI)), StringSave(BioseqGetTitle(subject_bsp)), subject_length);
1954
rpseq = RPSGetBIGSequence(rpsinfo, &bsp);
1956
/* RRRPrintStatistics(rpseq); */
1958
RPSubstituteQueryLookup(search, rpseq, TRUE);
1960
/* Filter the subject sequence, that is actually query */
1961
if(rpsinfo->query_is_prot && search->mask != NULL) {
1962
BlastMaskTheResidues(subject_seq, subject_length, 21,
1963
search->mask->data.ptrvalue, FALSE, 0);
1966
/* Performing real search here */
1967
status = BLASTPerformSearch(search, subject_length, subject_seq);
1970
/* This is a fatal error, must exit now */
1971
search = BlastSearchBlkDestruct(search);
1975
if(!rpsinfo->query_is_prot) {
1976
/* status = BlastLinkHsps(search); */
1977
} else if (search->pbp->gapped_calculation == FALSE) {
1978
if (search->pbp->do_sum_stats == TRUE)
1979
status = BlastLinkHsps(search);
1981
status = BlastGetNonSumStatsEvalue(search);
1984
status = BlastReapHitlistByEvalue(search);
1986
BlastSaveCurrentHitlist(search);
1988
/* call this function to re-arrange results to be more
1989
compatible with BLASTResultHitlistToNetResultHitlist
1991
search->rdfp = rpsinfo->rdfp;
1992
RPSSearchPartialPrepare( search, rpsinfo, subject_seq, slp, subject_bsp);
1999
* bypass RPS search and use passed results structure.
2002
SeqAlignPtr RPSBlastSearchLight (BlastSearchBlkPtr search,
2003
BioseqPtr query_bsp, RPSInfoPtr rpsinfo,
2004
BLASTResultsStructPtr ready_result_struct){
2007
SeqAlignPtr seqalign=NULL, head = NULL, seqalign_var = NULL;
2009
Uint1Ptr subject_seq, subject_seq_start;
2011
Int4 subject_length;
2012
SeqLocPtr slp = NULL;
2013
BioseqPtr subject_bsp;
2014
RPSequencePtr rpseq;
2015
BioseqPtr bsp = NULL;
2016
SPCompressPtr spc = NULL;
2018
SeqLocPtr filter_slp;
2020
if (search == NULL || search->query_invalid)
2024
subject_bsp = query_bsp; /* Reversed ... */
2026
if (rpsinfo->query_slp == NULL ||
2027
SeqLocLen(rpsinfo->query_slp) == subject_bsp->length ||
2028
ISA_na(subject_bsp->mol)) {
2029
ValNodeAddPointer(&slp, SEQLOC_WHOLE, SeqIdDup(subject_bsp->id));
2031
slp = SeqLocIntNew(SeqLocStart(rpsinfo->query_slp),
2032
SeqLocStop(rpsinfo->query_slp),
2033
SeqLocStrand(rpsinfo->query_slp),
2034
SeqIdDup(subject_bsp->id));
2036
subject_length = SeqLocLen(slp);
2038
search->subject_info = BLASTSubjectInfoDestruct(search->subject_info);
2040
/* Extracting sequence from the Bioseq */
2042
if(rpsinfo->query_is_prot) { /* For blastp search */
2043
subject_seq_start = subject_seq = NULL;
2045
subject_seq_start = (Uint1Ptr) MemNew(((subject_bsp->length)+2)*sizeof(Uint1));
2046
/* The first residue is the sentinel. */
2047
subject_seq_start[0] = NULLB;
2048
subject_seq = subject_seq_start+1;
2050
spp = SeqPortNewByLoc(slp, Seq_code_ncbistdaa);
2051
while ((residue=SeqPortGetResidue(spp)) != SEQPORT_EOF) {
2052
if (IS_residue(residue)) {
2053
subject_seq[index++] = residue;
2056
subject_seq[index] = NULLB;
2057
spp = SeqPortFree(spp);
2058
} else { /* tblastn */
2059
spp = SeqPortNewByLoc(slp, Seq_code_ncbi4na);
2060
subject_bsp = BioseqFindCore(SeqLocId(slp));
2061
if (subject_bsp != NULL && subject_bsp->repr == Seq_repr_delta)
2062
SeqPortSet_do_virtual(spp, TRUE);
2063
spc = SPCompressDNA(spp);
2066
subject_seq_start = subject_seq = spc->buffer;
2067
spp = SeqPortFree(spp);
2069
/* Adjusting translation buffer */
2070
spc->lbytes = MemFree(spc->lbytes);
2072
MemFree(search->translation_buffer);
2073
search->translation_buffer = MemNew((3+(subject_length/3))*sizeof(Uint1));
2074
search->translation_buffer_size = 1 + (subject_length/3);
2077
if(search->context[0].query->sequence_start != NULL) {
2078
MemFree(search->context[0].query->sequence_start);
2079
search->context[0].query->sequence_start = NULL;
2082
/* Cleaning up word finder */
2085
RPSLookupCleanUp(search->wfp->lookup);
2088
search->subject_info = BLASTSubjectInfoNew(SeqIdDup(SeqIdFindBest(subject_bsp->id, SEQID_GI)), StringSave(BioseqGetTitle(subject_bsp)), subject_length);
2089
rpseq = RPSGetBIGSequence(rpsinfo, &bsp);
2091
/* RRRPrintStatistics(rpseq); */
2093
RPSubstituteQueryLookup(search, rpseq, TRUE);
2095
/* Filter the subject sequence, that is actually query */
2096
if(rpsinfo->query_is_prot && search->mask != NULL) {
2097
BlastMaskTheResidues(subject_seq, subject_length, 21,
2098
search->mask->data.ptrvalue, FALSE, 0);
2101
/* NOT Performing real search here, but assigning ready results */
2102
search->result_struct = ready_result_struct ;
2104
status = BLASTPerformSearch(search, subject_length, subject_seq) ;
2107
/* This is a fatal error, must exit now */
2108
search = BlastSearchBlkDestruct(search);
2113
if(!rpsinfo->query_is_prot) {
2114
/* status = BlastLinkHsps(search); */
2115
} else if (search->pbp->gapped_calculation == FALSE) {
2116
if (search->pbp->do_sum_stats == TRUE)
2117
status = BlastLinkHsps(search);
2119
status = BlastGetNonSumStatsEvalue(search);
2122
status = BlastReapHitlistByEvalue(search);
2124
BlastSaveCurrentHitlist(search);
2126
seqalign = RPSAlignTraceBack(search, rpsinfo, subject_seq,
2129
/* Now converting protein filter SeqLoc-s into DNA seqlocs */
2130
if(!rpsinfo->query_is_prot) {
2131
for(vnp = search->mask; vnp != NULL; vnp = vnp->next) {
2132
filter_slp = (SeqLocPtr) vnp->data.ptrvalue;
2133
BlastConvertProteinSeqLoc(filter_slp, DefineToFrame(vnp->choice),
2134
subject_bsp->length);
2138
search->context[0].query->sequence_start = NULL;
2139
search->context[0].query->sequence = NULL;
2141
slp = SeqLocFree(slp);
2143
MemFree(subject_seq_start);
2144
RPSequenceFree(rpseq);
2147
search->sbp->posMatrix = NULL;
2148
search->wfp->lookup->mod_lt = NULL;
2149
search->wfp->lookup->mod_lookup_table_memory = NULL;
1316
2155
SeqAlignPtr RPSBlastSearch (BlastSearchBlkPtr search,
1317
2156
BioseqPtr query_bsp, RPSInfoPtr rpsinfo)