;
60 const size_tnum_hsps_total = 12;
61 const size_tnum_hsps_plus = 4;
62 const intscores[num_hsps_total] =
63{62, 51, 49, 44, 44, 44, 43, 43, 43, 48, 45, 46};
79 const intq_offsets[num_hsps_total] =
80{3244, 1045, 3133, 9204, 3163, 8179, 1090, 1328, 2300, 832, 6776, 3633};
81 const ints_offsets[num_hsps_total] =
82{700, 662, 812, 1385, 146, 538, 930, 1340, 1373, 1917, 1467, 966};
83 const intq_ends[num_hsps_total] =
84{3430, 1159, 3283, 9300, 3328, 8287, 1174, 1388, 2408, 937, 6968, 3759};
85 const ints_ends[num_hsps_total] =
86{761, 699, 861, 1418, 205, 564, 958, 1360, 1403, 1952, 1531, 1007};
87 const doubleevalues[num_hsps_total] =
88{0.0546847, 1.0657, 2.00126, 7.04787, 7.83533, 8.12416, 9.05612, 9.84108, 9.90728, 2.53047, 5.47761, 3.70474};
91 size_tnum_hsps =
results.Size();
99BOOST_REQUIRE_EQUAL(num_hsps_plus, num_hsps);
102BOOST_REQUIRE_EQUAL(num_hsps_total - num_hsps_plus, num_hsps);
105BOOST_REQUIRE_EQUAL(num_hsps_total, num_hsps);
110 size_talign_num = 0;
117 constlist<CRef<CStd_seg> >& stdseg = hitlist.
GetSegs().
GetStd();
119stdseg.front()->GetLoc().front()->GetInt().GetStrand();
124 while(align_num < num_hsps_total &&
125strands[align_num] != curr_strand)
127BOOST_REQUIRE(align_num < num_hsps_total);
133 const CScore& curr_score = **sitr;
134 if(curr_score.
GetId().
GetStr() ==
"e_value") {
135BOOST_REQUIRE_CLOSE(evalues[align_num],
138 else if(curr_score.
GetId().
GetStr() ==
"score") {
139BOOST_REQUIRE_EQUAL(scores[align_num],
148 intoff1 = locs[0]->GetInt().GetFrom();
149 intoff2 = locs[1]->GetInt().GetFrom();
150BOOST_REQUIRE_EQUAL(q_offsets[align_num], off1);
151BOOST_REQUIRE_EQUAL(s_offsets[align_num], off2);
155 if(seqloc[0]->IsEmpty()) {
156off2 += seqloc[1]->GetInt().GetTo() -
157seqloc[1]->GetInt().GetFrom() + 1;
159 else if(seqloc[1]->IsEmpty()) {
160off1 += seqloc[0]->GetInt().GetTo() -
161seqloc[0]->GetInt().GetFrom() + 1;
164off1 += seqloc[0]->GetInt().GetTo() -
165seqloc[0]->GetInt().GetFrom() + 1;
166off2 += seqloc[1]->GetInt().GetTo() -
167seqloc[1]->GetInt().GetFrom() + 1;
170BOOST_REQUIRE_EQUAL(q_ends[align_num], off1);
171BOOST_REQUIRE_EQUAL(s_ends[align_num], off2);
180 #if defined(WORDS_BIGENDIAN) || defined(IS_BIG_ENDIAN) 181m_DbName =
"data/rpstest_be";
183m_DbName =
"data/rpstest_le";
196unique_ptr<SSeqLoc>
query(
199query_v.push_back(*
query);
217unique_ptr<SSeqLoc>
query(
220query_v.push_back(*
query);
234BOOST_REQUIRE_EQUAL(0, off1);
235BOOST_REQUIRE_EQUAL(0, off2);
238BOOST_REQUIRE_EQUAL(1016, (
int)denseg.
GetLens()[0]);
253 const intkNumHits = 2;
254 const intkOids[kNumHits] = { 3, 1 };
255 const intkNumHsps[kNumHits] = { 2, 3 };
256 const intkTotalHsps = 5;
257 const intkScores[kTotalHsps] = { 7458, 6898, 7055, 6997, 6542};
258 const intkLengths[kTotalHsps] = { 36, 21, 15, 15, 10};
261query_loc->
SetWhole().SetGi(kQueryGi);
265query_v.push_back(
SSeqLoc(query_loc, query_scope));
279BOOST_REQUIRE_EQUAL(1,
results->num_queries);
280BOOST_REQUIRE(
results->hitlist_array[0]);
281BOOST_REQUIRE_EQUAL(kNumHits,
282 results->hitlist_array[0]->hsplist_count);
285 for(
intindex = 0; index < kNumHits; ++index) {
287 results->hitlist_array[0]->hsplist_array[index];
288BOOST_REQUIRE_EQUAL(kOids[index], hsp_list->
oid);
289BOOST_REQUIRE_EQUAL(kNumHsps[index], hsp_list->
hspcnt);
290 for(
intindex1 = 0; index1 < kNumHsps[index];
291++index1, ++hsp_index) {
293BOOST_REQUIRE_EQUAL(kScores[hsp_index], hsp->
score);
295BOOST_REQUIRE_EQUAL(kLengths[hsp_index],
299BOOST_REQUIRE_EQUAL(kTotalHsps, hsp_index);
307 string dbname=
"data/deltatest_nocbs";
309BOOST_REQUIRE(!freq_file.
Exists());
319query_v.push_back(*
query);
325BOOST_REQUIRE_THROW(
CLocalBlast(query_factory, opts, dbinfo),
User-defined methods of the data storage class.
Common definitions for protein and nucleotide lookup tables.
Declares the CBlastRPSOptionsHandle class.
Utility function to convert internal BLAST result structures into objects::CSeq_align_set objects.
@ eRPSBlast
protein-pssm (reverse-position-specific BLAST)
@ eRPSTblastn
nucleotide-pssm (RPS blast with translated query)
BOOST_AUTO_TEST_SUITE_END() static int s_GetSegmentFlags(const CBioseq &bioseq)
Defines BLAST error codes (user errors included)
Wrapper class for BlastHSPResults .
Search class to perform the preliminary stage of the BLAST search.
Handle to the rpsblast options to the BLAST algorithm.
Wrapper class for BlastSeqSrc .
Class to perform a BLAST search on local BLAST databases Note that PHI-BLAST can be run using this cl...
NCBI C++ Object Manager dependant implementation of IQueryFactory.
Handle to the options for translated nucleotide-RPS blast.
Search Results for All Queries.
static CTestObjMgr & Instance()
void SetCompositionBasedStats(bool mode)
Set composition based statistics mode.
CRef< SInternalData > Run()
Borrow the internal data and results results.
BlastSeqSrc * SeqDbBlastSeqSrcInit(const string &dbname, bool is_prot, Uint4 first_seq=0, Uint4 last_seq=0, Int4 mask_algo_id=-1, ESubjectMaskingType mask_type=eNoSubjMasking)
Initialize the sequence source structure.
CRef< CSearchResultSet > Run()
Executes the search.
static CBlastOptionsHandle * Create(EProgram program, EAPILocality locality=CBlastOptions::eLocal)
Creates an options handle object configured with default options for the requested program,...
CBlastOptions & SetOptions()
Returns a reference to the internal options class which this object is a handle for.
void SetFilterString(const char *f, bool clear=true)
Sets FilterString.
CRef< TBlastHSPStream > m_HspStream
HSP output of the preliminary stage goes here.
BlastHSPResults * ComputeBlastHSPResults(BlastHSPStream *stream, Uint4 max_num_hsps=0, bool *rm_hsps=NULL, vector< bool > *rm_hsps_info=NULL) const
Return HSPs in a structure other than the HSPStream? Provide conversion? How to combine this with CBl...
@ eBlastDbIsProtein
protein
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
virtual bool Exists(void) const
Check existence of file.
void AddDefaults(TPriority pri=kPriority_Default)
Add default data loaders from object manager.
TObjectType * GetNonNullPointer(void)
Get pointer value and throw a null pointer exception if pointer is null.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
const TStr & GetStr(void) const
Get the variant data.
const TDenseg & GetDenseg(void) const
Get the variant data.
vector< CRef< CSeq_loc > > TLoc
vector< CRef< CScore > > TScore
const TStarts & GetStarts(void) const
Get the Starts member data.
const TLens & GetLens(void) const
Get the Lens member data.
const TStd & GetStd(void) const
Get the variant data.
TInt GetInt(void) const
Get the variant data.
const TValue & GetValue(void) const
Get the Value member data.
bool IsStd(void) const
Check if variant Std is selected.
list< CRef< CSeq_align > > Tdata
const TScore & GetScore(void) const
Get the Score member data.
TReal GetReal(void) const
Get the variant data.
const TId & GetId(void) const
Get the Id member data.
const TSegs & GetSegs(void) const
Get the Segs member data.
ENa_strand
strand of nucleic acid
@ eNa_strand_both
in forward orientation
char * dbname(DBPROCESS *dbproc)
Get name of current database.
Main class to perform a BLAST search on the local machine.
Wrapper for all lookup tables used in BLAST.
void CheckForBlastSeqSrcErrors(const BlastSeqSrc *seqsrc)
Magic spell ;-) needed for some weird compilers... very empiric.
#define TRUE
bool replacment for C indicating true.
NOTE: This file contains work in progress and the APIs are likely to change, please do not rely on th...
void testNuclHitList(const CSeq_align_set &results, ENa_strand strand)
BOOST_AUTO_TEST_CASE(WholeSequenceMatch)
Declares the CRPSTBlastnOptionsHandle class.
Implementation of the BlastSeqSrc interface using the C++ BLAST databases API.
vector< SSeqLoc > TSeqLocVector
Vector of sequence locations.
The structure to hold all HSPs for a given sequence after the gapped alignment.
Int4 oid
The ordinal id of the subject sequence this HSP list is for.
Int4 hspcnt
Number of HSPs saved.
BlastHSP ** hsp_array
Array of pointers to individual HSPs.
Structure holding all information about an HSP.
BlastSeg query
Query sequence info.
Int4 score
This HSP's raw score.
Int4 offset
Start of hsp.
void NuclSearch(ENa_strand strand)
Structure to represent a single sequence to be fed to BLAST.
Utility stuff for more convenient using of Boost.Test library.
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