BOOST_REQUIRE(it->NotEmpty());
132BOOST_REQUIRE(!archive.
Empty());
170 if((
int)expected_hits.size() != hitlist.
Size()) {
171err +=
"Hitlist sizes " 175+
" do not match\n";
180 for(
size_t i=0;
i<
min(expected_hits.size(), (
size_t)hitlist.
Size());
189->CompareOrdered(expected_query_id) != 0) {
191err += header +
"Query ids "+ expected_hits[
i].query
193->GetId()->AsFastaString() +
" do not match\n";
200err += header +
"Subject ids " 203+
" do not match\n";
209 if(expected_hits[
i].query_range.GetFrom()
211|| expected_hits[
i].query_range.GetTo()
214err += header +
"Query ranges " 221+
" do not match\n";
227 if(expected_hits[
i].subject_range.GetFrom()
229|| expected_hits[
i].subject_range.GetTo()
232err += header +
"Subject ranges " 239+
" do not match\n";
245 if(expected_hits[
i].score != hit->
m_Score) {
246err += header +
"Scores " 250+
" do not match\n";
300 boolkParseDeflines =
true;
306 "Reading FASTA sequences has failed");
313 boolkParseDeflines =
true;
377 constvector< CRef<CSeq_loc> >& q = aligner.
GetQueries();
378BOOST_REQUIRE_EQUAL(seqlocs.size(), q.size());
379 for(
size_t i=0;
i< q.size();
i++) {
380BOOST_CHECK(seqlocs[
i]->
GetId()->Match(*q[
i]->
GetId()));
391 constvector< CRef<CSeq_loc> >& q = aligner.
GetQueries();
392BOOST_REQUIRE_EQUAL(bioseqs.size(), q.size());
393 for(
size_t i=0;
i< q.size();
i++) {
394BOOST_CHECK(bioseqs[
i]->GetFirstId()->Match(*q[
i]->
GetId()));
406BOOST_REQUIRE((*it)->GetId());
430vector< CRef<CBioseq> > bioseqs;
448s.
SetInt().SetId().Assign(
id);
449BOOST_REQUIRE(s.
GetId());
462vector< CRef<CSeq_loc> > seqlocs;
463vector< CRef<CBioseq> > bioseqs;
482seqlocs.push_back(m_Sequences.front());
485BOOST_REQUIRE_EQUAL((
int)seqlocs.size(), 1);
496 intstatus =
ReadFastaQueries(
"data/queries_with_gaps.fa", seqlocs, scope);
497BOOST_REQUIRE_EQUAL(status, 0);
498BOOST_CHECK_THROW(aligner.
SetQueries(seqlocs, scope),
509vector< CRef<CBioseq> > bioseqs;
512m_Options->SetRpsDb(
"");
516 intquery_index = (
int)m_Sequences.size();
517constr[0].seq1_index = query_index;
518constr[0].seq1_start = 0;
519constr[0].seq1_stop = 50;
521constr[0].seq2_index = 0;
522constr[0].seq2_start = 0;
523constr[0].seq2_stop = 50;
527BOOST_REQUIRE(m_Options->Validate());
530BOOST_CHECK_THROW(m_Aligner->SetQueries(m_Sequences,
m_Scope),
534BOOST_CHECK_THROW(m_Aligner->SetQueries(bioseqs),
540constr[0].seq1_index = 0;
541constr[0].seq1_start = 0;
542constr[0].seq1_stop = 50;
547constr[0].seq2_index = 1;
548constr[0].seq2_start = 0;
549constr[0].seq2_stop = length + 1;
551BOOST_REQUIRE(m_Options->Validate());
554BOOST_CHECK_THROW(m_Aligner->SetQueries(m_Sequences,
m_Scope),
558BOOST_CHECK_THROW(m_Aligner->SetQueries(bioseqs),
577m_Aligner->SetQueries(m_Sequences,
m_Scope);
589BOOST_CHECK(node->
GetValue().IsSetDist());
595BOOST_CHECK(!node->
GetValue().GetLabel().empty());
602BOOST_CHECK_EQUAL(node->
GetValue().GetId(),
606 int id= node->
GetValue().GetId();
607BOOST_REQUIRE(!queries[
id]);
613BOOST_CHECK(node->
GetValue().GetLabel().empty());
628vector<bool> used_queries(num_queries,
false);
632 ITERATE(vector<bool>, it, used_queries) {
641vector<bool> used_queries(num_queries,
false);
647BOOST_CHECK((*it)->CanGetName());
648 if((*it)->GetName() ==
"label") {
649label_fid = (*it)->GetId();
651 if((*it)->GetName() ==
"dist") {
652dist_fid = (*it)->GetId();
656BOOST_REQUIRE(label_fid >= 0);
658BOOST_REQUIRE(dist_fid >= 0);
661 if((*node)->GetId() == 0) {
666BOOST_REQUIRE((*node)->CanGetFeatures());
668 boolis_dist =
false;
670 if((*feat)->GetFeatureid() == label_fid) {
671 string label= (*feat)->GetValue();
672 const char* ptr =
label.c_str();
679BOOST_REQUIRE(!used_queries[
id]);
680used_queries[id] =
true;
683 if((*feat)->GetFeatureid() == dist_fid) {
688BOOST_CHECK(is_dist);
692 ITERATE(vector<bool>, it, used_queries) {
705 if(clusters.empty()) {
710vector<bool> used_queries(num_queries,
false);
715BOOST_REQUIRE(cluster->size() > 0);
716num_elems += (
int)cluster->size();
718 intprototype = cluster->GetPrototype();
719 boolis_prototype =
false;
723BOOST_REQUIRE(!used_queries[*elem]);
724used_queries[*elem] =
true;
726 if(prototype == *elem) {
727is_prototype =
true;
732BOOST_CHECK(is_prototype);
736BOOST_REQUIRE_EQUAL(num_elems, num_queries);
739 ITERATE(vector<bool>, it, used_queries) {
745 if(constraints.empty()) {
749unordered_set<int> constr_queries;
751constr_queries.insert(it->seq1_index);
752constr_queries.insert(it->seq2_index);
754 size_tremain = constr_queries.size();
758unordered_set<int>::const_iterator it = constr_queries.find(*elem);
759 if(it != constr_queries.end()) {
763BOOST_CHECK_EQUAL(cluster->size(), 1u);
778 constvector<CSequence>& seqs,
780 const string& aln_ref =
"")
785 intnum_queries = (
int)queries.size();
787BOOST_REQUIRE_EQUAL(seqalign->
GetDim(), num_queries);
790 for(
int i=0;
i< num_queries;
i++) {
797BOOST_REQUIRE_EQUAL(seqs.size(), queries.size());
798 int len= seqs[0].GetLength();
799 ITERATE(vector<CSequence>, it, seqs) {
800BOOST_CHECK_EQUAL(it->GetLength(),
len);
804 for(
size_t i=0;
i< queries.size();
i++) {
808 intnum_residues = 0;
809 const unsigned char* sequence = seqs[
i].GetSequence();
810 for(
intk=0;k < seqs[
i].GetLength();k++) {
815BOOST_CHECK_EQUAL(query_len, num_residues);
820 if(!aln_ref.empty()) {
826BOOST_REQUIRE_EQUAL(seqalign->
GetDim(), ref_align.
GetDim());
838BOOST_REQUIRE_EQUAL(starts.size(), ref_starts.size());
839BOOST_REQUIRE_EQUAL(lens.size(), ref_lens.size());
840 for(
size_t i=0;
i< starts.size();
i++) {
841BOOST_CHECK_EQUAL(starts[
i], ref_starts[
i]);
843 for(
size_t i=0;
i< lens.size();
i++) {
844BOOST_CHECK_EQUAL(lens[
i], ref_lens[
i]);
851 const string& ref_aln =
"")
853 const intkNumQueries = (
int)aligner.
GetQueries().size();
869BOOST_REQUIRE(m_Options->Validate());
871m_Aligner->SetQueries(m_Sequences,
m_Scope);
875BOOST_CHECK_EQUAL((
int)m_Aligner->GetMessages().size(), 0);
885m_Options->SetMaxInClusterDist(0.0);
886BOOST_REQUIRE(m_Options->Validate());
889m_Aligner->SetQueries(m_Sequences,
m_Scope);
896BOOST_CHECK((
int)m_Aligner->GetMessages().size() == 0);
905m_Options->SetMaxInClusterDist(1.0);
906BOOST_REQUIRE(m_Options->Validate());
909m_Aligner->SetQueries(m_Sequences,
m_Scope);
927BOOST_REQUIRE(m_Options->Validate());
930m_Aligner->SetQueries(m_Sequences,
m_Scope);
934BOOST_CHECK_EQUAL((
int)m_Aligner->GetMessages().size(), 0);
944vector<CMultiAlignerOptions::SConstraint>& constr
945= m_Options->SetUserConstraints();
948constr[0].seq1_index = 0;
949constr[0].seq1_start = 0;
950constr[0].seq1_stop = 50;
952constr[0].seq2_index = 1;
953constr[0].seq2_start = 0;
954constr[0].seq2_stop = 50;
956constr[1].seq1_index = 1;
957constr[1].seq1_start = 0;
958constr[1].seq1_stop = 50;
960constr[1].seq2_index = 5;
961constr[1].seq2_start = 0;
962constr[1].seq2_stop = 50;
964BOOST_REQUIRE(m_Options->Validate());
967m_Aligner->SetQueries(m_Sequences,
m_Scope);
971BOOST_CHECK_EQUAL((
int)m_Aligner->GetMessages().size(), 0);
982m_Options->SetMaxInClusterDist(1.0);
985vector< CRef<CSeq_loc> > queries;
986queries.push_back(m_Sequences[0]);
987queries.push_back(m_Sequences[1]);
988m_Aligner->SetQueries(queries,
m_Scope);
995m_Options->SetMaxInClusterDist(0.01);
997m_Aligner->SetQueries(queries,
m_Scope);
998status = m_Aligner->Run();
1010vector< CRef<CSeq_loc> > sequences;
1011BOOST_REQUIRE_EQUAL(
ReadFastaQueries(
"data/large.fa", sequences, scope,
1014m_Options->SetUseQueryClusters(
true);
1034BOOST_REQUIRE(
result->GetSegs().IsDenseg());
1041 intnum_input_sequences = (
int)first_denseg.
GetDim()
1042+ second_denseg.
GetDim();
1045BOOST_REQUIRE_EQUAL(
result->GetDim(), num_input_sequences);
1047vector<int> first_rows, second_rows;
1050 for(
size_t i=0;
i< first_denseg.
GetIds().
size();
i++) {
1053 for(;j <
result->GetDim();j++) {
1054 if(
id.Match(*
result->GetSegs().GetDenseg().GetIds()[j])) {
1055first_rows.push_back(j);
1059BOOST_REQUIRE(j < result->GetDim());
1062 for(
size_t i=0;
i< second_denseg.
GetIds().
size();
i++) {
1065 for(;j <
result->GetDim();j++) {
1066 if(
id.Match(*
result->GetSegs().GetDenseg().GetIds()[j])) {
1067second_rows.push_back(j);
1071BOOST_REQUIRE(j < result->GetDim());
1079 f->RemovePureGapSegs();
1081BOOST_REQUIRE_EQUAL(first_denseg.
GetStarts().size(),
f->GetStarts().size());
1082BOOST_REQUIRE_EQUAL(first_denseg.
GetLens().size(),
f->GetLens().size());
1084BOOST_REQUIRE_EQUAL(first_denseg.
GetStarts()[
i],
f->GetStarts()[
i]);
1086 for(
size_t i=0;
i< first_denseg.
GetLens().
size();
i++) {
1087BOOST_REQUIRE_EQUAL(first_denseg.
GetLens()[
i],
f->GetLens()[
i]);
1096BOOST_REQUIRE_EQUAL(second_denseg.
GetLens().size(), s->
GetLens().size());
1100 for(
size_t i=0;
i< second_denseg.
GetLens().
size();
i++) {
1111m_Aligner->SetInputMSAs(*m_Align1, *m_Align2, repr, repr,
m_Scope);
1131 const_cast<CSeq_id*
>(m_Sequences.front()->GetId())));
1137m_Aligner->SetInputMSAs(*m_Align1, *align, repr, repr,
m_Scope);
1147BOOST_REQUIRE(m_Align1->CheckNumRows() > 3);
1148BOOST_REQUIRE(m_Align2->CheckNumRows() > 3);
1154m_Aligner->SetInputMSAs(*m_Align1, *m_Align2, repr, repr,
m_Scope);
1168BOOST_CHECK_THROW(m_Aligner->SetInputMSAs(*m_Align1, *m_Align2, repr, repr,
1176repr.
insert(m_Align1->CheckNumRows());
1177BOOST_CHECK_THROW(m_Aligner->SetInputMSAs(*m_Align1, *m_Align2, repr, repr,
1185vector< CRef<CSeq_id> > expected_queries;
1187 string id= (*it)->GetId()->AsFastaString();
1192m_Options->SetUseQueryClusters(
false);
1193m_Options->SetRpsEvalue(0.1);
1196m_Aligner->SetQueries(m_Sequences,
m_Scope);
1204BOOST_REQUIRE_EQUAL(m_Options->GetUseQueryClusters(),
false);
1205BOOST_REQUIRE(
fabs(m_Options->GetRpsEvalue() - 0.1) < 0.01);
1213BOOST_REQUIRE_EQUAL(expected_queries.size(),
1214m_Aligner->GetQueries().size());
1216 for(
size_t i=0;
i< expected_queries.size();
i++) {
1217BOOST_REQUIRE(expected_queries[
i]->CompareOrdered(
1218*m_Aligner->GetQueries()[
i]->GetId()) == 0);
1222vector<bool> expected_is_domain_searched(m_Sequences.size(),
false);
1223expected_is_domain_searched[0] =
true;
1224expected_is_domain_searched[2] =
true;
1226BOOST_REQUIRE_EQUAL(expected_is_domain_searched.size(),
1229 for(
size_t i=0;
i< expected_is_domain_searched.size();
i++) {
1230BOOST_REQUIRE_EQUAL(expected_is_domain_searched[
i],
1237 const size_tkNumExpectedPreHits = 7;
1238vector<SHit> expected_hits(kNumExpectedPreHits);
1241expected_hits[0].query =
"lcl|1buc_A";
1242expected_hits[0].subject = 1;
1243expected_hits[0].query_range =
TRange(6, 382);
1244expected_hits[0].subject_range =
TRange(0, 372);
1245expected_hits[0].score = 1414;
1248expected_hits[1].query =
"lcl|1buc_A";
1249expected_hits[1].subject = 0;
1250expected_hits[1].query_range =
TRange(95, 377);
1251expected_hits[1].subject_range =
TRange(42, 325);
1252expected_hits[1].score = 885;
1255expected_hits[2].query =
"lcl|1buc_A";
1256expected_hits[2].subject = 2;
1257expected_hits[2].query_range =
TRange(1, 382);
1258expected_hits[2].subject_range =
TRange(19, 405);
1259expected_hits[2].score = 718;
1262expected_hits[3].query =
"lcl|Q8jzn5";
1263expected_hits[3].subject = 2;
1264expected_hits[3].query_range =
TRange(41, 448);
1265expected_hits[3].subject_range =
TRange(0, 408);
1266expected_hits[3].score = 1779;
1269expected_hits[4].query =
"lcl|Q8jzn5";
1270expected_hits[4].subject = 1;
1271expected_hits[4].query_range =
TRange(88, 440);
1272expected_hits[4].subject_range =
TRange(22, 367);
1273expected_hits[4].score = 981;
1276expected_hits[5].query =
"lcl|Q8jzn5";
1277expected_hits[5].subject = 0;
1278expected_hits[5].query_range =
TRange(151, 440);
1279expected_hits[5].subject_range =
TRange(42, 325);
1280expected_hits[5].score = 872;
1283expected_hits[6].query =
"lcl|Q8jzn5";
1284expected_hits[6].subject = 0;
1285expected_hits[6].query_range =
TRange(511, 581);
1286expected_hits[6].subject_range =
TRange(208, 280);
1287expected_hits[6].score = 75;
1294BOOST_REQUIRE_MESSAGE(hits_match, errors);
1301m_Aligner->SetInterruptCallback(
1305 const size_tkNumExpectedHits = 10;
1306BOOST_REQUIRE(kNumExpectedHits > kNumExpectedPreHits);
1307expected_hits.resize(kNumExpectedHits);
1311expected_hits[7].query =
"lcl|Q10535";
1312expected_hits[7].subject = 2;
1313expected_hits[7].query_range =
TRange(27, 432);
1314expected_hits[7].subject_range =
TRange(0, 400);
1315expected_hits[7].score = 768;
1318expected_hits[8].query =
"lcl|Q10535";
1319expected_hits[8].subject = 0;
1320expected_hits[8].query_range =
TRange(138, 433);
1321expected_hits[8].subject_range =
TRange(42, 326);
1322expected_hits[8].score = 738;
1325expected_hits[9].query =
"lcl|Q10535";
1326expected_hits[9].subject = 1;
1327expected_hits[9].query_range =
TRange(75, 434);
1328expected_hits[9].subject_range =
TRange(24, 369);
1329expected_hits[9].score = 704;
1335BOOST_REQUIRE_MESSAGE(hits_match, errors);
1341vector< CRef<CSeq_id> > expected_queries;
1343 string id= (*it)->GetId()->AsFastaString();
1348m_Options->SetUseQueryClusters(
false);
1349m_Options->SetRpsEvalue(0.1);
1352m_Aligner->SetQueries(m_Sequences,
m_Scope);
1355BOOST_REQUIRE_EQUAL(m_Options->GetUseQueryClusters(),
false);
1356BOOST_REQUIRE(
fabs(m_Options->GetRpsEvalue() - 0.1) < 0.01);
1364BOOST_REQUIRE_EQUAL(expected_queries.size(),
1365m_Aligner->GetQueries().size());
1367 for(
size_t i=0;
i< expected_queries.size();
i++) {
1368BOOST_REQUIRE(expected_queries[
i]->CompareOrdered(
1369*m_Aligner->GetQueries()[
i]->GetId()) == 0);
1373vector<bool> expected_is_domain_searched(m_Sequences.size(),
false);
1374expected_is_domain_searched[0] =
true;
1375expected_is_domain_searched[2] =
true;
1377BOOST_REQUIRE_EQUAL(expected_is_domain_searched.size(),
1380 for(
size_t i=0;
i< expected_is_domain_searched.size();
i++) {
1381BOOST_REQUIRE_EQUAL(expected_is_domain_searched[
i],
1388 const size_tkNumExpectedPreHits = 7;
1389vector<SHit> expected_hits(kNumExpectedPreHits);
1392expected_hits[0].query =
"lcl|1buc_A";
1393expected_hits[0].subject = 1;
1394expected_hits[0].query_range =
TRange(6, 382);
1395expected_hits[0].subject_range =
TRange(0, 372);
1396expected_hits[0].score = 1414;
1399expected_hits[1].query =
"lcl|1buc_A";
1400expected_hits[1].subject = 0;
1401expected_hits[1].query_range =
TRange(95, 377);
1402expected_hits[1].subject_range =
TRange(42, 325);
1403expected_hits[1].score = 885;
1406expected_hits[2].query =
"lcl|1buc_A";
1407expected_hits[2].subject = 2;
1408expected_hits[2].query_range =
TRange(1, 382);
1409expected_hits[2].subject_range =
TRange(19, 405);
1410expected_hits[2].score = 718;
1413expected_hits[3].query =
"lcl|Q8jzn5";
1414expected_hits[3].subject = 2;
1415expected_hits[3].query_range =
TRange(41, 448);
1416expected_hits[3].subject_range =
TRange(0, 408);
1417expected_hits[3].score = 1779;
1420expected_hits[4].query =
"lcl|Q8jzn5";
1421expected_hits[4].subject = 1;
1422expected_hits[4].query_range =
TRange(88, 440);
1423expected_hits[4].subject_range =
TRange(22, 367);
1424expected_hits[4].score = 981;
1427expected_hits[5].query =
"lcl|Q8jzn5";
1428expected_hits[5].subject = 0;
1429expected_hits[5].query_range =
TRange(151, 440);
1430expected_hits[5].subject_range =
TRange(42, 325);
1431expected_hits[5].score = 872;
1434expected_hits[6].query =
"lcl|Q8jzn5";
1435expected_hits[6].subject = 0;
1436expected_hits[6].query_range =
TRange(511, 581);
1437expected_hits[6].subject_range =
TRange(208, 280);
1438expected_hits[6].score = 75;
1445BOOST_REQUIRE_MESSAGE(hits_match, errors);
1452m_Aligner->SetInterruptCallback(
1456 const size_tkNumExpectedHits = 10;
1457BOOST_REQUIRE(kNumExpectedHits > kNumExpectedPreHits);
1458expected_hits.resize(kNumExpectedHits);
1462expected_hits[7].query =
"lcl|Q10535";
1463expected_hits[7].subject = 2;
1464expected_hits[7].query_range =
TRange(27, 432);
1465expected_hits[7].subject_range =
TRange(0, 400);
1466expected_hits[7].score = 768;
1469expected_hits[8].query =
"lcl|Q10535";
1470expected_hits[8].subject = 0;
1471expected_hits[8].query_range =
TRange(138, 433);
1472expected_hits[8].subject_range =
TRange(42, 326);
1473expected_hits[8].score = 738;
1476expected_hits[9].query =
"lcl|Q10535";
1477expected_hits[9].subject = 1;
1478expected_hits[9].query_range =
TRange(75, 434);
1479expected_hits[9].subject_range =
TRange(24, 369);
1480expected_hits[9].score = 704;
1486BOOST_REQUIRE_MESSAGE(hits_match, errors);
1492m_Options->SetUseQueryClusters(
false);
1496vector< CRef<CSeq_loc> > queries;
1497queries.push_back(m_Sequences.back());
1498queries.push_back(m_Sequences.back());
1501m_Aligner->SetQueries(queries,
m_Scope);
1517vector< CRef<CSeq_loc> > queries;
1519seq->
SetWhole().Set(
"gi|129295");
1520queries.push_back(seq);
1521queries.push_back(seq);
1524m_Options->SetRpsEvalue(10);
1525m_Options->SetUseQueryClusters(
false);
1532m_Aligner->SetQueries(queries,
m_Scope);
1543m_Options->SetRpsEvalue(0.00001);
1547m_Aligner->SetQueries(queries,
m_Scope);
1554BOOST_REQUIRE_EQUAL(
1564m_Options->SetUseQueryClusters(
false);
1565m_Options->SetDomainHits(m_RpsArchive);
1566BOOST_REQUIRE(m_Options->Validate());
1568m_Aligner->SetQueries(m_Sequences,
m_Scope);
1575m_Options->SetUseQueryClusters(
true);
1576BOOST_REQUIRE(m_Options->CanGetDomainHits());
1578m_Aligner->SetQueries(m_Sequences,
m_Scope);
1587m_Options->SetRpsEvalue(10);
1588m_Options->SetDomainHits(m_RpsArchive);
1589BOOST_REQUIRE(m_Options->Validate());
1595m_Aligner->SetInputMSAs(*m_Align1, *m_Align2, repr, repr,
m_Scope);
1605BOOST_REQUIRE(m_Options->CanGetDomainHits());
1608m_Aligner->SetInputMSAs(*m_Align1, *m_Align2, repr, repr,
m_Scope);
1618m_Options->SetUseQueryClusters(
false);
1620m_Aligner->SetQueries(m_Sequences,
m_Scope);
1624 CNcbiIfstreamistr(
"data/rps_archive_subjectnotindb.asn");
1625BOOST_REQUIRE(istr);
1634(
string)
"lcl|1buc_A");
1636(
string)
"gnl|CDD|273847");
1646m_Options->SetUseQueryClusters(
false);
1648m_Aligner->SetQueries(m_Sequences,
m_Scope);
1651 CPssm& pssm = m_RpsArchive->SetRequest().SetBody().SetQueue_search()
1652.SetQueries().SetPssm().SetPssm();
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.
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.
CLocalRange< TOffset > TRange
define for the fundamental building block of sequence ranges
BOOST_AUTO_TEST_SUITE_END() static int s_GetSegmentFlags(const CBioseq &bioseq)
vector< TSingleCluster > TClusters
void RemovePureGapSegs()
Remove any segments in which every row has a gap (these can arise when ExtractRows is used)
void Compact()
Join adjacent mergeable segments to create a more compact alignment.
An ordered collection of CHit objects.
int Size() const
Retrieve number of hits in list.
CHit * GetHit(int index)
Retrieve a hit from the hitlist.
A generalized representation of a pairwise alignment.
int m_Score
Score of alignment.
int m_SeqIndex1
Numerical identifier for first sequence in alignment.
int m_SeqIndex2
Numerical identifier for second sequence in alignment.
TRange m_SeqRange1
The range of offsets on the first sequence.
TRange m_SeqRange2
The range of offsets on the second sequence.
Fixture class initialized for each multialigner test.
static CRef< CBlast4_archive > m_RpsArchive
static CRef< CObjectManager > m_Objmgr
static void Initialize(void)
Initialize static attributes.
static CRef< CScope > m_Scope
CRef< CMultiAlignerOptions > m_Options
static vector< CRef< CSeq_loc > > m_Sequences
static void x_ReadSequences(void)
Read test sequences in FASTA format from file.
static void x_InitScope(void)
Initialize scope.
static void x_ReadAlignments(void)
Read test MSAs from files.
static void x_ReadRpsArchive(void)
Read test RPS-BLAST output in the archive format from file.
CMultiAlignerFixture(void)
static CRef< CSeq_align > m_Align2
CRef< CMultiAligner > m_Aligner
static void Finalize(void)
Release static attributes.
static CRef< CSeq_align > m_Align1
Options and parameters for multiple alignement.
void SetRpsDb(const string &dbname)
Use RPS Blast with given database.
const TConstraints & GetUserConstraints(void) const
Get user constraints.
@ fNoQueryClusters
No query clustering.
@ fNoRpsBlast
Do not use RPS Blast.
vector< SConstraint > TConstraints
Test class for accessing CMultiAligner private attributes and methods.
static void SetDomainHits(CMultiAligner &aligner, CConstRef< CBlast4_archive > archive)
Set pre-computed domain hits without invoking CMlultiAligner::Run()
static bool InterruptAfterRpsBlastSearch(CMultiAligner::SProgress *progress)
Quit after doing RPS-BLAST search.
static void SetQuerySeqlocs(CMultiAligner &aligner, const vector< CRef< CSeq_loc > > &queries)
Set queries in the aligner only as Seq-locs do not retrieve sequences.
static const vector< bool > & GetIsDomainSearched(const CMultiAligner &aligner)
static const CHitList & GetDomainHits(const CMultiAligner &aligner)
static bool CompareDomainHits(const vector< SHit > &expected_hits, const CMultiAligner &aligner, string &err)
Compare domain hits in CMultiAligner with reference alignements.
Simultaneously align multiple protein sequences.
CConstRef< CMultiAlignerOptions > GetOptions(void) const
Get mutli aligner parameters.
const vector< CSequence > & GetSeqResults(void) const
Retrieve the current aligned results in CSequence format.
const vector< CRef< objects::CSeq_loc > > & GetQueries(void) const
Get query sequences.
CRef< objects::CSeq_align > GetResults(void) const
Retrieve the current aligned results in Seq-align format.
vector< CRef< objects::CSeq_loc > > m_tQueries
TStatus Run(void)
Align the current set of input sequences (reset any existing alignment information).
const TPhyTreeNode * GetTree(void) const
Get ree used guide in progressive alignment.
@ eOutOfMemory
Out of memory error.
@ eSuccess
Alignment successfully completed.
@ eInterrupt
Alignment interruped through callback function.
const CClusterer::TClusters & GetQueryClusters(void) const
Get clusters of query sequences.
vector< bool > m_IsDomainSearched
Marks sequences with pre-computed domain hits.
void SetQueries(const vector< CRef< objects::CSeq_loc > > &queries, CRef< objects::CScope > scope)
Set query sequences.
CRef< objects::CScope > GetScope(void)
Get scope.
void x_SetDomainHits(const blast::TSeqLocVector &queruies, const vector< int > &indices, const objects::CBlast4_archive &archive)
Set pre-computed domain hits using BLAST archive format.
CRef< objects::CBioTreeContainer > GetTreeContainer(void) const
Get serializable tree used as guide in progressive alignment.
void x_CreateBlastQueries(blast::TSeqLocVector &queries, vector< int > &indices)
Create query set for RPS Blast and Blastp searches along with indices in multiple alignment queries a...
const CSeq_id & GetSeq_id(TDim row) const
Get seq-id (the first one if segments have different ids).
static const unsigned char kGapChar
The ncbistdaa code for a gap.
definition of a Culling tree
iterator_bool insert(const value_type &val)
Interface for CMultiAligner.
int ReadFastaQueries(const string &filename, vector< CRef< objects::CSeq_loc > > &seqs, CRef< objects::CScope > &scope, bool parse_deflines, objects::CSeqIdGenerator *id_generator)
int ReadMsa(const string &filename, CRef< CSeq_align > &align, CRef< CScope > scope, bool parse_deflines, objects::CSeqIdGenerator *id_generator)
static void s_TestResultAlignment(const vector< CRef< CSeq_loc > > &queries, const CRef< CSeq_align > &seqalign, const vector< CSequence > &seqs, CRef< CScope > scope, const string &aln_ref="")
static void s_TestResultTreeContainer(int num_queries, const CBioTreeContainer &btc)
static void s_TestResults(CMultiAligner &aligner, const string &ref_aln="")
BOOST_AUTO_TEST_CASE(TestSetQueries)
static bool s_Interrupt(CMultiAligner::SProgress *progress)
static void s_MakeBioseqs(const vector< CRef< CSeq_loc > > &seqlocs, CRef< CScope > scope, vector< CRef< CBioseq > > &bioseqs)
void s_TestAlignmentFromMSAs(CRef< CSeq_align > result, CRef< CSeq_align > in_first, CRef< CSeq_align > in_second)
static void s_TestResultTree(int num_queries, const TPhyTreeNode *tree)
static void s_TestQueriesAsBioseqs(const vector< CRef< CBioseq > > &bioseqs)
static void s_TestQueriesAsSeq_locs(const vector< CRef< CSeq_loc > > &seqlocs, CRef< CScope > scope)
static void s_TestResultClusters(int num_queries, const CClusterer::TClusters &clusters, const CMultiAlignerOptions::TConstraints &constraints)
static void s_TestTree(vector< bool > &queries, const TPhyTreeNode *node)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
#define MSerial_AsnText
I/O stream manipulators â.
const string AsFastaString(void) const
bool Match(const CSeq_id &sid2) const
Match() - TRUE if SeqIds are equivalent.
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
TSeqPos GetLength(const CSeq_id &id, CScope *scope)
Get sequence length if scope not null, else return max possible TSeqPos.
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
void AddDefaults(TPriority pri=kPriority_Default)
Add default data loaders from object manager.
CConstRef< CBioseq > GetCompleteBioseq(void) const
Get the complete bioseq.
CConstRef< CSeq_id > GetSeqId(void) const
Get id which can be used to access this bioseq handle Throws an exception if none is available.
TObjectType * GetNonNullPointer(void)
Get pointer value and throw a null pointer exception if pointer is null.
bool Empty(void) const THROWS_NONE
Check if CConstRef is empty â not pointing to any object which means having a null value.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
TObjectType * GetNonNullPointer(void) const
Get pointer value and throw a null pointer exception if pointer is null.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
static int StringToInt(const CTempString str, TStringToNumFlags flags=0, int base=10)
Convert string to int.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static string UIntToString(unsigned int value, TNumToStringFlags flags=0, int base=10)
Convert UInt to string.
TNodeList_CI SubNodeBegin(void) const
Return first const iterator on subnode list.
TNodeList::const_iterator TNodeList_CI
bool IsLeaf() const
Report whether this is a leaf node.
TNodeList_CI SubNodeEnd(void) const
Return last const iterator on subnode list.
const TValue & GetValue(void) const
Return node's value.
const TTreeType * GetParent(void) const
Get node's parent.
static const char label[]
list< CRef< CFeatureDescr > > Tdata
list< CRef< CNodeFeature > > Tdata
list< CRef< CNode > > Tdata
const Tdata & Get(void) const
Get the member data.
const Tdata & Get(void) const
Get the member data.
const TFdict & GetFdict(void) const
Get the Fdict member data.
const TNodes & GetNodes(void) const
Get the Nodes member data.
const TAlignments & GetAlignments(void) const
Get the Alignments member data.
const TResults & GetResults(void) const
Get the Results member data.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
void SetNumColumns(TNumColumns value)
Assign a value to NumColumns data member.
void SetNumRows(TNumRows value)
Assign a value to NumRows data member.
const TDenseg & GetDenseg(void) const
Get the variant data.
TLens & SetLens(void)
Assign a value to Lens data member.
const TStarts & GetStarts(void) const
Get the Starts member data.
TDim GetDim(void) const
Get the Dim member data.
void SetSegs(TSegs &value)
Assign a value to Segs data member.
const TLens & GetLens(void) const
Get the Lens member data.
void SetDim(TDim value)
Assign a value to Dim data member.
vector< TSignedSeqPos > TStarts
void SetDim(TDim value)
Assign a value to Dim data member.
void SetType(TType value)
Assign a value to Type data member.
TDim GetDim(void) const
Get the Dim member data.
TStarts & SetStarts(void)
Assign a value to Starts data member.
TType GetType(void) const
Get the Type member data.
void SetNumseg(TNumseg value)
Assign a value to Numseg data member.
const TIds & GetIds(void) const
Get the Ids member data.
TIds & SetIds(void)
Assign a value to Ids 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.
unsigned int
A callback function used to compare two keys in a database.
const struct ncbi::grid::netcache::search::fields::SIZE size
Options for CMultiAligner.
vector< SSeqLoc > TSeqLocVector
Vector of sequence locations.
Structure for reporting alignment progress.
Representation of a hit for computing constraints.
int subject
subject ordinal id in the database
TRange query_range
alignment extents
int score
alignment score
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