69 const char* fname =
"data/ss.asn";
74 BOOST_REQUIRE(import_strat.
GetService() ==
"megablast");
75 BOOST_REQUIRE(import_strat.
GetProgram() ==
"blastn");
76 BOOST_REQUIRE(import_strat.
GetTask() ==
"megablast");
80 BOOST_REQUIRE(
query->IsPssm() ==
false);
81 BOOST_REQUIRE(
query->IsSeq_loc_list() ==
true);
84 BOOST_REQUIRE_EQUAL(opts_handle->GetHitlistSize(), 500);
85 BOOST_REQUIRE_EQUAL(opts_handle->GetCullingLimit(), 0);
93 const char* fname =
"data/ss.blastp.asn";
98 BOOST_REQUIRE(import_strat.
GetService() ==
"plain");
99 BOOST_REQUIRE(import_strat.
GetProgram() ==
"blastp");
102 BOOST_REQUIRE(
query->IsPssm() ==
false);
103 BOOST_REQUIRE(
query->IsSeq_loc_list() ==
false);
105 list<CRef<CSeq_entry> > seq_entry = bss.
GetSeq_set();
106 BOOST_REQUIRE(seq_entry.front()->GetSeq().GetLength() == 232);
109 BOOST_REQUIRE(
subject->IsDatabase() ==
true);
110 BOOST_REQUIRE(
subject->GetDatabase() ==
"refseq_protein");
113 BOOST_REQUIRE_EQUAL(opts_handle->GetHitlistSize(), 500);
114 BOOST_REQUIRE_EQUAL(opts_handle->GetCullingLimit(), 0);
117 BOOST_REQUIRE_EQUAL(3, blastp_opts->
GetWordSize());
123 const char* fname =
"data/ss.bl2seq.asn";
128 BOOST_REQUIRE(import_strat.
GetService() ==
"plain");
129 BOOST_REQUIRE(import_strat.
GetProgram() ==
"blastn");
130 BOOST_REQUIRE(import_strat.
GetTask() ==
"blastn");
133 BOOST_REQUIRE(
query->IsPssm() ==
false);
134 BOOST_REQUIRE(
query->IsSeq_loc_list() ==
false);
136 list<CRef<CSeq_entry> > seq_entry = bss.
GetSeq_set();
137 BOOST_REQUIRE(seq_entry.front()->GetSeq().GetLength() == 2772);
140 BOOST_REQUIRE(
subject->IsDatabase() ==
false);
141 list<CRef< CBioseq> > subject_list =
subject->GetSequences();
142 BOOST_REQUIRE(subject_list.size() == 1);
143 BOOST_REQUIRE(subject_list.front()->GetLength() == 9180);
146 BOOST_REQUIRE_EQUAL(opts_handle->GetHitlistSize(), 500);
147 BOOST_REQUIRE_EQUAL(opts_handle->GetCullingLimit(), 0);
155 const char* fname =
"data/webpsi.1stround.ss.asn";
159 BOOST_REQUIRE_EQUAL(import_strat.
GetTask(),
"psiblast");
160 BOOST_REQUIRE_EQUAL(import_strat.
GetService(),
"plain");
161 BOOST_REQUIRE_EQUAL(import_strat.
GetProgram(),
"blastp");
164 BOOST_REQUIRE(
query->IsPssm() ==
false);
165 BOOST_REQUIRE(
query->IsSeq_loc_list() ==
false);
167 list<CRef<CSeq_entry> > seq_entry = bss.
GetSeq_set();
168 BOOST_REQUIRE(seq_entry.front()->GetSeq().GetLength() == 320);
171 BOOST_REQUIRE_EQUAL(
subject->IsDatabase(),
true);
172 BOOST_REQUIRE_EQUAL(
subject->GetDatabase(),
"nr");
179 BOOST_REQUIRE_EQUAL(opts_handle->GetHitlistSize(), 500);
180 BOOST_REQUIRE_EQUAL(opts_handle->GetWindowSize(), 40);
181 BOOST_REQUIRE_EQUAL(opts_handle->GetMaskAtHash(),
false);
182 BOOST_REQUIRE_EQUAL(opts_handle->GetGappedMode(),
true);
184 BOOST_REQUIRE(psi_opts !=
NULL);
193 const char* fname =
"data/webpsi.2ndround.ss.asn";
197 BOOST_REQUIRE_EQUAL(import_strat.
GetTask(),
"psiblast");
198 BOOST_REQUIRE_EQUAL(import_strat.
GetService(),
"psi");
199 BOOST_REQUIRE_EQUAL(import_strat.
GetProgram(),
"blastp");
202 BOOST_REQUIRE(
query->IsPssm() ==
true);
203 BOOST_REQUIRE(
query->IsSeq_loc_list() ==
false);
204 BOOST_REQUIRE(
query->IsBioseq_set() ==
false);
206 BOOST_REQUIRE_EQUAL(pssm.
HasQuery(),
true);
208 const TSeqPos kQueryLength(320);
213 BOOST_REQUIRE_EQUAL(
subject->IsDatabase(),
true);
214 BOOST_REQUIRE_EQUAL(
subject->GetDatabase(),
"nr");
221 BOOST_REQUIRE_EQUAL(opts_handle->GetHitlistSize(), 500);
222 BOOST_REQUIRE_EQUAL(opts_handle->GetWindowSize(), 40);
223 BOOST_REQUIRE_EQUAL(opts_handle->GetMaskAtHash(),
false);
224 BOOST_REQUIRE_EQUAL(opts_handle->GetGappedMode(),
true);
226 BOOST_REQUIRE(psi_opts !=
NULL);
238 const char* fname =
"data/phi.ss.asn";
242 BOOST_REQUIRE_EQUAL(import_strat.
GetTask(),
"phiblastp");
243 BOOST_REQUIRE_EQUAL(import_strat.
GetService(),
"plain");
244 BOOST_REQUIRE_EQUAL(import_strat.
GetProgram(),
"blastp");
247 BOOST_REQUIRE(
query->IsPssm() ==
false);
248 BOOST_REQUIRE(
query->IsSeq_loc_list() ==
false);
250 list<CRef<CSeq_entry> > seq_entry = bss.
GetSeq_set();
251 BOOST_REQUIRE(seq_entry.front()->GetSeq().GetLength() == 549);
254 BOOST_REQUIRE_EQUAL(
subject->IsDatabase(),
true);
255 BOOST_REQUIRE_EQUAL(
subject->GetDatabase(),
"ecoli");
262 BOOST_REQUIRE_EQUAL(opts_handle->GetHitlistSize(), 500);
263 BOOST_REQUIRE_EQUAL(opts_handle->GetWindowSize(), 40);
264 BOOST_REQUIRE_EQUAL(opts_handle->GetMaskAtHash(),
false);
265 BOOST_REQUIRE_EQUAL(opts_handle->GetGappedMode(),
true);
266 BOOST_REQUIRE_EQUAL(opts_handle->GetOptions().GetInclusionThreshold(), 0.002);
267 BOOST_REQUIRE_EQUAL(opts_handle->GetOptions().GetPseudoCount(), 0);
269 BOOST_REQUIRE(psi_opts !=
NULL);
273 BOOST_REQUIRE_EQUAL(psi_opts->
GetPHIPattern(),
"[GA]xxxxGK[ST]");
288 const string kDbName(
"nt");
300 bool found_query_range =
false;
307 vector<string> param_names;
314 ITERATE(vector<string>, pname, param_names) {
317 found_query_range =
true;
322 BOOST_REQUIRE(found_query_range ==
false);
327 ITERATE(vector<string>, pname, param_names) {
330 found_query_range =
true;
335 BOOST_REQUIRE(found_query_range ==
false);
351 const string kDbName(
"nt");
363 bool found_query_range =
false;
370 vector<string> param_names;
377 ITERATE(vector<string>, pname, param_names) {
380 BOOST_REQUIRE(p->CanGetValue());
381 found_query_range =
true;
383 BOOST_REQUIRE_EQUAL((
int)query_range.
GetFrom(),
384 (
int)p->GetValue().GetInteger());
387 BOOST_REQUIRE_EQUAL((
int)query_range.
GetTo(),
388 (
int)p->GetValue().GetInteger());
393 BOOST_REQUIRE(found_query_range ==
true);
395 found_query_range =
false;
399 ITERATE(vector<string>, pname, param_names) {
402 found_query_range =
true;
407 BOOST_REQUIRE(found_query_range ==
false);
419 ifstream
in(
"data/seq_entry_lcl_id.asn");
429 const string kDbName(
"nt");
446 BOOST_REQUIRE_EQUAL(query_loc.size(), b4_queries.
GetNumQueries());
448 BOOST_REQUIRE( !b4_queries.
IsPssm() );
461 typedef pair<int, int> TGiLength;
462 vector<TGiLength> gis;
463 gis.push_back(TGiLength(555, 624));
464 gis.push_back(TGiLength(556, 310));
465 ifstream
in(
"data/seq_entry_gis.asn");
468 ITERATE(vector<TGiLength>, gi, gis) {
474 query_loc.push_back(
SSeqLoc(sl, scope));
479 const string kDbName(
"nt");
497 BOOST_REQUIRE_EQUAL(query_loc.size(), b4_queries.
GetNumQueries());
499 BOOST_REQUIRE( !b4_queries.
IsPssm() );
532 const char* fname =
"data/ss.filter.asn";
536 BOOST_REQUIRE_EQUAL(import_strat.
GetService(),
"megablast");
537 BOOST_REQUIRE_EQUAL(import_strat.
GetProgram(),
"blastn");
545 BOOST_REQUIRE_EQUAL(opts_handle->GetMaskAtHash(),
true);
546 BOOST_REQUIRE_EQUAL(opts_handle->GetGappedMode(),
true);
556 const string kDbName(
"data/nt.41646578");
561 const string mask_str (
"unit_test_mask");
579 BOOST_REQUIRE(p1->GetValue().GetString()== mask_str);
User-defined methods of the data storage class.
User-defined methods of the data storage class.
Declares the CBlastAdvancedProteinOptionsHandle class.
Declares the CBlastNucleotideOptionsHandle class.
Declares the CBlastProteinOptionsHandle class.
@ eBlastn
Nucl-Nucl (traditional blastn)
@ eBlastp
Protein-Protein.
const CSeq_id * GetFirstId() const
TSeqPos GetLength(void) const
const string & GetName() const
Get field name (key).
CRef< CBlast4_parameter > GetParamByName(const string name) const
Returns Blast4_parameter with specified name.
size_t GetNumQueries() const
Retrieve the number of queries in this object.
CBlast4_queue_search_request –.
Handle to the Advanced BLASTP options.
Defines BLAST error codes (user errors included)
Handle to the nucleotide-nucleotide options to the BLAST algorithm.
Encapsulates ALL the BLAST algorithm's options.
@ eRemote
To be used when running BLAST remotely.
virtual void GetRemoteProgramAndService_Blast3(string &p, string &s) const
Get the program and service name for remote blast.
Class to return parts of the CBlast4_request, or data associated with a CBlast4_request,...
NCBI C++ Object Manager dependant implementation of IQueryFactory.
Handle to the protein PHI BLAST options.
Handle to the protein-protein options to the BLAST algorithm.
const CSeq_entry & GetQuery() const
Retrieve the query sequence.
bool HasQuery() const
Has this PSSM a query in it?
SIZE_TYPE GetQueryLength() const
Return the query length or 0 if no query is available.
static CTestObjMgr & Instance()
string GetDBFilteringKey()
The DB filter key.
string GetService() const
Fetches service, such as psiblast, plain, megablast.
string GetTask()
Fetches task, such as "megablast", "blastn", etc.
double GetInclusionThreshold() const
Returns InclusionThreshold.
int GetMatchReward() const
Returns MatchReward.
objects::CBlast4_parameters * GetWebFormatOptions()
Options for controlling formatting (psi blast iteration number also).
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.
CRef< objects::CBlast4_request > GetSearchStrategy(void)
const char * GetPHIPattern() const
Retrieves the pattern string option.
string GetProgram() const
Fetches program, one of blastn, blastp, blastx, tblastn, tblastx.
CRef< objects::CBlast4_request > ExtractBlast4Request(CNcbiIstream &in)
Extract a Blast4-request (a.k.a.
const char * GetMatrixName() const
Returns MatrixName.
int GetGapExtensionCost() const
Returns GapExtensionCost.
int GetWordSize() const
Returns WordSize.
int GetDBFilteringID()
The DB filter ID.
CRef< objects::CBlast4_queries > GetQueries()
The queries either as Bioseq, seqloc, or pssm.
unsigned int GetPsiNumOfIterations()
Get number of iteration for psi blast, return 0 if num of iterations not available.
objects::CBlast4_parameters * GetAlgoOptions()
Options specific to blast searches (e.g, threshold, expect value).
CRef< objects::CBlast4_subject > GetSubject()
Returns the target sequences.
int GetGapOpeningCost() const
Returns GapOpeningCost.
objects::CBlast4_parameters * GetProgramOptions()
Options for controlling program execution and database filtering.
int GetMismatchPenalty() const
Returns MismatchPenalty.
void SetFilteringAlgorithm(int filt_algorithm_id)
Temporary fix for backwards compatibility with other 6.0 SCs.
int GetPseudoCount() const
Returns PseudoCount.
ESubjectMaskingType GetSubjectMaskingType()
Get Subject Masking Type.
CRef< blast::CBlastOptionsHandle > GetOptionsHandle()
Builds and returns the OptionsHandle.
@ eBlastDbIsNucleotide
nucleotide
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define MSerial_AsnText
I/O stream manipulators –.
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
CSeq_entry_Handle AddTopLevelSeqEntry(CSeq_entry &top_entry, TPriority pri=kPriority_Default, EExist action=eExist_Default)
Add seq_entry, default priority is higher than for defaults or loaders Add object to the score with p...
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty – pointing to an object and has a non-null value.
const TSubject & GetSubject(void) const
Get the Subject member data.
bool IsSeq_loc_list(void) const
Check if variant Seq_loc_list is selected.
const TService & GetService(void) const
Get the Service member data.
const TDatabase & GetDatabase(void) const
Get the variant data.
bool IsPssm(void) const
Check if variant Pssm is selected.
bool CanGetQueries(void) const
Check if it is safe to call GetQueries method.
bool IsQueue_search(void) const
Check if variant Queue_search is selected.
const TQueue_search & GetQueue_search(void) const
Get the variant data.
bool CanGetSubject(void) const
Check if it is safe to call GetSubject method.
bool IsBioseq_set(void) const
Check if variant Bioseq_set is selected.
bool CanGetProgram_options(void) const
Check if it is safe to call GetProgram_options method.
const TProgram_options & GetProgram_options(void) const
Get the Program_options member data.
const TQueries & GetQueries(void) const
Get the Queries member data.
const TAlgorithm_options & GetAlgorithm_options(void) const
Get the Algorithm_options member data.
const TBody & GetBody(void) const
Get the Body member data.
const TProgram & GetProgram(void) const
Get the Program member data.
bool CanGetAlgorithm_options(void) const
Check if it is safe to call GetAlgorithm_options method.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
const TPssm & GetPssm(void) const
Get the Pssm member data.
@ e_Gi
GenInfo Integrated Database.
const TSeq & GetSeq(void) const
Get the variant data.
bool IsSeq(void) const
Check if variant Seq is selected.
const TSeq_set & GetSeq_set(void) const
Get the Seq_set member data.
@ eBlastOpt_DbFilteringAlgorithmKey
@ eBlastOpt_RequiredStart
@ eBlastOpt_SubjectMaskingType
Magic spell ;-) needed for some weird compilers... very empiric.
int strcmp(const char *str1, const char *str2)
std::istream & in(std::istream &in_, double &x_)
NOTE: This file contains work in progress and the APIs are likely to change, please do not rely on th...
Declares the CPHIBlastProtOptionsHandle class.
BOOST_AUTO_TEST_SUITE(psiblast_iteration)
Declares the CPSIBlastOptionsHandle class.
Declares the CRemoteBlast class.
Declares the CImportStrategy and CExportStrategy.
BOOST_AUTO_TEST_CASE(emptyInput)
vector< SSeqLoc > TSeqLocVector
Vector of sequence locations.
Structure to represent a single sequence to be fed to BLAST.
Utility stuff for more convenient using of Boost.Test library.