NCBI C++ ToolKit
psibl2seq_unit_test.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: psibl2seq_unit_test.cpp 91996 2020-12-17 15:27:17Z grichenk $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Author: Christiam Camacho
27  *
28  */
29 
30 /** @file psibl2seq-cppunit.cpp
31  * Unit test module for the PSI-BLAST 2 Sequences class
32  */
33 #include <ncbi_pch.hpp>
34 #include <corelib/test_boost.hpp>
35 #include <serial/iterator.hpp>
37 #include "psiblast_aux_priv.hpp" // for PsiBlastComputePssmScores
40 
41 // Object includes
49 
51 
52 #include "test_objmgr.hpp"
53 #include "blast_test_util.hpp" // needed to read datatool generated objects
54 //#include "psiblast_test_util.hpp" // needed for construction of PSSM
55 
56 // SeqAlign comparison includes
57 #include "seqalign_cmp.hpp"
58 #include "seqalign_set_convert.hpp"
59 
60 using namespace ncbi;
61 using namespace ncbi::objects;
62 using namespace ncbi::blast;
63 
65 public:
66 
69 
70  // Data members which store the subject(s)
71 
72  /// must be initialized with one of the two data members below
74 
75  /// Contains a single Bioseq
77 
78  /// Contains a Bioseq-set with two Bioseqs, gi 7450545 and gi 129295
80 
82 
84  m_OptHandle.Reset(new CPSIBlastOptionsHandle);
85 
86  x_ReadPssmFromFile();
87  PsiBlastComputePssmScores(m_Pssm, m_OptHandle->GetOptions());
88  BOOST_REQUIRE(m_Pssm->GetPssm().GetFinalData().CanGetScores());
89 
90  x_ReadSeqEntriesFromFile();
91 
92  CConstRef<CBioseq> bioseq(&m_SeqEntry->GetSeq());
93  x_SetupSubject(bioseq);
94  }
95 
97  m_Scope.Reset();
98  m_Pssm.Reset();
99  m_OptHandle.Reset();
100  m_SeqEntry.Reset();
101  m_SeqSet.Reset();
102  m_Subject.Reset();
103  }
104 
105  // Auxiliary private functions go below...
106 
108  TSeqLocVector subjects;
110  CConstRef<CSeq_id> sid = (m_Scope->AddBioseq(*bioseq)).GetSeqId();
111  CRef<CSeq_loc> sl(new CSeq_loc());
112  sl->SetWhole();
113  sl->SetId(*sid);
114  SSeqLoc ssl(*sl, *m_Scope);
115  subjects.push_back(ssl);
116  m_Subject.Reset(new CObjMgr_QueryFactory(subjects));
117  }
118 
120  TSeqLocVector subjects;
123  for (; itr; ++itr) {
124  CConstRef<CSeq_id> sid = (m_Scope->AddBioseq(*itr)).GetSeqId();
125  CRef<CSeq_loc> sl(new CSeq_loc());
126  sl->SetWhole();
127  sl->SetId(*sid);
128  SSeqLoc ssl(*sl, *m_Scope);
129  subjects.push_back(ssl);
130  }
131  m_Subject.Reset(new CObjMgr_QueryFactory(subjects));
132  }
133 
134  // Note that the scoremat stored in the file does not have scores
136  const string kPssmFile("data/pssm_freq_ratios.asn");
137  m_Pssm = TestUtil::ReadObject<CPssmWithParameters>(kPssmFile);
138  BOOST_REQUIRE(m_Pssm->GetPssm().CanGetQuery());
139  BOOST_REQUIRE(m_Pssm->GetPssm().CanGetIntermediateData());
140  BOOST_REQUIRE(!m_Pssm->GetPssm().CanGetFinalData());
141  }
142 
144  const string kSeqEntryFile("data/7450545.seqentry.asn");
145  m_SeqEntry = TestUtil::ReadObject<CSeq_entry>(kSeqEntryFile);
146 
147 
148  m_SeqSet.Reset(new CSeq_entry);
149  m_SeqSet->SetSet().SetSeq_set().push_back(m_SeqEntry);
150  BOOST_REQUIRE(m_Pssm &&
151  m_Pssm->CanGetPssm() &&
152  m_Pssm->GetPssm().CanGetQuery());
153  CRef<CSeq_entry> second_bioseq(&m_Pssm->SetPssm().SetQuery());
154  m_SeqSet->SetSet().SetSeq_set().push_back(second_bioseq);
155 
156  }
157 
159  BOOST_REQUIRE_EQUAL(false, sa->IsSetSegs());
160  }
161 
163  BOOST_REQUIRE(sa->GetSegs().IsDenseg());
164 
165  const CDense_seg & denseg = sa->GetSegs().GetDenseg();
166 
167  if (hsp_num == 1)
168  {
169  // Validate the first HSP
170  pair<TSeqRange, TSeqRange> first_hsp =
171  make_pair(TSeqRange(24, 29), TSeqRange(245, 250));
172  TSeqRange hsp1_query = denseg.GetSeqRange(0);
173  TSeqRange hsp1_subj = denseg.GetSeqRange(1);
174  BOOST_REQUIRE_EQUAL(first_hsp.first.GetFrom(), hsp1_query.GetFrom());
175  BOOST_REQUIRE_EQUAL(first_hsp.first.GetTo(), hsp1_query.GetTo());
176  BOOST_REQUIRE_EQUAL(first_hsp.second.GetFrom(), hsp1_subj.GetFrom());
177  BOOST_REQUIRE_EQUAL(first_hsp.second.GetTo(), hsp1_subj.GetTo());
178  }
179  else if (hsp_num == 2)
180  {
181  // Validate the second HSP
182  const pair<TSeqRange, TSeqRange> second_hsp =
183  make_pair(TSeqRange(74, 86), TSeqRange(108, 120));
184  TSeqRange hsp2_query = denseg.GetSeqRange(0);
185  TSeqRange hsp2_subj = denseg.GetSeqRange(1);
186  BOOST_REQUIRE_EQUAL(second_hsp.first.GetFrom(), hsp2_query.GetFrom());
187  BOOST_REQUIRE_EQUAL(second_hsp.first.GetTo(), hsp2_query.GetTo());
188  BOOST_REQUIRE_EQUAL(second_hsp.second.GetFrom(), hsp2_subj.GetFrom());
189  BOOST_REQUIRE_EQUAL(second_hsp.second.GetTo(), hsp2_subj.GetTo());
190  }
191 
192  }
193 
195  BOOST_REQUIRE(sa->GetSegs().IsDenseg());
196 
197  const CDense_seg & denseg = sa->GetSegs().GetDenseg();
198 
199  // Validate the first (and only) HSP, which is a self hit
200  const TSeqRange hsp(0, 231);
201  TSeqRange hsp1_query = denseg.GetSeqRange(0);
202  TSeqRange hsp1_subj = denseg.GetSeqRange(1);
203  BOOST_REQUIRE_EQUAL(hsp.GetFrom(), hsp1_query.GetFrom());
204  BOOST_REQUIRE_EQUAL(hsp.GetTo(), hsp1_query.GetTo());
205  BOOST_REQUIRE_EQUAL(hsp.GetFrom(), hsp1_subj.GetFrom());
206  BOOST_REQUIRE_EQUAL(hsp.GetTo(), hsp1_subj.GetTo());
207 
208  }
209 
210 };
211 
212 BOOST_FIXTURE_TEST_SUITE(psibl2seq, CPsiBl2SeqTestFixture)
213 
214 #if 0
215 BOOST_AUTO_TEST_CASE(TestInvalidPSSM_ScaledPSSM) {
216  m_Pssm->SetPssm().SetFinalData().SetScalingFactor(2);
217  BOOST_REQUIRE_THROW(CPsiBl2Seq blaster(m_Pssm, m_Subject, m_OptHandle),
219 }
220 
221 BOOST_AUTO_TEST_CASE(TestInvalidPSSM_MissingScoresAndFreqRatios) {
222  m_Pssm->SetPssm().SetFinalData().ResetScores();
223  m_Pssm->SetPssm().SetIntermediateData().ResetFreqRatios();
224  BOOST_REQUIRE_THROW(CPsiBl2Seq blaster(m_Pssm, m_Subject, m_OptHandle),
226 }
227 
228 BOOST_AUTO_TEST_CASE(TestInvalidPSSM_MissingQuery) {
229  m_Pssm->SetPssm().ResetQuery();
230  BOOST_REQUIRE_THROW(CPsiBl2Seq blaster(m_Pssm, m_Subject, m_OptHandle),
232 }
233 
234 BOOST_AUTO_TEST_CASE(TestInvalidPSSM_Bioseq_setAsQuery) {
235  m_Pssm->SetPssm().SetQuery(*m_SeqSet);
236  BOOST_REQUIRE_THROW(CPsiBl2Seq blaster(m_Pssm, m_Subject, m_OptHandle),
238 }
239 
240 BOOST_AUTO_TEST_CASE(TestInvalidPSSM_NuclScoringMatrix) {
241  m_Pssm->SetPssm().SetIsProtein(false);
242  BOOST_REQUIRE_THROW(CPsiBl2Seq blaster(m_Pssm, m_Subject, m_OptHandle),
244 }
245 
246 BOOST_AUTO_TEST_CASE(TestMissingQuery) {
248  opts(dynamic_cast<CBlastProteinOptionsHandle*>(&*m_OptHandle));
249  CRef<IQueryFactory> empty_query;
250  BOOST_REQUIRE_THROW(CPsiBl2Seq blaster(empty_query, m_Subject, opts),
252 }
253 BOOST_AUTO_TEST_CASE(TestMultipleQueries) {
254  TSeqLocVector queries;
255  int gis[] = {
256  129295, // this gi is protein
257  555 }; // this gi is nucleotide
258  for (size_t i = 0; i < sizeof(gis)/sizeof(*gis); i++) {
259  CRef<CSeq_id> seqid(new CSeq_id(CSeq_id::e_Gi, gis[i]));
260  TSeqRange range(0U, 50U);
261  unique_ptr<SSeqLoc> sl(CTestObjMgr::Instance().
262  CreateSSeqLoc(*seqid, range));
263  queries.push_back(*sl);
264  }
265  CRef<IQueryFactory> qf(new CObjMgr_QueryFactory(queries));
267  opts(dynamic_cast<CBlastProteinOptionsHandle*>(&*m_OptHandle));
268  BOOST_REQUIRE_THROW(CPsiBl2Seq blaster(qf, m_Subject, opts),
270 }
271 
272 BOOST_AUTO_TEST_CASE(TestQueryIsNucleotide) {
273  TSeqLocVector queries;
274  CRef<CSeq_id> seqid(new CSeq_id(CSeq_id::e_Gi, 555));
275  TSeqRange range(0U, 500U);
276  unique_ptr<SSeqLoc> sl(CTestObjMgr::Instance().
277  CreateSSeqLoc(*seqid, range));
278  queries.push_back(*sl);
280 
282  opts(dynamic_cast<CBlastProteinOptionsHandle*>(&*m_OptHandle));
283  BOOST_REQUIRE_THROW(CPsiBl2Seq blaster(query, m_Subject, opts),
285 }
286 
287 BOOST_AUTO_TEST_CASE(TestSubjectIsNucleotide) {
288  TSeqLocVector sequences;
289  CRef<CSeq_id> seqid(new CSeq_id(CSeq_id::e_Gi, 555));
290  TSeqRange range(0U, 500U);
291  unique_ptr<SSeqLoc> sl(CTestObjMgr::Instance().
292  CreateSSeqLoc(*seqid, range));
293  sequences.push_back(*sl);
294  m_Subject.Reset(new CObjMgr_QueryFactory(sequences));
295  BOOST_REQUIRE_THROW(CPsiBl2Seq blaster(m_Pssm, m_Subject, m_OptHandle),
297 }
298 
299 BOOST_AUTO_TEST_CASE(TestMissingSubjects) {
300  m_Subject.Reset();
301  BOOST_REQUIRE_THROW(CPsiBl2Seq blaster(m_Pssm, m_Subject, m_OptHandle),
303 }
304 
305 BOOST_AUTO_TEST_CASE(TestMissingPSSM) {
306  m_Pssm.Reset();
307  BOOST_REQUIRE_THROW(CPsiBl2Seq blaster(m_Pssm, m_Subject, m_OptHandle),
309 }
310 
311 BOOST_AUTO_TEST_CASE(TestMissingOptions) {
312  m_OptHandle.Reset();
313  BOOST_REQUIRE_THROW(CPsiBl2Seq blaster(m_Pssm, m_Subject, m_OptHandle),
315 }
316 
317 BOOST_AUTO_TEST_CASE(TestComparePssmWithSingleSequence) {
318  CConstRef<CBioseq> bioseq(&m_SeqEntry->GetSeq());
319  x_SetupSubject(bioseq);
320 
321  CPsiBl2Seq blaster(m_Pssm, m_Subject, m_OptHandle);
322  CSearchResultSet results(*blaster.Run());
323  BOOST_REQUIRE(results[0].GetErrors().empty());
324 
325  const size_t kNumExpectedAlignments = 2;
326  CConstRef<CSeq_align_set> sas = results[0].GetSeqAlign();
327 
328  BOOST_REQUIRE_EQUAL(kNumExpectedAlignments, sas->Size());
329 
330 
331  CSeq_align_set::Tdata::const_iterator alignment_itr
332  = sas->Get().begin();
333  x_ValidatePssmVsGi7450545(*alignment_itr, 1);
334  ++alignment_itr;
335  x_ValidatePssmVsGi7450545(*alignment_itr, 2);
336 }
337 #endif
338 
339 BOOST_AUTO_TEST_CASE(TestComparePssmWithMultipleSequences) {
340  const size_t kNumSubjects = 2;
341  CConstRef<CBioseq_set> bioseq_set(&m_SeqSet->GetSet());
342  x_SetupSubject(bioseq_set);
343 
344  CPsiBl2Seq blaster(m_Pssm, m_Subject, m_OptHandle);
345  CSearchResultSet results(*blaster.Run());
346  BOOST_REQUIRE(results[0].GetErrors().empty());
347 
348  const CBlastOptions& opts = m_OptHandle->GetOptions();
349  BOOST_REQUIRE_EQUAL(kNumSubjects,
350  (size_t)m_Subject->MakeLocalQueryData(&opts)->GetNumQueries());
351  BOOST_REQUIRE_EQUAL(kNumSubjects,
352  results[0].GetSeqAlign()->Get().size());
353 
354  const size_t kNumExpectedAlignments = kNumSubjects;
355  CConstRef<CSeq_align_set> sas = results[0].GetSeqAlign();
356  BOOST_REQUIRE_EQUAL(kNumExpectedAlignments, sas->Get().size());
357 
358  CSeq_align_set::Tdata::const_iterator alignment_itr
359  = sas->Get().begin();
360  x_ValidatePssmVsGi7450545(*alignment_itr, 1);
361  ++alignment_itr;
362  x_ValidatePssmVsGi7450545(*alignment_itr, 2);
363 
364 
365  BOOST_REQUIRE(results[1].GetErrors().empty());
366  CConstRef<CSeq_align_set> sas2 = results[1].GetSeqAlign();
367 
368  x_ValidatePssmVsGi129295(*(sas2->Get().begin()));
369 
370 }
371 
372 #if 0
373 BOOST_AUTO_TEST_CASE(TestComparePssmWithMultipleSequences_OneWithNoResults) {
375 
376  // Prepare the subjects
377  TSeqLocVector subjects;
378  {
379  int subj_gis[] = { 7450545, 40456275, 129295 };
380  for (size_t i = 0; i < sizeof(subj_gis)/sizeof(*subj_gis); i++) {
381  CRef<CSeq_loc> subj_loc(new CSeq_loc);
382  subj_loc->SetWhole().SetGi(subj_gis[i]);
383  subjects.push_back(SSeqLoc(subj_loc, scope));
384  }
385  }
386 
387  // set up the query factories for the subjects
388  CRef<IQueryFactory> subj_factory(new CObjMgr_QueryFactory(subjects));
389 
390  CPsiBl2Seq blaster(m_Pssm, subj_factory, m_OptHandle);
391  CSearchResultSet results(*blaster.Run());
392  BOOST_REQUIRE(results[0].GetErrors().empty());
393 
394  BOOST_REQUIRE_EQUAL(subjects.size(), results.GetNumResults());
395 
396  CConstRef<CSeq_align_set> sas = results[0].GetSeqAlign();
397  CSeq_align_set::Tdata::const_iterator alignment_itr
398  = sas->Get().begin();
399  x_ValidatePssmVsGi7450545(*alignment_itr, 1);
400  ++alignment_itr;
401  x_ValidatePssmVsGi7450545(*alignment_itr, 2);
402 
403  CConstRef<CSeq_align_set> sas2 = results[1].GetSeqAlign();
404 
405  // REMOVE??? x_ValidatePssmVsGi40456275(*(sas2->Get().begin()));
406  BOOST_REQUIRE_EQUAL(0, (int) sas2->Size());
407 
408  x_ValidatePssmVsGi129295(*(results[2].GetSeqAlign()->Get().begin()));
409 
410 }
411 
412 BOOST_AUTO_TEST_CASE(TestComparePsiBl2SeqWithBl2Seq) {
414 
415  // Prepare the query
417  {
418  CRef<CSeq_loc> query_loc(new CSeq_loc);
419  query_loc->SetWhole().SetGi(7662354);
420  query.push_back(SSeqLoc(query_loc, scope));
421  }
422 
423  // Prepare the subjects
424  TSeqLocVector subjects;
425  {
426  // These gis have hits against the query sequence above
427  int subj_gis[] = { 34535770, 46125411 };
428  for (size_t i = 0; i < sizeof(subj_gis)/sizeof(*subj_gis); i++) {
429  CRef<CSeq_loc> subj_loc(new CSeq_loc);
430  subj_loc->SetWhole().SetGi(subj_gis[i]);
431  subjects.push_back(SSeqLoc(subj_loc, scope));
432  }
433  }
434 
435  // set up the query factories for CPsiBl2Seq
436  CRef<IQueryFactory> query_factory(new CObjMgr_QueryFactory(query));
437  CRef<IQueryFactory> subj_factory(new CObjMgr_QueryFactory(subjects));
438 
439  // Reset composition based statistics for now
440  m_OptHandle->SetCompositionBasedStats(eNoCompositionBasedStats);
441 
442  // Run BLAST 2 Sequences (objmgr dependent version)
443  CBl2Seq bl2seq(query, subjects, *m_OptHandle);
444  TSeqAlignVector bl2seq_results = bl2seq.Run();
445 
446  // Run BLAST 2 Sequences (objmgr independent version)
447  // Configure the options the same way
449  psi_opts(dynamic_cast<CBlastProteinOptionsHandle*>(&*m_OptHandle));
450  CPsiBl2Seq psibl2seq(query_factory, subj_factory, psi_opts);
451  CSearchResultSet psibl2seq_results = *psibl2seq.Run();
452 
453  qa::TSeqAlignSet results_ref;
454  qa::TSeqAlignSet results_test;
455 
456  qa::SeqAlignSetConvert(*bl2seq_results[0], results_ref);
457  qa::SeqAlignSetConvert(*psibl2seq_results[0].GetSeqAlign(), results_test);
458 
459  qa::CSeqAlignCmpOpts opts;
460  qa::CSeqAlignCmp cmp(results_ref, results_test, opts);
461  string errors;
462  bool identical_results = cmp.Run(&errors);
463 
464  BOOST_REQUIRE_MESSAGE(identical_results, errors);
465 }
466 #endif
467 
469 
static CRef< CScope > m_Scope
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
Declares the CBl2Seq (BLAST 2 Sequences) class.
vector< CRef< objects::CSeq_align_set > > TSeqAlignVector
Vector of Seq-align-sets.
BOOST_AUTO_TEST_SUITE_END() static int s_GetSegmentFlags(const CBioseq &bioseq)
Runs the BLAST algorithm between 2 sequences.
Definition: bl2seq.hpp:58
Defines BLAST error codes (user errors included)
Encapsulates ALL the BLAST algorithm's options.
Handle to the protein-protein options to the BLAST algorithm.
CRange< TSeqPos > GetSeqRange(TDim row) const
Definition: Dense_seg.hpp:234
NCBI C++ Object Manager dependant implementation of IQueryFactory.
Handle to the protein-protein options to the BLAST algorithm.
void x_SetupSubject(CConstRef< CBioseq_set > bioseq_set)
CRef< IQueryFactory > m_Subject
must be initialized with one of the two data members below
void x_ValidatePssmVsGi7450545(CConstRef< CSeq_align > sa, int hsp_num)
void x_ValidatePssmVsGi129295(CConstRef< CSeq_align > sa)
void x_SetupSubject(CConstRef< CBioseq > bioseq)
CRef< CSeq_entry > m_SeqSet
Contains a Bioseq-set with two Bioseqs, gi 7450545 and gi 129295.
void x_ValidatePssmVsGi40456275(CConstRef< CSeq_align > sa)
CRef< CSeq_entry > m_SeqEntry
Contains a single Bioseq.
CRef< CPSIBlastOptionsHandle > m_OptHandle
CRef< CPssmWithParameters > m_Pssm
Runs a single iteration of the PSI-BLAST algorithm between 2 sequences.
Definition: psibl2seq.hpp:58
CScope –.
Definition: scope.hpp:92
Search Results for All Queries.
Tdata::size_type Size() const
Definition: Seq_entry.hpp:56
static CRef< CScope > NewScope(bool with_defaults=true)
Return a new scope, possibly (by default) with default loaders, which will include the Genbank loader...
Definition: simple_om.cpp:202
static CTestObjMgr & Instance()
Definition: test_objmgr.cpp:69
Template class for iteration on objects of class C (non-medifiable version)
Definition: iterator.hpp:767
@ eNoCompositionBasedStats
Don't use composition based statistics.
constexpr auto begin(const ct_const_array< T, N > &in) noexcept
CRef< CSearchResultSet > Run()
Run the PSI-BLAST 2 Sequences engine.
Definition: psibl2seq.cpp:92
const CBlastOptions & GetOptions() const
Return the object which this object is a handle for.
void PsiBlastComputePssmScores(CRef< objects::CPssmWithParameters > pssm, const CBlastOptions &opts)
Given a PSSM with frequency ratios and options, invoke the PSSM engine to compute the scores.
void SetWhole(TWhole &v)
Definition: Seq_loc.hpp:982
void SetId(CSeq_id &id)
set the 'id' field in all parts of this location
Definition: Seq_loc.cpp:3474
CConstBeginInfo ConstBegin(const C &obj)
Get starting point of non-modifiable object hierarchy.
Definition: iterator.hpp:1012
@ eDetectLoops
Definition: iterator.hpp:998
CBioseq_Handle AddBioseq(CBioseq &bioseq, TPriority pri=kPriority_Default, EExist action=eExist_Throw)
Add bioseq, return bioseq handle.
Definition: scope.cpp:530
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
CRange< TSeqPos > TSeqRange
typedefs for sequence ranges
Definition: range.hpp:419
TTo GetTo(void) const
Get the To member data.
Definition: Range_.hpp:269
TFrom GetFrom(void) const
Get the From member data.
Definition: Range_.hpp:222
bool CanGetIntermediateData(void) const
Check if it is safe to call GetIntermediateData method.
Definition: Pssm_.hpp:787
const TFinalData & GetFinalData(void) const
Get the FinalData member data.
Definition: Pssm_.hpp:814
bool CanGetFinalData(void) const
Check if it is safe to call GetFinalData method.
Definition: Pssm_.hpp:808
void SetPssm(TPssm &value)
Assign a value to Pssm data member.
bool CanGetQuery(void) const
Check if it is safe to call GetQuery method.
Definition: Pssm_.hpp:766
bool CanGetScores(void) const
Check if it is safe to call GetScores method.
bool CanGetPssm(void) const
Check if it is safe to call GetPssm method.
const TPssm & GetPssm(void) const
Get the Pssm member data.
const TDenseg & GetDenseg(void) const
Get the variant data.
Definition: Seq_align_.cpp:153
bool IsSetSegs(void) const
Check if a value has been assigned to Segs data member.
Definition: Seq_align_.hpp:909
const Tdata & Get(void) const
Get the member data.
const TSegs & GetSegs(void) const
Get the Segs member data.
Definition: Seq_align_.hpp:921
bool IsDenseg(void) const
Check if variant Denseg is selected.
Definition: Seq_align_.hpp:740
@ e_Gi
GenInfo Integrated Database.
Definition: Seq_id_.hpp:106
const TSeq & GetSeq(void) const
Get the variant data.
Definition: Seq_entry_.cpp:102
TSet & SetSet(void)
Select the variant.
Definition: Seq_entry_.cpp:130
TSeq_set & SetSeq_set(void)
Assign a value to Seq_set data member.
int i
const TYPE & Get(const CNamedParameterList *param)
range(_Ty, _Ty) -> range< _Ty >
constexpr bool empty(list< Ts... >) noexcept
const struct ncbi::grid::netcache::search::fields::SIZE size
Magic spell ;-) needed for some weird compilers... very empiric.
std::vector< SeqAlign > TSeqAlignSet
Vector of neutral sequence alignments.
NOTE: This file contains work in progress and the APIs are likely to change, please do not rely on th...
Utilities to develop and debug unit tests for BLAST.
Declares CPsiBl2Seq, the C++ API for the PSI-BLAST 2 Sequences engine.
BOOST_AUTO_TEST_CASE(TestComparePssmWithMultipleSequences)
Declarations of auxiliary functions/classes for PSI-BLAST.
static bool GetSeqId(const T &d, set< string > &labels, const string name="", bool detect=false, bool found=false)
API to compare CSeq-aligns produced by BLAST.
void SeqAlignSetConvert(const objects::CSeq_align_set &ss, std::vector< SeqAlign > &retval)
Converts a Seq-align-set into a neutral seqalign for use with the CSeqAlignCmp class.
vector< SSeqLoc > TSeqLocVector
Vector of sequence locations.
Definition: sseqloc.hpp:129
Structure to represent a single sequence to be fed to BLAST.
Definition: sseqloc.hpp:47
static string query
Utility stuff for more convenient using of Boost.Test library.
Modified on Wed Apr 17 13:08:55 2024 by modify_doxy.py rev. 669887