73 BOOST_REQUIRE(OIDS.size());
75 const int k_num_hsps_start = 12;
82 hsp_list->
oid = OIDS[0];
83 hsp_list->
hspcnt = k_num_hsps_start;
85 hsp_list->
hsp_max = k_num_hsps_start;
98 BOOST_REQUIRE(writer_info ==
NULL);
105 const int query_offset[k_num_hsps_start] =
106 { 0, 3864, 3254, 1828, 2189, 795,
107 607, 1780, 1363, 2751, 3599, 242 };
108 const int query_end[k_num_hsps_start] =
109 { 307, 4287, 3556, 2058, 2269, 914,
110 741, 1821, 1451, 2810, 3631, 285 };
111 const int subject_offset[k_num_hsps_start] =
112 { 1, 2723, 2267, 1028, 1292, 634,
113 501, 925, 1195, 1795, 477, 1233 };
114 const int subject_end[k_num_hsps_start] =
115 { 321, 3171, 2537, 1243, 1371, 749,
116 618, 966, 1286, 1869, 509, 1276 };
117 const int score[k_num_hsps_start] =
118 { 370, 319, 139, 120, 89, 84,
119 75, 70, 69, 60, 47, 43 };
120 const int query_gapped_start[k_num_hsps_start] =
121 { 47, 4181, 3286, 2034, 2228, 871,
122 632, 1798, 1383, 2759, 3606, 259 };
123 const int subject_gapped_start[k_num_hsps_start] =
124 { 48, 3073, 2299, 1219, 1330, 709,
125 526, 943, 1215, 1803, 484, 1250 };
127 for (
int index=0; index<k_num_hsps_start; index++) {
136 h1->
score = score[index];
158 BOOST_REQUIRE(OIDS.size());
160 const int k_num_hsps_start = 1;
165 hsp_list->
oid = OIDS.front();
166 hsp_list->
hspcnt = k_num_hsps_start;
168 hsp_list->
hsp_max = k_num_hsps_start;
182 BOOST_REQUIRE(writer_info ==
NULL);
189 const int query_offset[k_num_hsps_start] = { 0 };
190 const int query_end[k_num_hsps_start] = { k_seq_length - 1 };
191 const int subject_offset[k_num_hsps_start] = { 0 };
192 const int subject_end[k_num_hsps_start] = { k_seq_length - 1 };
193 const int score[k_num_hsps_start] = { 0 };
194 const int query_gapped_start[k_num_hsps_start] = { 0 };
195 const int subject_gapped_start[k_num_hsps_start] = { 0 };
197 for (
int index=0; index<k_num_hsps_start; index++) {
206 h1->
score = score[index];
226 if((**align).CanGetExt() && (**align).GetExt().size() > 0)
233 for(CUser_object::TData::const_iterator fit = fields.begin(); fit != fields.end(); ++fit)
238 const vector< CStringUTF8 >& giStrings = field.
GetData().
GetStrs();
239 ITERATE(vector< CStringUTF8 >,
str, giStrings) {
265 subject_seqdb = query_seqdb;
282 hsps(x_GetSampleHspStream(opts, *subject_seqdb));
289 BOOST_REQUIRE(subject_seqdb.
NotEmpty());
297 BOOST_REQUIRE_EQUAL(0, (
int)v[0].GetErrors().
size());
309 x_FindUsedGis(*rset[0].GetSeqAlign(), use_these);
311 BOOST_REQUIRE(use_these.
empty());
328 subject_seqdb = query_seqdb;
344 hsps(x_GetSampleHspStream(opts, *subject_seqdb));
351 BOOST_REQUIRE(subject_seqdb.
NotEmpty());
367 const string kPssmFile(
"data/pssm_zero_fratios.asn");
369 TestUtil::ReadObject<CPssmWithParameters>(kPssmFile);
387 hsps(x_GetSelfHitHspStream(opts, *subject_seqdb,
query));
398 BOOST_REQUIRE_EQUAL(0, (
int)v[0].GetErrors().
size());
401 BOOST_REQUIRE_EQUAL(2, (
int)qm.size());
403 const char* msg =
"Frequency ratios for PSSM are all zeros";
404 BOOST_REQUIRE(qm.front()->GetMessage().find(msg) != string::npos);
415 x_FindUsedGis(*rset[0].GetSeqAlign(), use_these);
417 BOOST_REQUIRE_EQUAL((
int)use_these.
size(), 1);
419 BOOST_REQUIRE(*(use_these.
begin()) ==
"seqid:EAL40459.3");
void Blast_HSPListSortByScore(BlastHSPList *hsp_list)
Sort the HSPs in an HSP list by score.
BlastHSPWriter * BlastHSPWriterNew(BlastHSPWriterInfo **writer_info, BlastQueryInfo *query_info, BLAST_SequenceBlk *query)
A generic function to create writer.
Declaration of ADT to save and retrieve lists of HSPs in the BLAST engine.
int BlastHSPStreamWrite(BlastHSPStream *hsp_stream, BlastHSPList **hsp_list)
Invokes the user-specified write function for this BlastHSPStream implementation.
BlastHSPStream * BlastHSPStreamFree(BlastHSPStream *hsp_stream)
Frees the BlastHSPStream structure by invoking the destructor function set by the user-defined constr...
BlastHSPStream * BlastHSPStreamNew(EBlastProgramType program, const BlastExtensionOptions *extn_opts, Boolean sort_on_read, Int4 num_queries, BlastHSPWriter *writer)
Initialize the HSP stream.
Defines interface for retrieving sequence identifiers.
@ eBlastp
Protein-Protein.
Encapsulates ALL the BLAST algorithm's options.
Wrapper class for BlastSeqSrc .
Factory for CLocalSearch.
NCBI C++ Object Manager dependant implementation of IQueryFactory.
Search Results for All Queries.
int GetSeqLength(int oid) const
Returns the sequence length in base pairs or residues.
void SeqidToOids(const CSeq_id &seqid, vector< int > &oids) const
Translate a Seq-id to a list of OIDs.
static CTestObjMgr & Instance()
CRef< CStructWrapper< BlastHSPStream > > x_GetSelfHitHspStream(CRef< CBlastOptions > opts, CSeqDB &db, CSeq_id &sid)
CRef< CStructWrapper< BlastHSPStream > > x_GetSampleHspStream(CRef< CBlastOptions > opts, CSeqDB &db)
CSearchResultSet x_Traceback(CSeqDBGiList *gi_list)
void x_FindUsedGis(const CSeq_align_set &aset, set< string > &used)
Class for the messages for an individual query sequence.
iterator_bool insert(const value_type &val)
const_iterator begin() const
static const char * str(char *buf, int n)
BlastHitSavingOptions * GetHitSaveOpts() const
Returns BlastHitSavingOptions for eLocal objects, NULL for eRemote.
BlastSeqSrc * Get() const
BlastExtensionOptions * GetExtnOpts() const
Returns BlastExtensionOptions for eLocal objects, NULL for eRemote.
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.
CStructWrapper< TData > * WrapStruct(TData *obj, TData *(*del)(TData *))
Auxiliary function to create a CStructWrapper for a pointer to an object.
CRef< CSearchResultSet > Run()
Run the traceback search.
static CBlastOptionsHandle * Create(EProgram program, EAPILocality locality=CBlastOptions::eLocal)
Creates an options handle object configured with default options for the requested program,...
BlastHSPResults * RunSimple()
Runs the traceback but only returns the HSP's and not the Seq-Align.
EBlastProgramType GetProgramType() const
Returns the CORE BLAST notion of program type.
const CBlastOptions & GetOptions() const
Return the object which this object is a handle for.
BlastScoringOptions * GetScoringOpts() const
Returns BlastScoringOptions for eLocal objects, NULL for eRemote.
size_type GetNumResults() const
Return the number of results contained by this object.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
static bool PreferAccessionOverGi(void)
Check if the option to prefer accession.version over GI is enabled (SeqId/PreferAccessionOverGi or SE...
void Reset(void)
Reset reference object.
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty – pointing to an object and has a non-null value.
TObjectType * GetPointerOrNull(void) THROWS_NONE
Get pointer value.
bool IsSetData(void) const
the object itself Check if a value has been assigned to Data data member.
bool IsStr(void) const
Check if variant Str is selected.
bool IsSetType(void) const
type of object within class Check if a value has been assigned to Type data member.
const TStrs & GetStrs(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
bool IsSetLabel(void) const
field label Check if a value has been assigned to Label data member.
const TStr & GetStr(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
const TLabel & GetLabel(void) const
Get the Label member data.
const TType & GetType(void) const
Get the Type member data.
vector< CRef< CUser_field > > TData
list< CRef< CSeq_align > > Tdata
const Tdata & Get(void) const
Get the member data.
Implementation of a number of BlastHSPWriters to save hits from a BLAST search, and subsequently retu...
BlastHSPCollectorParams * BlastHSPCollectorParamsNew(const BlastHitSavingOptions *hit_options, Int4 compositionBasedStats, Boolean gapped_calculation)
Sets up parameter set for use by collector.
BlastHSPWriterInfo * BlastHSPCollectorInfoNew(BlastHSPCollectorParams *params)
WriterInfo to create a default writer: the collecter.
Implementation of the uniform BLAST search interface for searching locally installed BLAST databases.
const struct ncbi::grid::netcache::search::fields::SIZE size
Magic spell ;-) needed for some weird compilers... very empiric.
#define FALSE
bool replacment for C indicating false.
NOTE: This file contains work in progress and the APIs are likely to change, please do not rely on th...
Defines BLAST database access classes.
Defines a concrete strategy for the IBlastSeqInfoSrc interface for sequence identifiers retrieval fro...
Implementation of the BlastSeqSrc interface using the C++ BLAST databases API.
vector< SSeqLoc > TSeqLocVector
Vector of sequence locations.
Int4 compositionBasedStats
mode of compositional adjustment to use; if zero then compositional adjustment is not used
The structure to hold all HSPs for a given sequence after the gapped alignment.
Boolean do_not_reallocate
Is reallocation of the hsp_array allowed?
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.
Int4 hsp_max
The maximal number of HSPs allowed to be saved.
Int4 allocated
The allocated size of the hsp_array.
The structure to contain all BLAST results, for multiple queries.
BlastHitList ** hitlist_array
Array of results for individual query sequences.
Int4 num_queries
Number of query sequences.
Default implementation of BlastHSPStream.
A wrap of data structure used to create a writer.
ADT definition of BlastHSPWriter.
Structure holding all information about an HSP.
BlastSeg query
Query sequence info.
BlastSeg subject
Subject sequence info.
Int4 score
This HSP's raw score.
The structure to contain all BLAST results for one query sequence.
Int4 hsplist_count
Filled size of the HSP lists array.
Boolean gapped_calculation
gap-free search if FALSE
Int4 gapped_start
Where the gapped extension started.
Utility stuff for more convenient using of Boost.Test library.
NOTE: This file contains work in progress and the APIs are likely to change, please do not rely on th...
BOOST_AUTO_TEST_CASE(Traceback)
voidp calloc(uInt items, uInt size)