arg_desc->AddFlag(
"debug_mode",
137 "Debugging mode writes errors seen for each test");
145 if(args[
"debug_mode"]) {
164BOOST_CHECK_EQUAL(cds.
IsSetPartial(), (partial5 || partial3));
195new_feat.
Reset(prot_entry->
SetSeq().
SetAnnot().front()->SetData().SetFtable().back());
200pnt->
SetId().SetLocal().SetStr(
"prot");
201new_seq_loc->
SetPnt(*pnt);
208 CSeq_loc& seq_loc = (*it)->SetLocation();
209 if(seq_loc.
IsInt()) {
224edit::CLocationEditPolicy policy(edit::CLocationEditPolicy::ePartialPolicy_eNoChange,
225edit::CLocationEditPolicy::ePartialPolicy_eNoChange,
227edit::CLocationEditPolicy::eMergePolicy_NoChange);
234policy.SetPartial5Policy(edit::CLocationEditPolicy::ePartialPolicy_eSetForBadEnd);
235policy.SetPartial3Policy(edit::CLocationEditPolicy::ePartialPolicy_eSetForBadEnd);
241policy.SetPartial5Policy(edit::CLocationEditPolicy::ePartialPolicy_eSet);
246policy.SetPartial5Policy(edit::CLocationEditPolicy::ePartialPolicy_eClear);
247policy.SetPartial3Policy(edit::CLocationEditPolicy::ePartialPolicy_eSet);
252policy.SetPartial5Policy(edit::CLocationEditPolicy::ePartialPolicy_eSetAtEnd);
253policy.SetPartial3Policy(edit::CLocationEditPolicy::ePartialPolicy_eClearNotAtEnd);
258policy.SetPartial5Policy(edit::CLocationEditPolicy::ePartialPolicy_eClearForGoodEnd);
259policy.SetPartial3Policy(edit::CLocationEditPolicy::ePartialPolicy_eSet);
260policy.SetExtend3(
true);
265scope.RemoveTopLevelSeqEntry(seh);
268seh = scope.AddTopLevelSeqEntry(*entry);
269policy.SetPartial5Policy(edit::CLocationEditPolicy::ePartialPolicy_eSetForBadEnd);
270policy.SetExtend5(
true);
271policy.SetPartial3Policy(edit::CLocationEditPolicy::ePartialPolicy_eClearForGoodEnd);
272policy.SetExtend3(
true);
277policy.SetPartial5Policy(edit::CLocationEditPolicy::ePartialPolicy_eClearForGoodEnd);
284scope.RemoveTopLevelSeqEntry(seh);
288seh = scope.AddTopLevelSeqEntry(*entry);
289 stringorig_prot_seq, new_prot_seq;
291policy.SetPartial5Policy(edit::CLocationEditPolicy::ePartialPolicy_eSetForBadEnd);
292policy.SetExtend5(
true);
293policy.SetPartial3Policy(edit::CLocationEditPolicy::ePartialPolicy_eSetForBadEnd);
294policy.SetExtend3(
true);
300BOOST_CHECK_EQUAL(
string(
"M") + orig_prot_seq, new_prot_seq);
301policy.SetPartial5Policy(edit::CLocationEditPolicy::ePartialPolicy_eClearForGoodEnd);
306scope.RemoveTopLevelSeqEntry(seh);
310seh = scope.AddTopLevelSeqEntry(*entry);
311orig_prot_seq = new_prot_seq =
kEmptyStr;
313policy.SetPartial5Policy(edit::CLocationEditPolicy::ePartialPolicy_eSetForBadEnd);
314policy.SetExtend5(
true);
315policy.SetPartial3Policy(edit::CLocationEditPolicy::ePartialPolicy_eSetForBadEnd);
316policy.SetExtend3(
true);
322BOOST_CHECK_EQUAL(
string(
"M") + orig_prot_seq, new_prot_seq);
323policy.SetPartial5Policy(edit::CLocationEditPolicy::ePartialPolicy_eClearForGoodEnd);
328scope.RemoveTopLevelSeqEntry(seh);
332seh = scope.AddTopLevelSeqEntry(*entry);
333policy.SetPartial5Policy(edit::CLocationEditPolicy::ePartialPolicy_eSetForBadEnd);
334policy.SetExtend5(
true);
335policy.SetPartial3Policy(edit::CLocationEditPolicy::ePartialPolicy_eSetForBadEnd);
336policy.SetExtend3(
true);
341policy.SetPartial5Policy(edit::CLocationEditPolicy::ePartialPolicy_eClearForGoodEnd);
346scope.RemoveTopLevelSeqEntry(seh);
350seh = scope.AddTopLevelSeqEntry(*entry);
351policy.SetPartial5Policy(edit::CLocationEditPolicy::ePartialPolicy_eSetForBadEnd);
352policy.SetExtend5(
true);
353policy.SetPartial3Policy(edit::CLocationEditPolicy::ePartialPolicy_eSetForBadEnd);
354policy.SetExtend3(
true);
360scope.RemoveTopLevelSeqEntry(seh);
364seh = scope.AddTopLevelSeqEntry(*entry);
365orig_prot_seq = new_prot_seq =
kEmptyStr;
367policy.SetPartial5Policy(edit::CLocationEditPolicy::ePartialPolicy_eSet);
368policy.SetExtend5(
true);
369policy.SetPartial3Policy(edit::CLocationEditPolicy::ePartialPolicy_eNoChange);
370policy.SetExtend3(
false);
375BOOST_CHECK_EQUAL(orig_prot_seq, new_prot_seq);
378scope.RemoveTopLevelSeqEntry(seh);
383policy.SetPartial5Policy(edit::CLocationEditPolicy::ePartialPolicy_eClear);
384policy.SetPartial3Policy(edit::CLocationEditPolicy::ePartialPolicy_eClear);
385policy.SetExtend5(
false);
386policy.SetExtend3(
false);
391policy.SetPartial5Policy(edit::CLocationEditPolicy::ePartialPolicy_eSet);
392policy.SetPartial3Policy(edit::CLocationEditPolicy::ePartialPolicy_eSet);
393policy.SetExtend5(
true);
394policy.SetExtend3(
true);
401policy.SetPartial5Policy(edit::CLocationEditPolicy::ePartialPolicy_eClear);
402policy.SetPartial3Policy(edit::CLocationEditPolicy::ePartialPolicy_eClear);
407policy.SetPartial5Policy(edit::CLocationEditPolicy::ePartialPolicy_eSetForBadEnd);
408policy.SetPartial3Policy(edit::CLocationEditPolicy::ePartialPolicy_eSetForBadEnd);
436 id->Assign(*(imp->GetLocation().GetId()));
439imp->SetLocation().SetInt().SetFrom(0);
440imp->SetLocation().SetInt().SetTo(15);
453imp->SetLocation().SetPnt().SetId().Assign(*
id);
454imp->SetLocation().SetPnt().SetPoint(15);
513 id->Assign(*(cds->GetLocation().GetId()));
514cb->
SetLoc().SetInt().SetId(*
id);
515cb->
SetLoc().SetInt().SetFrom(3);
516cb->
SetLoc().SetInt().SetTo(5);
517cds->SetData().SetCdregion().SetCode_break().push_back(cb);
537BOOST_CHECK_EQUAL(interval.
GetFrom(), from);
538BOOST_CHECK_EQUAL(interval.
GetTo(), to);
544vector<TSeqPos>::iterator from_it = from.begin();
545vector<TSeqPos>::iterator to_it = to.begin();
549 while(from_it != from.end()) {
551interval->
SetId().Assign(
id);
553interval->
SetTo(*to_it);
563BOOST_CHECK_EQUAL(
pack.Get().size(), from.size());
564BOOST_CHECK_EQUAL(
pack.Get().size(), to.size());
565CPacked_seqint::Tdata::const_iterator lit =
pack.Get().begin();
566vector<TSeqPos>::iterator from_it = from.begin();
567vector<TSeqPos>::iterator to_it = to.begin();
568 while(lit !=
pack.Get().end()) {
580vector<TSeqPos>::iterator from_it = from.begin();
581vector<TSeqPos>::iterator to_it = to.begin();
583loc.
SetMix().Set().clear();
585 while(from_it != from.end()) {
587 if(*from_it == *to_it) {
588sub->
SetPnt().SetId().Assign(
id);
589sub->
SetPnt().SetPoint(*from_it);
591sub->
SetInt().SetId().Assign(
id);
592sub->
SetInt().SetFrom(*from_it);
593sub->
SetInt().SetTo(*to_it);
595loc.
SetMix().Set().push_back(sub);
605vector<TSeqPos>::iterator from_it = from.begin();
606vector<TSeqPos>::iterator to_it = to.begin();
622 id->SetLocal().SetStr(
"nuc1");
625loc->
SetInt().SetId().Assign(*
id);
626loc->
SetInt().SetFrom(10);
627loc->
SetInt().SetTo(50);
631 booladjusted =
false;
635BOOST_CHECK_EQUAL(cut,
false);
636BOOST_CHECK_EQUAL(adjusted,
false);
637BOOST_CHECK_EQUAL(trim5, 0);
645BOOST_CHECK_EQUAL(cut,
false);
646BOOST_CHECK_EQUAL(adjusted,
true);
647BOOST_CHECK_EQUAL(trim5, 0);
655BOOST_CHECK_EQUAL(cut,
false);
656BOOST_CHECK_EQUAL(adjusted,
true);
657BOOST_CHECK_EQUAL(trim5, 0);
665BOOST_CHECK_EQUAL(cut,
false);
666BOOST_CHECK_EQUAL(adjusted,
true);
667BOOST_CHECK_EQUAL(trim5, 5);
675BOOST_CHECK_EQUAL(cut,
false);
676BOOST_CHECK_EQUAL(adjusted,
true);
677BOOST_CHECK_EQUAL(trim5, 0);
685BOOST_CHECK_EQUAL(cut,
true);
688loc->
SetPnt().SetId().Assign(*
id);
689loc->
SetPnt().SetPoint(10);
696BOOST_CHECK_EQUAL(cut,
false);
697BOOST_CHECK_EQUAL(adjusted,
false);
698BOOST_CHECK_EQUAL(trim5, 0);
706BOOST_CHECK_EQUAL(cut,
false);
707BOOST_CHECK_EQUAL(adjusted,
true);
708BOOST_CHECK_EQUAL(trim5, 0);
716BOOST_CHECK_EQUAL(cut,
true);
717BOOST_CHECK_EQUAL(trim5, 1);
720vector<TSeqPos> from;
736BOOST_CHECK_EQUAL(cut,
false);
737BOOST_CHECK_EQUAL(adjusted,
false);
738BOOST_CHECK_EQUAL(trim5, 0);
747BOOST_CHECK_EQUAL(cut,
false);
748BOOST_CHECK_EQUAL(adjusted,
true);
749BOOST_CHECK_EQUAL(trim5, 0);
759BOOST_CHECK_EQUAL(cut,
false);
760BOOST_CHECK_EQUAL(adjusted,
true);
761BOOST_CHECK_EQUAL(trim5, 0);
771BOOST_CHECK_EQUAL(cut,
false);
772BOOST_CHECK_EQUAL(adjusted,
true);
773BOOST_CHECK_EQUAL(trim5, 0);
785BOOST_CHECK_EQUAL(cut,
false);
786BOOST_CHECK_EQUAL(adjusted,
true);
787BOOST_CHECK_EQUAL(trim5, 0);
801BOOST_CHECK_EQUAL(cut,
false);
802BOOST_CHECK_EQUAL(adjusted,
true);
803BOOST_CHECK_EQUAL(trim5, 5);
811BOOST_CHECK_EQUAL(cut,
true);
830BOOST_CHECK_EQUAL(cut,
false);
831BOOST_CHECK_EQUAL(adjusted,
false);
832BOOST_CHECK_EQUAL(trim5, 0);
841BOOST_CHECK_EQUAL(cut,
false);
842BOOST_CHECK_EQUAL(adjusted,
true);
843BOOST_CHECK_EQUAL(trim5, 0);
853BOOST_CHECK_EQUAL(cut,
false);
854BOOST_CHECK_EQUAL(adjusted,
true);
855BOOST_CHECK_EQUAL(trim5, 0);
865BOOST_CHECK_EQUAL(cut,
false);
866BOOST_CHECK_EQUAL(adjusted,
true);
867BOOST_CHECK_EQUAL(trim5, 0);
879BOOST_CHECK_EQUAL(cut,
false);
880BOOST_CHECK_EQUAL(adjusted,
true);
881BOOST_CHECK_EQUAL(trim5, 0);
895BOOST_CHECK_EQUAL(cut,
false);
896BOOST_CHECK_EQUAL(adjusted,
true);
897BOOST_CHECK_EQUAL(trim5, 5);
905BOOST_CHECK_EQUAL(cut,
true);
913 id->SetLocal().SetStr(
"nuc1");
916loc->
SetInt().SetId().Assign(*
id);
917loc->
SetInt().SetFrom(10);
918loc->
SetInt().SetTo(50);
933loc->
SetPnt().SetId().Assign(*
id);
934loc->
SetPnt().SetPoint(10);
946vector<TSeqPos> from;
962 for(vector<TSeqPos>::iterator it = from.begin(); it != from.end(); ++it) {
965 for(vector<TSeqPos>::iterator it = to.begin(); it != to.end(); ++it) {
978vector<TSeqPos>::iterator fit = from.begin();
980 while(fit != from.end()) {
984 for(vector<TSeqPos>::iterator it = to.begin(); it != to.end(); ++it) {
1006 for(vector<TSeqPos>::iterator it = from.begin(); it != from.end(); ++it) {
1009 for(vector<TSeqPos>::iterator it = to.begin(); it != to.end(); ++it) {
1024 while(fit != from.end()) {
1028 for(vector<TSeqPos>::iterator it = to.begin(); it != to.end(); ++it) {
1041 id->SetLocal().SetStr(
"nuc1");
1049loc1->
SetInt().SetId().Assign(*
id);
1050loc1->
SetInt().SetFrom(10);
1051loc1->
SetInt().SetTo(50);
1064loc1->
SetInt().SetId().Assign(*
id);
1065loc1->
SetInt().SetFrom(10);
1066loc1->
SetInt().SetTo(50);
1073loc1->
SetPnt().SetId().Assign(*
id);
1074loc1->
SetPnt().SetPoint(10);
1088vector<TSeqPos> from;
1116after_from = from.back();
1117after_to = to.back();
1137 TSeqPosbefore_from = from[0];
1170after_from = from.back();
1171after_to = to.back();
1191before_from = from[0];
1203 id->SetLocal().SetStr(
"nuc1");
1210vector<TSeqPos> from, to;
1211from.push_back(0); to.push_back(24);
1212from.push_back(29); to.push_back(34);
1213from.push_back(39); to.push_back(49);
1214from.push_back(51); to.push_back(59);
1224vector<TSeqPos> after_from, after_to;
1225after_from.push_back(20); after_to.push_back(24);
1226after_from.push_back(29); after_to.push_back(34);
1227after_from.push_back(39); after_to.push_back(49);
1228after_from.push_back(51); after_to.push_back(59);
1247 id->SetLocal().SetStr(
"nuc1");
1256vector<TSeqPos> from, to;
1257from.push_back(69); to.push_back(79);
1258from.push_back(49); to.push_back(59);
1259from.push_back(24); to.push_back(39);
1260from.push_back(0); to.push_back(19);
1270vector<TSeqPos> after_from, after_to;
1271after_from.push_back(69); after_to.push_back(79);
1272after_from.push_back(49); after_to.push_back(59);
1273after_from.push_back(24); after_to.push_back(39);
1274after_from.push_back(14); after_to.push_back(19);
1295 id->SetLocal().SetStr(
"nuc1");
1304vector<TSeqPos> from, to;
1305from.push_back(48); to.push_back(64);
1306from.push_back(39); to.push_back(44);
1307from.push_back(19); to.push_back(34);
1308from.push_back(0); to.push_back(14);
1315vector<TSeqPos> after_from, after_to;
1316after_from.push_back(48); after_to.push_back(50);
1317after_from.push_back(39); after_to.push_back(44);
1318after_from.push_back(19); after_to.push_back(34);
1319after_from.push_back(0); after_to.push_back(14);
1347BOOST_ASSERT(found_gene.GetPointer() ==
NULL);
1349scope.RemoveTopLevelSeqEntry(seh);
1351gene->
SetData().SetGene().SetLocus(
"A");
1353seh = scope.AddTopLevelSeqEntry(*entry);
1355BOOST_ASSERT(found_gene.GetPointer() == gene.
GetPointer());
1358scope.RemoveTopLevelSeqEntry(seh);
1360gene2->
SetData().SetGene().SetLocus(
"B");
1362imp->
SetId().SetLocal().SetId(1);
1363gene->
SetId().SetLocal().SetId(2);
1364gene2->
SetId().SetLocal().SetId(3);
1366seh = scope.AddTopLevelSeqEntry(*entry);
1368BOOST_ASSERT(found_gene.GetPointer() == gene2.
GetPointer());
1371scope.RemoveTopLevelSeqEntry(seh);
1376gene->
SetData().SetGene().SetLocus(
"A");
1379imp->
SetId().SetLocal().SetId(1);
1380imp2->
SetId().SetLocal().SetId(2);
1381gene->
SetId().SetLocal().SetId(3);
1383seh = scope.AddTopLevelSeqEntry(*entry);
1386BOOST_ASSERT(found_gene.GetPointer() == gene.
GetPointer());
1399 a->SetInt().SetFrom(50);
1400 a->SetInt().SetTo(60);
1401 a->SetInt().SetId().Assign(*id_a);
1406 b->SetInt().SetFrom(40);
1407 b->SetInt().SetTo(43);
1408 b->SetInt().SetId().Assign(*id_a);
1411c->
SetMix().Set().push_back(
a);
1412c->
SetMix().Set().push_back(
b);
1415BOOST_CHECK_EQUAL(
a->Equals(*(c->
GetMix().
Get().back())),
true);
1416BOOST_CHECK_EQUAL(
b->Equals(*(c->
GetMix().
Get().front())),
true);
1427BOOST_CHECK_EQUAL(
a->Equals(*(c->
GetMix().
Get().front())),
true);
1428BOOST_CHECK_EQUAL(
b->Equals(*(c->
GetMix().
Get().back())),
true);
1431d->
SetPnt().SetId().Assign(*id_b);
1432d->
SetPnt().SetPoint(70);
1434c->
SetMix().Set().push_back(d);
1437d->
SetPnt().SetId().Assign(*id_a);
1440BOOST_CHECK_EQUAL(d->
Equals(*(c->
GetMix().
Get().front())),
true);
1441BOOST_CHECK_EQUAL(
b->Equals(*(c->
GetMix().
Get().back())),
true);
1447BOOST_CHECK_EQUAL(
b->Equals(*(c->
GetMix().
Get().front())),
true);
1448BOOST_CHECK_EQUAL(d->
Equals(*(c->
GetMix().
Get().back())),
true);
1456BOOST_CHECK_EQUAL(e->
SetPacked_pnt().SetPoints().front(), 34);
1457BOOST_CHECK_EQUAL(e->
SetPacked_pnt().SetPoints().back(), 36);
1460c->
SetMix().Set().push_back(e);
1465BOOST_CHECK_EQUAL(e->
Equals(*(c->
GetMix().
Get().front())),
true);
1466BOOST_CHECK_EQUAL(d->
Equals(*(c->
GetMix().
Get().back())),
true);
1470BOOST_CHECK_EQUAL(e->
SetPacked_pnt().SetPoints().front(), 36);
1471BOOST_CHECK_EQUAL(e->
SetPacked_pnt().SetPoints().back(), 34);
1477BOOST_CHECK_EQUAL(e->
Equals(*(c->
GetMix().
Get().back())),
true);
1478BOOST_CHECK_EQUAL(d->
Equals(*(c->
GetMix().
Get().front())),
true);
1484 f->SetPacked_int().Set().push_back(f1);
1485 f->SetPacked_int().Set().push_back(f2);
1486 f->SetPacked_int().Set().push_back(f3);
1488BOOST_CHECK_EQUAL(
f->SetPacked_int().Set().front()->GetFrom(), 77);
1489BOOST_CHECK_EQUAL(
f->SetPacked_int().Set().back()->GetTo(), 90);
1495BOOST_CHECK_EQUAL(
f->SetPacked_int().Set().back()->GetFrom(), 77);
1496BOOST_CHECK_EQUAL(
f->SetPacked_int().Set().front()->GetTo(), 90);
1499c->
SetMix().Set().push_back(
f);
1501BOOST_CHECK_EQUAL(e->
Equals(*(c->
GetMix().
Get().back())),
true);
1502BOOST_CHECK_EQUAL(
f->Equals(*(c->
GetMix().
Get().front())),
true);
1510edit::CLocationEditPolicy::EPartialPolicy policy_choice,
1511 boolexpect_set5,
boolexpect_clear5,
1512 boolextend =
false)
1516 booldo_set_5_partial =
false;
1517 booldo_clear_5_partial =
false;
1519policy->SetPartial5Policy(policy_choice);
1521policy->SetExtend5(
true);
1523BOOST_CHECK_EQUAL((expect_set5 || expect_clear5),
1524policy->Interpret5Policy(imp, scope, do_set_5_partial, do_clear_5_partial));
1525BOOST_CHECK_EQUAL(do_set_5_partial, expect_set5);
1526BOOST_CHECK_EQUAL(do_clear_5_partial, expect_clear5);
1531edit::CLocationEditPolicy::EPartialPolicy policy_choice,
1532 boolexpect_set3,
boolexpect_clear3,
boolextend =
false)
1536 booldo_set_3_partial =
false;
1537 booldo_clear_3_partial =
false;
1539policy->SetPartial3Policy(policy_choice);
1541policy->SetExtend5(
true);
1543BOOST_CHECK_EQUAL((expect_set3 || expect_clear3),
1544policy->Interpret3Policy(imp, scope, do_set_3_partial, do_clear_3_partial));
1545BOOST_CHECK_EQUAL(do_set_3_partial, expect_set3);
1546BOOST_CHECK_EQUAL(do_clear_3_partial, expect_clear3);
1555s = s.substr(0, s.length() - 3) +
"CAT";
1557s =
"ATG"+ s.substr(3);
1561s = s.substr(0, s.length() - 3) +
"AAA";
1563s =
"AAA"+ s.substr(3);
1566seq.
SetInst().SetSeq_data().SetIupacna().Set(s);
1575s =
"TTA"+ s.substr(3);
1577s = s.substr(0, s.length() - 3) +
"TAA";
1581s =
"AAA"+ s.substr(3);
1583s = s.substr(0, s.length() - 3) +
"AAA";
1586seq.
SetInst().SetSeq_data().SetIupacna().Set(s);
1597l1->
SetInt().SetFrom(0);
1599l1->
SetInt().SetId().Assign(*(first_seq.
GetId().front()));
1602l2->
SetInt().SetFrom(0);
1604l2->
SetInt().SetId().Assign(*(last_seq.
GetId().front()));
1606cds->
SetData().SetCdregion();
1612cds->
SetLocation().SetMix().Set().push_back(l2);
1613cds->
SetLocation().SetMix().Set().push_back(l1);
1616cds->
SetLocation().SetMix().Set().push_back(l1);
1617cds->
SetLocation().SetMix().Set().push_back(l2);
1620 if(already_partial) {
1642l2->
SetInt().SetFrom(1);
1646l1->
SetInt().SetFrom(1);
1665edit::CLocationEditPolicy::ePartialPolicy_eNoChange,
1669edit::CLocationEditPolicy::ePartialPolicy_eSetAtEnd,
1670!already_partial,
false);
1673edit::CLocationEditPolicy::ePartialPolicy_eSetForFrame,
1677edit::CLocationEditPolicy::ePartialPolicy_eSetForFrame,
1678!already_partial,
false);
1679cds->
SetData().SetCdregion().ResetFrame();
1682edit::CLocationEditPolicy::ePartialPolicy_eSetForBadEnd,
1683!good_end && !already_partial,
false);
1686edit::CLocationEditPolicy::ePartialPolicy_eClear,
1687 false, already_partial);
1690edit::CLocationEditPolicy::ePartialPolicy_eClearForGoodEnd,
1691 false, good_end & already_partial);
1695edit::CLocationEditPolicy::ePartialPolicy_eClearNotAtEnd,
1699 if(already_partial) {
1700 Check5Policy(*cds, scope, edit::CLocationEditPolicy::ePartialPolicy_eSet,
1701 false,
false,
true);
1707edit::CLocationEditPolicy::ePartialPolicy_eClearNotAtEnd,
1708 false, already_partial);
1711 if(already_partial) {
1712 Check5Policy(*cds, scope, edit::CLocationEditPolicy::ePartialPolicy_eSet,
1713 true,
false,
true);
1727BOOST_CHECK_EQUAL(
false, policy->Extend5(*cds, scope));
1730BOOST_CHECK_EQUAL(
true, policy->Extend5(*cds, scope));
1754BOOST_CHECK_EQUAL(
false, policy->Extend3(*cds, scope));
1768BOOST_CHECK_EQUAL(
true, policy->Extend3(*cds, scope));
1784l1->
SetInt().SetFrom(0);
1786l1->
SetInt().SetId().Assign(*(first_seq.
GetId().front()));
1789l2->
SetInt().SetFrom(0);
1791l2->
SetInt().SetId().Assign(*(last_seq.
GetId().front()));
1793cds->
SetData().SetCdregion();
1799cds->
SetLocation().SetMix().Set().push_back(l2);
1800cds->
SetLocation().SetMix().Set().push_back(l1);
1803cds->
SetLocation().SetMix().Set().push_back(l1);
1804cds->
SetLocation().SetMix().Set().push_back(l2);
1807 if(already_partial) {
1814edit::CLocationEditPolicy::ePartialPolicy_eNoChange,
1818edit::CLocationEditPolicy::ePartialPolicy_eSetAtEnd,
1819!already_partial,
false);
1822edit::CLocationEditPolicy::ePartialPolicy_eSetForFrame,
1826edit::CLocationEditPolicy::ePartialPolicy_eSetForFrame,
1828cds->
SetData().SetCdregion().ResetFrame();
1831edit::CLocationEditPolicy::ePartialPolicy_eSetForBadEnd,
1832!good_end && !already_partial,
false);
1835edit::CLocationEditPolicy::ePartialPolicy_eClear,
1836 false, already_partial);
1839edit::CLocationEditPolicy::ePartialPolicy_eClearForGoodEnd,
1840 false, good_end & already_partial);
1844edit::CLocationEditPolicy::ePartialPolicy_eClearNotAtEnd,
1848 if(already_partial) {
1849 Check3Policy(*cds, scope, edit::CLocationEditPolicy::ePartialPolicy_eSet,
1850 false,
false,
true);
1855l1->
SetInt().SetFrom(1);
1861edit::CLocationEditPolicy::ePartialPolicy_eClearNotAtEnd,
1862 false, already_partial);
1865 if(already_partial) {
1866 Check3Policy(*cds, scope, edit::CLocationEditPolicy::ePartialPolicy_eSet,
1867 true,
false,
true);
1919cds->
SetData().SetCdregion();
1942BOOST_CHECK_EQUAL(after_frame, frame);
1951cds->
SetData().SetCdregion();
1984 boolis_minus=
false) {
1989cds->SetData().SetCdregion();
1991cds->SetLocation().SetInt().SetFrom(range.
GetFrom());
1992cds->SetLocation().SetInt().SetTo(range.
GetTo());
2000 const boolchange_expected =
2015BOOST_CHECK_EQUAL(after_frame, frame);
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.
User-defined methods of the data storage class.
@ eExtreme_Biological
5' and 3'
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.
static CNcbiApplication * Instance(void)
Singleton method.
const TAnnot & GetAnnot(void) const
namespace ncbi::objects::
bool AddSeqFeatXref(const CSeqFeatXref::TId &id)
Seq-loc iterator class â iterates all intervals from a seq-loc in the correct order.
static const char * pack(const char *fmt,...)
unsigned int TSeqPos
Type for sequence locations and lengths.
virtual const CArgs & GetArgs(void) const
Get parsed command line arguments.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
const TPrim & Get(void) const
virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const
Check if both objects contain the same values.
void SetPacked_int(TPacked_int &v)
void SetPacked_pnt(TPacked_pnt &v)
bool IsPartialStart(ESeqLocExtremes ext) const
check start or stop of location for e_Lim fuzz
ENa_strand GetStrand(void) const
Get the location's strand.
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
bool IsSetStrand(EIsSetStrand flag=eIsSetStrand_Any) const
Check if strand is set for any/all part(s) of the seq-loc depending on the flag.
TRange GetRange(void) const
Get the range.
void SetStrand(ENa_strand strand)
Set the strand for all of the location's ranges.
bool IsPartialStop(ESeqLocExtremes ext) const
TSeqPos GetStop(ESeqLocExtremes ext) const
CConstRef< CSeq_feat > GetGeneForFeature(const CSeq_feat &feat, CScope &scope)
Finds gene for feature, but obeys SeqFeatXref directives.
static void Translate(const string &seq, string &prot, const CGenetic_code *code, bool include_stop=true, bool remove_trailing_X=false, bool *alt_start=NULL, bool is_5prime_complete=true, bool is_3prime_complete=true)
Translate a string using a specified genetic code.
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...
const CSeqFeatData & GetData(void) const
CConstRef< CSeq_annot > GetCompleteSeq_annot(void) const
Complete and return const reference to the current seq-annot.
const CSeq_loc & GetLocation(void) const
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
void SetTag(TTag &value)
Assign a value to Tag data member.
TStr & SetStr(void)
Select the variant.
void SetDb(const TDb &value)
Assign a value to Db data member.
void SetLocation(TLocation &value)
Assign a value to Location data member.
const TLoc & GetLoc(void) const
Get the Loc member data.
bool IsSetPartial(void) const
incomplete in some way? Check if a value has been assigned to Partial data member.
const TId & GetId(void) const
Get the Id member data.
const TLocation & GetLocation(void) const
Get the Location member data.
TFrame GetFrame(void) const
Get the Frame member data.
const TData & GetData(void) const
Get the Data member data.
void SetId(TId &value)
Assign a value to Id data member.
void SetData(TData &value)
Assign a value to Data data member.
const TCdregion & GetCdregion(void) const
Get the variant data.
void SetLoc(TLoc &value)
Assign a value to Loc data member.
bool IsSetFrame(void) const
Check if a value has been assigned to Frame data member.
@ eFrame_not_set
not set, code uses one
@ eFrame_three
reading frame
void SetTo(TTo value)
Assign a value to To data member.
TGeneral & SetGeneral(void)
Select the variant.
void SetPoint(TPoint value)
Assign a value to Point data member.
void SetId(TId &value)
Assign a value to Id data member.
ENa_strand
strand of nucleic acid
TStrand GetStrand(void) const
Get the Strand member data.
const TPnt & GetPnt(void) const
Get the variant data.
TPoint GetPoint(void) const
Get the Point member data.
void SetAccession(const TAccession &value)
Assign a value to Accession data member.
void SetId(TId &value)
Assign a value to Id data member.
void SetStrand(TStrand value)
Assign a value to Strand data member.
TFrom GetFrom(void) const
Get the From member data.
E_Choice Which(void) const
Which variant is currently selected.
void SetFrom(TFrom value)
Assign a value to From data member.
const Tdata & Get(void) const
Get the member data.
const TPacked_pnt & GetPacked_pnt(void) const
Get the variant data.
virtual void Reset(void)
Reset the whole object.
TLocal & SetLocal(void)
Select the variant.
const TPoints & GetPoints(void) const
Get the Points member data.
TTo GetTo(void) const
Get the To member data.
TGenbank & SetGenbank(void)
Select the variant.
bool IsInt(void) const
Check if variant Int is selected.
const TInt & GetInt(void) const
Get the variant data.
void SetStrand(TStrand value)
Assign a value to Strand data member.
const TMix & GetMix(void) const
Get the variant data.
const TPacked_int & GetPacked_int(void) const
Get the variant data.
@ e_not_set
No variant selected.
const TSeq & GetSeq(void) const
Get the variant data.
TSet & SetSet(void)
Select the variant.
TAnnot & SetAnnot(void)
Assign a value to Annot data member.
const TSet & GetSet(void) const
Get the variant data.
const TSeq_set & GetSeq_set(void) const
Get the Seq_set member data.
TSeq & SetSeq(void)
Select the variant.
TSeq_set & SetSeq_set(void)
Assign a value to Seq_set data member.
TId & SetId(void)
Assign a value to Id data member.
const TInst & GetInst(void) const
Get the Inst member data.
const TIupacna & GetIupacna(void) const
Get the variant data.
TAnnot & SetAnnot(void)
Assign a value to Annot data member.
const TId & GetId(void) const
Get the Id member data.
TLength GetLength(void) const
Get the Length member data.
void SetInst(TInst &value)
Assign a value to Inst data member.
const TFtable & GetFtable(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
const TSeq_data & GetSeq_data(void) const
Get the Seq_data member data.
bool CorrectIntervalOrder(CSeq_loc &loc)
Correct the order of consecutive intervals with the same Seq-id on the same strand.
@ eSplitLocOption_split_in_intron
@ eSplitLocOption_make_partial
@ eSplitLocOption_split_in_exon
bool ExtendPartialFeatureEnds(CBioseq_Handle bsh)
void ReverseComplementFeature(CSeq_feat &feat, CScope &scope)
bool ApplyPolicyToFeature(const CLocationEditPolicy &policy, const CSeq_feat &orig_feat, CScope &scope, bool adjust_gene, bool retranslate_cds)
bool IsExtendable(const CSeq_feat &cds, CScope &scope)
void SeqLocAdjustForInsert(CSeq_loc &loc, TSeqPos from, TSeqPos to, const CSeq_id *seqid)
string SeqLocPrintUseBestID(const CSeq_loc &seq_loc, CScope &scope, bool range_only=false)
void SplitLocationForGap(CSeq_loc &loc1, CSeq_loc &loc2, size_t start, size_t stop, const CSeq_id *seqid, unsigned int options=eSplitLocOption_make_partial|eSplitLocOption_split_in_exon)
void SeqLocAdjustForTrim(CSeq_loc &loc, TSeqPos from, TSeqPos to, const CSeq_id *seqid, bool &bCompleteCut, TSeqPos &trim5, bool &bAdjusted)
void ReverseComplementLocation(CSeq_loc &loc, CScope &scope)
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
Utility stuff for more convenient using of Boost.Test library.
#define NCBITEST_CHECK_MESSAGE(P, M)
void Check5Policy(CSeq_feat &imp, CScope &scope, edit::CLocationEditPolicy::EPartialPolicy policy_choice, bool expect_set5, bool expect_clear5, bool extend=false)
void s_CheckLocationAndStrandResults(const CSeq_loc &loc, bool partial5, bool partial3, TSeqPos start, TSeqPos stop, ENa_strand strand)
NCBITEST_INIT_CMDLINE(arg_desc)
void TruncateTransSplicedCDSForExtension(CRef< CSeq_entry > entry, bool on_5, bool on_3)
void s_MakeMixLoc(CSeq_loc &loc, const CSeq_id &id, vector< TSeqPos > from, vector< TSeqPos > to)
void Check5Extend(bool good_end, bool is_minus, bool already_partial)
BOOST_AUTO_TEST_CASE(Test_SeqLocPrintUseBestID)
void s_CheckPackedInt(const CPacked_seqint &pack, vector< TSeqPos > from, vector< TSeqPos > to)
void s_MakePackedInt(CSeq_loc &loc, const CSeq_id &id, vector< TSeqPos > from, vector< TSeqPos > to)
void s_CheckLocationResults(const CSeq_loc &loc, bool partial5, bool partial3, TSeqPos start, TSeqPos stop)
void CheckAdjustStop(TSeqPos stop, TSeqPos expect_stop, bool partial_stop, bool is_minus=false)
void s_CheckInterval(const CSeq_interval &interval, TSeqPos from, TSeqPos to)
void s_CheckLocationPolicyResults(const CSeq_feat &cds, bool partial5, bool partial3, TSeqPos start, TSeqPos stop)
void CheckAdjustStart(TSeqPos start, TSeqPos expect_start, bool partial_start, CCdregion::EFrame frame, bool is_minus=false)
static void CheckAdjustStartAndStop(const CRange< TSeqPos > &range, const CRange< TSeqPos > &expected_range, bool partial_start, CCdregion::EFrame frame, bool partial_stop, bool is_minus=false)
void s_CheckMixLoc(const CSeq_loc &mix, vector< TSeqPos > from, vector< TSeqPos > to)
void Check3Policy(CSeq_feat &imp, CScope &scope, edit::CLocationEditPolicy::EPartialPolicy policy_choice, bool expect_set3, bool expect_clear3, bool extend=false)
CRef< CSeq_entry > MakeMultiSeqCDS(bool good_end, bool is_minus, bool already_partial)
void Check3Extend(bool good_end, bool is_minus, bool already_partial)
void SetSequenceStart(CBioseq &seq, bool good, bool is_minus)
void SetSequenceEnd(CBioseq &seq, bool good, bool is_minus)
CRef< objects::CSeq_feat > MakeGeneForFeature(CRef< objects::CSeq_feat > feat)
CRef< objects::CSeq_feat > AddProtFeat(CRef< objects::CSeq_entry > entry)
CRef< objects::CSeq_feat > AddGoodImpFeat(CRef< objects::CSeq_entry > entry, string key)
CRef< objects::CSeq_feat > GetCDSFromGoodNucProtSet(CRef< objects::CSeq_entry > entry)
CRef< objects::CSeq_annot > AddFeat(CRef< objects::CSeq_feat > feat, CRef< objects::CSeq_entry > entry)
CRef< objects::CSeq_entry > BuildGoodSeq(void)
CRef< objects::CSeq_feat > AddMiscFeature(CRef< objects::CSeq_entry > entry)
CRef< objects::CSeq_entry > BuildGoodEcoSet()
CRef< objects::CSeq_entry > GetProteinSequenceFromGoodNucProtSet(CRef< objects::CSeq_entry > entry)
CRef< objects::CSeq_entry > BuildGoodNucProtSet(void)
CRef< objects::CSeq_loc > MakeMixLoc(CRef< objects::CSeq_id > id)
CRef< objects::CSeq_feat > BuildGoodtRNA(CRef< objects::CSeq_id > id)
CRef< objects::CSeq_entry > BuildGoodDeltaSeq(void)
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