;
90x_ReadSeqEntriesFromFile();
93x_SetupSubject(bioseq);
99m_OptHandle.
Reset();
100m_SeqEntry.
Reset();
115subjects.push_back(ssl);
129subjects.push_back(ssl);
136 const stringkPssmFile(
"data/pssm_freq_ratios.asn");
137m_Pssm = TestUtil::ReadObject<CPssmWithParameters>(kPssmFile);
144 const stringkSeqEntryFile(
"data/7450545.seqentry.asn");
145m_SeqEntry = TestUtil::ReadObject<CSeq_entry>(kSeqEntryFile);
150BOOST_REQUIRE(m_Pssm &&
159BOOST_REQUIRE_EQUAL(
false, sa->
IsSetSegs());
170pair<TSeqRange, TSeqRange> first_hsp =
174BOOST_REQUIRE_EQUAL(first_hsp.first.GetFrom(), hsp1_query.
GetFrom());
175BOOST_REQUIRE_EQUAL(first_hsp.first.GetTo(), hsp1_query.
GetTo());
176BOOST_REQUIRE_EQUAL(first_hsp.second.GetFrom(), hsp1_subj.
GetFrom());
177BOOST_REQUIRE_EQUAL(first_hsp.second.GetTo(), hsp1_subj.
GetTo());
179 else if(hsp_num == 2)
182 constpair<TSeqRange, TSeqRange> second_hsp =
186BOOST_REQUIRE_EQUAL(second_hsp.first.GetFrom(), hsp2_query.
GetFrom());
187BOOST_REQUIRE_EQUAL(second_hsp.first.GetTo(), hsp2_query.
GetTo());
188BOOST_REQUIRE_EQUAL(second_hsp.second.GetFrom(), hsp2_subj.
GetFrom());
189BOOST_REQUIRE_EQUAL(second_hsp.second.GetTo(), hsp2_subj.
GetTo());
204BOOST_REQUIRE_EQUAL(hsp.
GetTo(), hsp1_query.
GetTo());
206BOOST_REQUIRE_EQUAL(hsp.
GetTo(), hsp1_subj.
GetTo());
216m_Pssm->SetPssm().SetFinalData().SetScalingFactor(2);
217BOOST_REQUIRE_THROW(
CPsiBl2Seqblaster(m_Pssm, m_Subject, m_OptHandle),
222m_Pssm->SetPssm().SetFinalData().ResetScores();
223m_Pssm->SetPssm().SetIntermediateData().ResetFreqRatios();
224BOOST_REQUIRE_THROW(
CPsiBl2Seqblaster(m_Pssm, m_Subject, m_OptHandle),
229m_Pssm->SetPssm().ResetQuery();
230BOOST_REQUIRE_THROW(
CPsiBl2Seqblaster(m_Pssm, m_Subject, m_OptHandle),
235m_Pssm->SetPssm().SetQuery(*m_SeqSet);
236BOOST_REQUIRE_THROW(
CPsiBl2Seqblaster(m_Pssm, m_Subject, m_OptHandle),
241m_Pssm->SetPssm().SetIsProtein(
false);
242BOOST_REQUIRE_THROW(
CPsiBl2Seqblaster(m_Pssm, m_Subject, m_OptHandle),
250BOOST_REQUIRE_THROW(
CPsiBl2Seqblaster(empty_query, m_Subject, opts),
258 for(
size_t i= 0;
i<
sizeof(gis)/
sizeof(*gis);
i++) {
262CreateSSeqLoc(*seqid, range));
263queries.push_back(*sl);
268BOOST_REQUIRE_THROW(
CPsiBl2Seqblaster(qf, m_Subject, opts),
277CreateSSeqLoc(*seqid, range));
278queries.push_back(*sl);
292CreateSSeqLoc(*seqid, range));
293sequences.push_back(*sl);
295BOOST_REQUIRE_THROW(
CPsiBl2Seqblaster(m_Pssm, m_Subject, m_OptHandle),
301BOOST_REQUIRE_THROW(
CPsiBl2Seqblaster(m_Pssm, m_Subject, m_OptHandle),
307BOOST_REQUIRE_THROW(
CPsiBl2Seqblaster(m_Pssm, m_Subject, m_OptHandle),
313BOOST_REQUIRE_THROW(
CPsiBl2Seqblaster(m_Pssm, m_Subject, m_OptHandle),
319x_SetupSubject(bioseq);
321 CPsiBl2Seqblaster(m_Pssm, m_Subject, m_OptHandle);
325 const size_tkNumExpectedAlignments = 2;
328BOOST_REQUIRE_EQUAL(kNumExpectedAlignments, sas->
Size());
331CSeq_align_set::Tdata::const_iterator alignment_itr
332= sas->
Get().begin();
333x_ValidatePssmVsGi7450545(*alignment_itr, 1);
335x_ValidatePssmVsGi7450545(*alignment_itr, 2);
340 const size_tkNumSubjects = 2;
342x_SetupSubject(bioseq_set);
344 CPsiBl2Seqblaster(m_Pssm, m_Subject, m_OptHandle);
346BOOST_REQUIRE(
results[0].GetErrors().empty());
349BOOST_REQUIRE_EQUAL(kNumSubjects,
350(
size_t)m_Subject->MakeLocalQueryData(&opts)->GetNumQueries());
351BOOST_REQUIRE_EQUAL(kNumSubjects,
354 const size_tkNumExpectedAlignments = kNumSubjects;
356BOOST_REQUIRE_EQUAL(kNumExpectedAlignments, sas->
Get().size());
358CSeq_align_set::Tdata::const_iterator alignment_itr
359= sas->
Get().begin();
360x_ValidatePssmVsGi7450545(*alignment_itr, 1);
362x_ValidatePssmVsGi7450545(*alignment_itr, 2);
365BOOST_REQUIRE(
results[1].GetErrors().empty());
368x_ValidatePssmVsGi129295(*(sas2->
Get().begin()));
379 intsubj_gis[] = { 7450545, 40456275, 129295 };
380 for(
size_t i= 0;
i<
sizeof(subj_gis)/
sizeof(*subj_gis);
i++) {
382subj_loc->SetWhole().SetGi(subj_gis[
i]);
383subjects.push_back(
SSeqLoc(subj_loc, scope));
390 CPsiBl2Seqblaster(m_Pssm, subj_factory, m_OptHandle);
394BOOST_REQUIRE_EQUAL(subjects.size(),
results.GetNumResults());
397CSeq_align_set::Tdata::const_iterator alignment_itr
398= sas->
Get().begin();
399x_ValidatePssmVsGi7450545(*alignment_itr, 1);
401x_ValidatePssmVsGi7450545(*alignment_itr, 2);
406BOOST_REQUIRE_EQUAL(0, (
int) sas2->
Size());
408x_ValidatePssmVsGi129295(*(
results[2].GetSeqAlign()->
Get().begin()));
419query_loc->SetWhole().SetGi(7662354);
427 intsubj_gis[] = { 34535770, 46125411 };
428 for(
size_t i= 0;
i<
sizeof(subj_gis)/
sizeof(*subj_gis);
i++) {
430subj_loc->SetWhole().SetGi(subj_gis[
i]);
431subjects.push_back(
SSeqLoc(subj_loc, scope));
450 CPsiBl2Seqpsibl2seq(query_factory, subj_factory, psi_opts);
459qa::CSeqAlignCmpOpts opts;
460qa::CSeqAlignCmp
cmp(results_ref, results_test, opts);
462 boolidentical_results =
cmp.Run(&errors);
464BOOST_REQUIRE_MESSAGE(identical_results, errors);
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.
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.
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
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_ReadPssmFromFile()
void x_ReadSeqEntriesFromFile()
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.
Search Results for All Queries.
Tdata::size_type Size() const
static CRef< CScope > NewScope(bool with_defaults=true)
Return a new scope, possibly (by default) with default loaders, which will include the Genbank loader...
static CTestObjMgr & Instance()
Template class for iteration on objects of class C (non-medifiable version)
@ eNoCompositionBasedStats
Don't use composition based statistics.
CRef< CSearchResultSet > Run()
Run the PSI-BLAST 2 Sequences engine.
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 SetId(CSeq_id &id)
set the 'id' field in all parts of this location
CConstBeginInfo ConstBegin(const C &obj)
Get starting point of non-modifiable object hierarchy.
CBioseq_Handle AddBioseq(CBioseq &bioseq, TPriority pri=kPriority_Default, EExist action=eExist_Throw)
Add bioseq, return bioseq handle.
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
void Reset(void)
Reset reference object.
CRange< TSeqPos > TSeqRange
typedefs for sequence ranges
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
bool CanGetIntermediateData(void) const
Check if it is safe to call GetIntermediateData method.
const TFinalData & GetFinalData(void) const
Get the FinalData member data.
bool CanGetFinalData(void) const
Check if it is safe to call GetFinalData method.
void SetPssm(TPssm &value)
Assign a value to Pssm data member.
bool CanGetQuery(void) const
Check if it is safe to call GetQuery method.
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.
bool IsSetSegs(void) const
Check if a value has been assigned to Segs data member.
const Tdata & Get(void) const
Get the member data.
const TSegs & GetSegs(void) const
Get the Segs member data.
bool IsDenseg(void) const
Check if variant Denseg is selected.
@ e_Gi
GenInfo Integrated Database.
const TSeq & GetSeq(void) const
Get the variant data.
TSet & SetSet(void)
Select the variant.
TSeq_set & SetSeq_set(void)
Assign a value to Seq_set data member.
const TYPE & Get(const CNamedParameterList *param)
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...
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.
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