;
85m_OptHandle.
Reset();
118ifstream istr(
"data/magicblast_nonmatch.asn");
124m_OptHandle->SetMismatchPenalty(-8);
125m_OptHandle->SetGapExtensionCost(8);
126m_OptHandle->SetPaired(
true);
127 CMagicBlastmagicblast(query_factory, db_adapter, m_OptHandle);
130 const size_tkExpectedNumResults = 1;
131BOOST_REQUIRE_EQUAL(
results->size(), kExpectedNumResults);
137ifstream istr(
"data/magicblast_concordant.asn");
143m_OptHandle->SetPaired(
true);
144 CMagicBlastmagicblast(query_factory, db_adapter, m_OptHandle);
147 const size_tkExpectedNumResults = 3;
148 const size_tkExpectedConcordant = 3;
149BOOST_REQUIRE_EQUAL(
results->size(), kExpectedNumResults);
153 if(re->IsConcordant()) ++
count;
155BOOST_REQUIRE_EQUAL(
count, kExpectedConcordant);
161ifstream istr(
"data/magicblast_discordant.asn");
167m_OptHandle->SetPaired(
true);
168 CMagicBlastmagicblast(query_factory, db_adapter, m_OptHandle);
171 const size_tkExpectedNumResults = 4;
172 const size_tkExpectedDiscordant = 4;
173BOOST_REQUIRE_EQUAL(
results->size(), kExpectedNumResults);
177 if(!re->IsConcordant()) ++
count;
179BOOST_REQUIRE_EQUAL(
count, kExpectedDiscordant);
185ifstream istr(
"data/magicblast_queries.asn");
191m_OptHandle->SetMismatchPenalty(-8);
192m_OptHandle->SetGapExtensionCost(8);
193m_OptHandle->SetCutoffScore(49);
194 CMagicBlastmagicblast(query_factory, db_adapter, m_OptHandle);
197 const size_tkExpectedNumResults = 4;
198BOOST_REQUIRE_EQUAL(
results->Get().size(), kExpectedNumResults);
201vector<SMatch> expected_hits(kExpectedNumResults);
207expected_hits[results_idx].score = 49;
208expected_hits[results_idx].prod_length = 49;
218expected_hits[results_idx].exons.push_back(exon);
228expected_hits[results_idx].exons.push_back(exon);
232expected_hits[results_idx].score = 49;
233expected_hits[results_idx].prod_length = 49;
243expected_hits[results_idx].exons.push_back(exon);
253expected_hits[results_idx].exons.push_back(exon);
257expected_hits[results_idx].score = 49;
258expected_hits[results_idx].prod_length = 49;
268expected_hits[results_idx].exons.push_back(exon);
278expected_hits[results_idx].exons.push_back(exon);
282expected_hits[results_idx].score = 49;
283expected_hits[results_idx].prod_length = 49;
293expected_hits[results_idx].exons.push_back(exon);
303expected_hits[results_idx].exons.push_back(exon);
307 for(
autoit:
results->Get()) {
310BOOST_REQUIRE(it->GetSegs().IsSpliced());
313it->GetNamedScore(
"score", score);
314BOOST_REQUIRE_EQUAL(score, expected_hits[results_idx].score);
318expected_hits[results_idx].prod_length);
320BOOST_REQUIRE_EQUAL(seg.
GetExons().size(),
321expected_hits[results_idx].exons.size());
324 autoexpected_exon = expected_hits[results_idx].exons.begin();
325 for(
autoexon: seg.
GetExons()) {
328BOOST_REQUIRE_EQUAL(exon->GetProduct_start().GetNucpos(),
331BOOST_REQUIRE_EQUAL(exon->GetProduct_end().GetNucpos(),
334BOOST_REQUIRE_EQUAL(exon->GetGenomic_start(),
337BOOST_REQUIRE_EQUAL(exon->GetGenomic_end(),
341BOOST_REQUIRE_EQUAL(exon->GetProduct_strand(),
344BOOST_REQUIRE_EQUAL(exon->GetGenomic_strand(),
348 if(!expected_exon->acceptor.empty()) {
349BOOST_REQUIRE(exon->CanGetAcceptor_before_exon());
350BOOST_REQUIRE_EQUAL(exon->GetAcceptor_before_exon().GetBases(),
354 if(!expected_exon->donor.empty()) {
355BOOST_REQUIRE(exon->CanGetDonor_after_exon());
356BOOST_REQUIRE_EQUAL(exon->GetDonor_after_exon().GetBases(),
357expected_exon->
donor);
369ifstream istr(
"data/magicblast_paired.asn");
373 boolqueries_paired =
false;
374 autoq = m_Queries->GetSeq_set().begin();
375BOOST_REQUIRE(q != m_Queries->GetSeq_set().end());
376 const CBioseq& bioseq = (*q)->GetSeq();
382queries_paired = obj.
HasField(
"has_pair");
386BOOST_REQUIRE(queries_paired);
391m_OptHandle->SetPaired(
true);
392 CMagicBlastmagicblast(query_factory, db_adapter, m_OptHandle);
395 const size_tkExpectedNumResults = 3;
396BOOST_REQUIRE_EQUAL(
results->Get().size(), kExpectedNumResults);
399vector<SMatch> expected_hits(2 * kExpectedNumResults);
406expected_hits[results_idx].score = 68;
407expected_hits[results_idx].prod_length = 75;
417expected_hits[results_idx].exons.push_back(exon);
421expected_hits[results_idx].score = 74;
422expected_hits[results_idx].prod_length = 75;
432expected_hits[results_idx].exons.push_back(exon);
436expected_hits[results_idx].score = 68;
437expected_hits[results_idx].prod_length = 75;
447expected_hits[results_idx].exons.push_back(exon);
451expected_hits[results_idx].score = 74;
452expected_hits[results_idx].prod_length = 75;
462expected_hits[results_idx].exons.push_back(exon);
466expected_hits[results_idx].score = 68;
467expected_hits[results_idx].prod_length = 75;
477expected_hits[results_idx].exons.push_back(exon);
481expected_hits[results_idx].score = 74;
482expected_hits[results_idx].prod_length = 75;
492expected_hits[results_idx].exons.push_back(exon);
496 for(
autoseg:
results->Get()) {
499BOOST_REQUIRE(seg->GetSegs().IsDisc());
500BOOST_REQUIRE_EQUAL(seg->GetSegs().GetDisc().Get().size(), 2u);
502 for(
autoit: seg->GetSegs().GetDisc().Get()) {
504BOOST_REQUIRE(it->GetSegs().IsSpliced());
507it->GetNamedScore(
"score", score);
508BOOST_REQUIRE_EQUAL(score, expected_hits[results_idx].score);
513expected_hits[results_idx].prod_length);
515BOOST_REQUIRE_EQUAL(seg.
GetExons().size(),
516expected_hits[results_idx].exons.size());
519 autoexpected_exon = expected_hits[results_idx].exons.begin();
520 for(
autoexon: seg.
GetExons()) {
523BOOST_REQUIRE_EQUAL(exon->GetProduct_start().GetNucpos(),
526BOOST_REQUIRE_EQUAL(exon->GetProduct_end().GetNucpos(),
529BOOST_REQUIRE_EQUAL(exon->GetGenomic_start(),
532BOOST_REQUIRE_EQUAL(exon->GetGenomic_end(),
536BOOST_REQUIRE_EQUAL(exon->GetProduct_strand(),
539BOOST_REQUIRE_EQUAL(exon->GetGenomic_strand(),
543 if(!expected_exon->acceptor.empty()) {
544BOOST_REQUIRE(exon->CanGetAcceptor_before_exon());
546exon->GetAcceptor_before_exon().GetBases(),
550 if(!expected_exon->donor.empty()) {
551BOOST_REQUIRE(exon->CanGetDonor_after_exon());
552BOOST_REQUIRE_EQUAL(exon->GetDonor_after_exon().GetBases(),
553expected_exon->
donor);
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.
BOOST_AUTO_TEST_SUITE_END() static int s_GetSegmentFlags(const CBioseq &bioseq)
Interface to create a BlastSeqSrc suitable for use in CORE BLAST from a a variety of BLAST database/s...
Handle to the nucleotide mapping options to the BLAST algorithm.
NCBI C++ Object Manager free implementation of IQueryFactory.
bool HasField(const string &str, const string &delim=".", NStr::ECase use_case=NStr::eCase) const
Verify that a named field exists.
Ensure direct dependencies on enough of the core xncbi library to satisfy shared libraries that depen...
CRef< CMagicBlastResultSet > RunEx(void)
CRef< CSeq_align_set > Run(void)
Run the RNA-Seq mapping.
@ eBlastDbIsNucleotide
nucleotide
#define MSerial_AsnText
I/O stream manipulators â.
void Reset(void)
Reset reference object.
bool IsStr(void) const
Check if variant Str is selected.
const TStr & GetStr(void) const
Get the variant data.
const TType & GetType(void) const
Get the Type member data.
TProduct_length GetProduct_length(void) const
Get the Product_length member data.
const TExons & GetExons(void) const
Get the Exons member data.
ENa_strand
strand of nucleic acid
const Tdata & Get(void) const
Get the member data.
bool CanGetDescr(void) const
Check if it is safe to call GetDescr method.
const TDescr & GetDescr(void) const
Get the Descr member data.
Declares class which provides internal BLAST database representations to the internal BLAST APIs.
Declares CMagicBlast, the C++ API for the BLAST RNA-Seq mapping engine.
BOOST_AUTO_TEST_CASE(MappingNonMatch)
Magic spell ;-) needed for some weird compilers... very empiric.
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
NOTE: This file contains work in progress and the APIs are likely to change, please do not rely on th...
CRef< CSearchDatabase > m_Db
CRef< CMagicBlastOptionsHandle > m_OptHandle
~CMagicBlastTestFixture()
CRef< CBioseq_set > m_Queries
Contains a single Bioseq.
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