57 #if BOOST_VERSION >= 105900
58 # include <boost/test/tools/output_test_stream.hpp>
60 # include <boost/test/output_test_stream.hpp>
62 using boost::test_tools::output_test_stream;
72 arg_desc->AddKey(
"data-in",
"InputData",
73 "Concatenated Seq-aligns used to generate gene models",
76 arg_desc->AddKey(
"data-expected",
"InputData",
77 "Expected Seq-annots produced from input alignments",
79 arg_desc->AddKey(
"seqdata-expected",
"InputData",
80 "Expected bioseqs produced from input alignments",
82 arg_desc->AddKey(
"combined-data-expected",
"InputData",
83 "Expected single seq-annot produced from all input alignments",
85 arg_desc->AddKey(
"combined-with-omission-expected",
"InputData",
86 "Expected single seq-annot produced from all input alignments omitting the first RNA feature",
89 arg_desc->AddOptionalKey(
"seqdata-in",
"InputData",
90 "FASTA of test sequences",
93 arg_desc->AddOptionalKey(
"data-out",
"OutputData",
94 "Seq-annots produced from input alignments",
96 arg_desc->AddOptionalKey(
"seqdata-out",
"OutputData",
97 "Bioseqss produced from input alignments",
99 arg_desc->AddOptionalKey(
"combined-data-out",
"OutputData",
100 "Single seq-annot produced from all input alignments",
102 arg_desc->AddOptionalKey(
"combined-with-omission-out",
"OutputData",
103 "Single seq-annot produced from all input alignments omitting the first RNA feature",
111 return *ref1 < *ref2;
116 const string& compared_features)
118 CSeq_annot::TData::TFtable::const_iterator actual_iter =
121 CSeq_annot::TData::TFtable::const_iterator expected_iter =
124 for ( ; actual_iter != actual.end() && expected_iter !=
expected.end();
125 ++actual_iter, ++expected_iter) {
127 bool display =
false;
131 compared_features <<
": f1.GetData().GetSubtype() == f2.GetData().GetSubtype() failed ["
134 compared_features <<
": f1.GetLocation().Equals(f2.GetLocation() failed");
141 compared_features <<
": (f1.IsSetPartial() && f1.GetPartial()) == (f2.IsSetPartial() && f2.GetPartial()) failed");
187 BOOST_CHECK_EQUAL(code_break1, code_break2);
242 BOOST_CHECK_EQUAL(f1_except, f2_except);
244 string f1_except_text =
246 string f2_except_text =
248 BOOST_CHECK_EQUAL(f1_except_text, f2_except_text);
274 }
while(!fastareader.
AtEOF());
283 validator::CValidator validator(*
om);
286 CNcbiIstream& align_istr = args[
"data-in"].AsInputFile();
287 CNcbiIstream& annot_istr = args[
"data-expected"].AsInputFile();
288 CNcbiIstream& combined_annot_istr = args[
"combined-data-expected"].AsInputFile();
289 CNcbiIstream& combined_annot_with_omission_istr = args[
"combined-with-omission-expected"].AsInputFile();
296 combined_annot_istr));
297 unique_ptr<CObjectIStream> combined_annot_with_omission_is(
299 combined_annot_with_omission_istr));
300 unique_ptr<CObjectOStream> annot_os;
301 if (args[
"data-out"]) {
302 CNcbiOstream& annot_ostr = args[
"data-out"].AsOutputFile();
306 unique_ptr<CObjectOStream> combined_annot_os;
307 if (args[
"combined-data-out"]) {
308 CNcbiOstream& combined_annot_ostr = args[
"combined-data-out"].AsOutputFile();
310 combined_annot_ostr));
312 unique_ptr<CObjectOStream> combined_annot_with_omission_os;
313 if (args[
"combined-with-omission-out"]) {
314 CNcbiOstream& combined_annot_with_omission_ostr = args[
"combined-with-omission-out"].AsOutputFile();
316 combined_annot_with_omission_ostr));
318 output_test_stream seqdata_test_stream( args[
"seqdata-expected"].AsString(),
true );
320 seqdata_test_stream));
321 unique_ptr<CObjectOStream> seqdata_os;
322 if (args[
"seqdata-out"]) {
323 CNcbiOstream& seqdata_ostr = args[
"seqdata-out"].AsOutputFile();
328 if (args[
"seqdata-in"]) {
334 actual_combined_annot.
SetData().SetFtable();
336 *combined_annot_is >> expected_combined_annot;
338 expected_combined_annot.
SetData().SetFtable();
339 CSeq_annot actual_combined_annot_with_omission;
341 actual_combined_annot_with_omission.
SetData().SetFtable();
342 CSeq_annot expected_combined_annot_with_omission;
343 *combined_annot_with_omission_is >> expected_combined_annot_with_omission;
345 expected_combined_annot_with_omission.
SetData().SetFtable();
350 list< CRef<CSeq_align> > combined_aligns;
351 CSeq_id gene_for_combined_aligns;
360 const int default_flags =
366 for (
int alignment = 0; align_istr && annot_istr; ++alignment) {
382 *annot_is >> expected_annot;
389 cerr <<
"Alignment "<< alignment << endl;
391 BOOST_CHECK_NO_THROW(align->
Validate(
true));
399 actual_annot.
SetData().SetFtable();
406 if ((*ext_it)->GetType().IsStr() &&
407 (*ext_it)->GetType().GetStr() ==
"CFeatureGenerator") {
408 if ((*ext_it)->HasField(
"Flags")) {
409 int flags = (*ext_it)->GetField(
"Flags").GetData().GetInt();
412 if ((*ext_it)->HasField(
"MinIntron")) {
413 int value = (*ext_it)->GetField(
"MinIntron").GetData().GetInt();
416 if ((*ext_it)->HasField(
"AdjustRange")) {
417 const vector<int>& range_vec = (*ext_it)->GetField(
"AdjustRange").GetData().GetInts();
418 adjust_range =
TSeqRange(range_vec[0], range_vec[1]);
421 if ((*ext_it)->HasField(
"cdregion")) {
422 string cdregion = (*ext_it)->GetField(
"cdregion").GetData().GetStr();
442 if(
id == gene_for_combined_aligns)
443 combined_aligns.push_back(align);
450 if (genes_for_redo_partial.count(
id) &&
451 (!(*it)->GetData().IsGene() ||
452 unique_gene_ids.
insert(
id).second) &&
453 (!(*it)->GetData().IsRna() || alignment > 0))
454 actual_combined_features_with_omission.push_back(*it);
458 if (annot_os.get() !=
NULL) {
459 *annot_os << actual_annot;
461 if (seqdata_os.get() !=
NULL) {
465 *seqdata_test_os << seqs;
466 BOOST_CHECK( seqdata_test_stream.match_pattern() );
468 *annot_is >> expected_annot;
481 if (combined_annot_with_omission_os.get() !=
NULL) {
482 *combined_annot_with_omission_os << actual_combined_annot_with_omission;
484 s_CompareFtables(actual_combined_features_with_omission, expected_combined_features_with_omission,
"combined_features_with_omission");
495 if(combined_annot_os.get() !=
NULL) {
496 *combined_annot_os << actual_combined_annot;
498 s_CompareFtables(actual_combined_features, expected_combined_features,
"combined_features");
500 BOOST_CHECK(align_istr.eof());
501 BOOST_CHECK(annot_istr.eof());
517 BOOST_CHECK_NO_THROW(
537 exon->SetProduct_start().SetNucpos(0);
538 exon->SetProduct_end().SetNucpos(100);
539 exon->SetGenomic_start(0);
540 exon->SetGenomic_end(100);
541 exons.push_back(exon);
543 exon->SetProduct_start().SetNucpos(200);
544 exon->SetProduct_end().SetNucpos(300);
545 exon->SetGenomic_start(200);
546 exon->SetGenomic_end(300);
547 exons.push_back(exon);
577 exon->SetProduct_start().SetNucpos(10);
578 exon->SetProduct_end().SetNucpos(11);
579 exon->SetGenomic_start(20);
580 exon->SetGenomic_end(21);
581 exons.push_back(exon);
584 exon->SetProduct_start().SetNucpos(16);
585 exon->SetProduct_end().SetNucpos(19);
586 exon->SetGenomic_start(1031);
587 exon->SetGenomic_end(1034);
591 chunk->SetProduct_ins(1);
592 exon->SetParts().push_back(chunk);
596 exon->SetParts().push_back(chunk);
599 chunk->SetGenomic_ins(1);
600 exon->SetParts().push_back(chunk);
604 exon->SetParts().push_back(chunk);
605 exons.push_back(exon);
608 exon->SetProduct_start().SetNucpos(200);
609 exon->SetProduct_end().SetNucpos(300);
610 exon->SetGenomic_start(2000);
611 exon->SetGenomic_end(2100);
612 exons.push_back(exon);
614 BOOST_CHECK_NO_THROW(align.
Validate(
true));
619 BOOST_CHECK_NO_THROW(trimmed_align->
Validate(
true));
625 BOOST_CHECK_EQUAL((*i)->GetGenomic_start(),
TSeqPos(1031) );
626 BOOST_CHECK_EQUAL((*i)->GetGenomic_end(),
TSeqPos(1032) );
627 BOOST_CHECK_EQUAL((*++
i)->GetGenomic_start(),
TSeqPos(2002) );
652 exon->SetProduct_start().SetProtpos().SetAmin(3);
653 exon->SetProduct_start().SetProtpos().SetFrame(1);
654 exon->SetProduct_end().SetProtpos().SetAmin(3);
655 exon->SetProduct_end().SetProtpos().SetFrame(2);
656 exon->SetGenomic_start(20);
657 exon->SetGenomic_end(21);
658 exons.push_back(exon);
661 exon->SetProduct_start().SetProtpos().SetAmin(5);
662 exon->SetProduct_start().SetProtpos().SetFrame(2);
663 exon->SetProduct_end().SetProtpos().SetAmin(7);
664 exon->SetProduct_end().SetProtpos().SetFrame(2);
665 exon->SetGenomic_start(1031);
666 exon->SetGenomic_end(1037);
670 chunk->SetProduct_ins(1);
671 exon->SetParts().push_back(chunk);
675 exon->SetParts().push_back(chunk);
678 chunk->SetGenomic_ins(1);
679 exon->SetParts().push_back(chunk);
683 exon->SetParts().push_back(chunk);
684 exons.push_back(exon);
687 exon->SetProduct_start().SetProtpos().SetAmin(66);
688 exon->SetProduct_start().SetProtpos().SetFrame(3);
689 exon->SetProduct_end().SetProtpos().SetAmin(100);
690 exon->SetProduct_end().SetProtpos().SetFrame(1);
691 exon->SetGenomic_start(2000);
692 exon->SetGenomic_end(2100);
693 exons.push_back(exon);
695 BOOST_CHECK_NO_THROW(align.
Validate(
true));
700 BOOST_CHECK_NO_THROW(trimmed_align->
Validate(
true));
706 BOOST_CHECK_EQUAL((*i)->GetGenomic_start(),
TSeqPos(1032) );
707 BOOST_CHECK_EQUAL((*i)->GetGenomic_end(),
TSeqPos(1035) );
708 BOOST_CHECK_EQUAL((*++
i)->GetGenomic_start(),
TSeqPos(2001) );
725 product-id gi 16762324, \
726 genomic-id gi 188504888, \
727 genomic-strand plus, \
728 product-type protein, \
731 product-start protpos { amin 25, frame 1 }, \
732 product-end protpos { amin 30, frame 3 }, \
733 genomic-start 0, genomic-end 17 \
736 product-start protpos { amin 35, frame 2 }, \
737 product-end protpos { amin 45, frame 2 }, \
738 genomic-start 31, genomic-end 61 \
741 product-start protpos { amin 55, frame 2 }, \
742 product-end protpos { amin 55, frame 2 }, \
743 genomic-start 91, genomic-end 91 \
746 product-start protpos { amin 65, frame 2 }, \
747 product-end protpos { amin 576, frame 3 }, \
748 genomic-start 121, genomic-end 1655 \
751 product-length 577, \
753 stop-codon-found TRUE \
762 BOOST_CHECK_NO_THROW(align.
Validate(
true));
768 BOOST_CHECK_NO_THROW(trimmed_align->
Validate(
true));
774 BOOST_CHECK_EQUAL((*i)->GetGenomic_start(),
TSeqPos(0) );
775 BOOST_CHECK_EQUAL((*i)->GetGenomic_end(),
TSeqPos(17) );
776 BOOST_CHECK_EQUAL((*++
i)->GetGenomic_start(),
TSeqPos(33) );
777 BOOST_CHECK_EQUAL((*i)->GetGenomic_end(),
TSeqPos(59) );
778 BOOST_CHECK_EQUAL((*++
i)->GetGenomic_start(),
TSeqPos(123) );
779 BOOST_CHECK_EQUAL((*i)->GetGenomic_end(),
TSeqPos(1655) );
795 product-id gi 16762324, \
796 genomic-id gi 188504888, \
797 genomic-strand plus, \
798 product-type protein, \
801 product-start protpos { amin 25, frame 1 }, \
802 product-end protpos { amin 30, frame 3 }, \
803 genomic-start 0, genomic-end 17 \
806 product-start protpos { amin 65, frame 2 }, \
807 product-end protpos { amin 576, frame 3 }, \
808 genomic-start 121, genomic-end 1655 \
811 product-length 577, \
813 stop-codon-found TRUE \
822 BOOST_CHECK_NO_THROW(align.
Validate(
true));
828 BOOST_CHECK_NO_THROW(trimmed_align->
Validate(
true));
834 BOOST_CHECK_EQUAL((*i)->GetGenomic_start(),
TSeqPos(1653) );
835 BOOST_CHECK_EQUAL((*i)->GetGenomic_end(),
TSeqPos(1655) );
861 exon->SetProduct_start().SetProtpos().SetAmin(3);
862 exon->SetProduct_start().SetProtpos().SetFrame(1);
863 exon->SetProduct_end().SetProtpos().SetAmin(3);
864 exon->SetProduct_end().SetProtpos().SetFrame(2);
865 exon->SetGenomic_start(20);
866 exon->SetGenomic_end(21);
867 exons.push_back(exon);
870 exon->SetProduct_start().SetProtpos().SetAmin(5);
871 exon->SetProduct_start().SetProtpos().SetFrame(2);
872 exon->SetProduct_end().SetProtpos().SetAmin(7);
873 exon->SetProduct_end().SetProtpos().SetFrame(2);
874 exon->SetGenomic_start(31);
875 exon->SetGenomic_end(37);
879 chunk->SetProduct_ins(1);
880 exon->SetParts().push_back(chunk);
884 exon->SetParts().push_back(chunk);
887 chunk->SetGenomic_ins(1);
888 exon->SetParts().push_back(chunk);
892 exon->SetParts().push_back(chunk);
893 exons.push_back(exon);
896 exon->SetProduct_start().SetProtpos().SetAmin(36);
897 exon->SetProduct_start().SetProtpos().SetFrame(3);
898 exon->SetProduct_end().SetProtpos().SetAmin(70);
899 exon->SetProduct_end().SetProtpos().SetFrame(1);
900 exon->SetGenomic_start(137);
901 exon->SetGenomic_end(237);
902 exons.push_back(exon);
904 BOOST_CHECK_NO_THROW(align.
Validate(
true));
909 BOOST_CHECK_NO_THROW(modified_align->
Validate(
true));
915 BOOST_CHECK_EQUAL((*i)->GetGenomic_start(),
TSeqPos(20) );
916 BOOST_CHECK_EQUAL((*i)->GetGenomic_end(),
TSeqPos(237) );
921 switch (chunk.
Which()) {
951 for (
int strand = -1 ; strand <= 1; strand +=2) {
973 exon->SetProduct_start().SetProtpos().SetAmin(3);
974 exon->SetProduct_start().SetProtpos().SetFrame(3);
975 exon->SetProduct_end().SetProtpos().SetAmin(75);
976 exon->SetProduct_end().SetProtpos().SetFrame(1);
977 exon->SetGenomic_start(22);
978 exon->SetGenomic_end(237);
985 exon->SetParts().push_back(chunk);
988 chunk->SetGenomic_ins(1);
989 exon->SetParts().push_back(chunk);
993 exon->SetParts().push_back(chunk);
996 chunk->SetProduct_ins(1);
997 exon->SetParts().push_back(chunk);
1001 exon->SetParts().push_back(chunk);
1004 chunk->SetGenomic_ins(1);
1005 exon->SetParts().push_back(chunk);
1008 chunk->SetDiag(204);
1009 exon->SetParts().push_back(chunk);
1011 exons.push_back(exon);
1013 BOOST_CHECK_NO_THROW(align.
Validate(
true));
1024 BOOST_CHECK_NO_THROW(modified_align->
Validate(
true));
1028 int cumulative_indel_len = 0;
1032 switch (chunk.
Which()) {
1041 cumulative_indel_len += 1;
1045 BOOST_CHECK_EQUAL(product_pos % 3,
TSeqPos(0) );
1047 cumulative_indel_len -= 1;
1077 for (
int strand = -1 ; strand <= 1; strand +=2) {
1099 exon->SetProduct_start().SetProtpos().SetAmin(3);
1100 exon->SetProduct_start().SetProtpos().SetFrame(3);
1101 exon->SetProduct_end().SetProtpos().SetAmin(75);
1102 exon->SetProduct_end().SetProtpos().SetFrame(1);
1103 exon->SetGenomic_start(22);
1104 exon->SetGenomic_end(237);
1111 exon->SetParts().push_back(chunk);
1114 chunk->SetGenomic_ins(1);
1115 exon->SetParts().push_back(chunk);
1119 exon->SetParts().push_back(chunk);
1122 chunk->SetProduct_ins(1);
1123 exon->SetParts().push_back(chunk);
1127 exon->SetParts().push_back(chunk);
1130 chunk->SetGenomic_ins(1);
1131 exon->SetParts().push_back(chunk);
1134 chunk->SetDiag(204);
1135 exon->SetParts().push_back(chunk);
1137 exons.push_back(exon);
1139 BOOST_CHECK_NO_THROW(align.
Validate(
true));
1150 BOOST_CHECK_NO_THROW(modified_align->
Validate(
true));
1154 int cumulative_indel_len = 0;
1158 switch (chunk.
Which()) {
1167 cumulative_indel_len += 1;
1171 BOOST_CHECK_EQUAL(product_pos % 3,
TSeqPos(0) );
1173 cumulative_indel_len -= 1;
1204 for (
int strand = -1 ; strand <= 1; strand +=2) {
1226 exon->SetProduct_start().SetProtpos().SetAmin(3);
1227 exon->SetProduct_start().SetProtpos().SetFrame(3);
1228 exon->SetProduct_end().SetProtpos().SetAmin(75);
1229 exon->SetProduct_end().SetProtpos().SetFrame(1);
1230 exon->SetGenomic_start(10);
1231 exon->SetGenomic_end(225);
1238 exon->SetParts().push_back(chunk);
1241 chunk->SetGenomic_ins(1);
1242 exon->SetParts().push_back(chunk);
1246 exon->SetParts().push_back(chunk);
1249 chunk->SetProduct_ins(1);
1250 exon->SetParts().push_back(chunk);
1254 exon->SetParts().push_back(chunk);
1257 chunk->SetGenomic_ins(1);
1258 exon->SetParts().push_back(chunk);
1261 chunk->SetDiag(204);
1262 exon->SetParts().push_back(chunk);
1264 exons.push_back(exon);
1270 BOOST_CHECK_NO_THROW(align.
Validate(
true));
1277 BOOST_CHECK_NO_THROW(modified_align->
Validate(
true));
1304 for (
int strand = -1 ; strand <= 1; strand +=2) {
1326 exon->SetProduct_start().SetProtpos().SetAmin(strand > 0 ? 0 : 2);
1327 exon->SetProduct_start().SetProtpos().SetFrame(strand > 0 ? 1 : 3);
1328 exon->SetProduct_end().SetProtpos().SetAmin(strand > 0 ? 1 : 3);
1329 exon->SetProduct_end().SetProtpos().SetFrame(strand > 0 ? 1 : 3);
1330 exon->SetGenomic_start(5580);
1331 exon->SetGenomic_end(5583);
1334 exons.push_back(exon);
1337 exon->SetProduct_start().SetProtpos().SetAmin(strand > 0 ? 1 : 0);
1338 exon->SetProduct_start().SetProtpos().SetFrame(strand > 0 ? 2 : 1);
1339 exon->SetProduct_end().SetProtpos().SetAmin(strand > 0 ? 3 : 2);
1340 exon->SetProduct_end().SetProtpos().SetFrame(strand > 0 ? 3 : 2);
1341 exon->SetGenomic_start(0);
1342 exon->SetGenomic_end(7);
1346 exons.push_back(exon);
1348 exons.insert(exons.begin(), exon);
1350 BOOST_CHECK_NO_THROW(align.
Validate(
true));
1361 BOOST_CHECK_NO_THROW(modified_align->
Validate(
true));
1397 product-id gi 386076534, \
1398 genomic-id gi 386018361, \
1399 product-type protein, \
1402 product-start protpos { \
1406 product-end protpos { \
1410 genomic-start 321741, \
1411 genomic-end 321743, \
1419 TSeqPos genomic_size = 321744;
1427 for (
int strand = -1 ; strand <= 1; strand +=2) {
1428 for (
int side = -1 ; side <= 1; side +=2) {
1433 exon->
SetProduct_end().SetProtpos().SetAmin(side != strand ? 0 : 1);
1439 BOOST_CHECK_NO_THROW(align.
Validate(
true));
1449 BOOST_CHECK_NO_THROW(modified_align->
Validate(
true));
1475 product-id local id 386076534, \
1476 genomic-id gi 183579259, \
1477 genomic-strand minus, \
1478 product-type transcript, \
1481 product-start nucpos 0, \
1482 product-end nucpos 150, \
1483 genomic-start 132443, \
1484 genomic-end 132593 \
1487 product-start nucpos 151, \
1488 product-end nucpos 381, \
1489 genomic-start 132090, \
1490 genomic-end 132320, \
1494 product-length 382 \
1503 product whole local str \"PROT_10_36\", \
1507 id local id 386076534, \
1515 product-id local id 386076534, \
1516 genomic-id gi 183579259, \
1517 genomic-strand minus, \
1518 product-type transcript, \
1521 product-start nucpos 0, \
1522 product-end nucpos 132, \
1523 genomic-start 127519, \
1524 genomic-end 127651 \
1527 product-start nucpos 133, \
1528 product-end nucpos 355, \
1529 genomic-start 127174, \
1530 genomic-end 127396 \
1533 product-start nucpos 356, \
1534 product-end nucpos 359, \
1535 genomic-start 110589, \
1536 genomic-end 110592, \
1540 product-length 382 \
1549 product whole local str \"PROT_10_36\", \
1553 id local id 386076534, \
1574 BOOST_CHECK_NO_THROW(align.
Validate(
true));
1610 product-id gi 16762324, \
1611 genomic-id gi 188504888, \
1612 genomic-strand plus, \
1613 product-type protein, \
1616 product-start protpos { \
1620 product-end protpos { \
1628 product-length 577, \
1630 stop-codon-found TRUE \
1643 BOOST_CHECK_NO_THROW(align.
Validate(
true));
1662 if ((*it)->GetData().IsGene()) {
1676 Seq-loc ::= packed-int { \
1706 int protein_length = seqs.
GetSeq_set().front()->GetSeq().GetLength();
1707 BOOST_CHECK_EQUAL(protein_length, 401);
1719 Seq-loc ::= packed-int { \
1724 id general { db \"PRJNA205468\" , \
1725 tag str \"contig_484\" }, \
1731 string fasta_string =
"\
1732 >gnl|PRJNA205468|contig_484 [organism=Sphingobacterium sp. IITKGP-BTPF85] [moltype=Genomic] [strain=IITKGP-BTPF85] [gcode=11] [tech=wgs]\n\
1733 GCTTCAACAAATAGGCATAGCCTTGATTCTGAAAAGCTTTTAAGGCGTAATCTTCAAACGCTGTAGTAAA\n\
1734 AATAACAGGTGCCTGAACTTTGACCTGGTCAAATATTTCGAAACTCAATCCATCACCGAGCTGCACATCC\n\
1735 ATAAAGATGAGATCGACTTCATTTTTAAGCAACCAATCGGTAGCTTCACGCACTGTTGTTATAATCGTAG\n\
1736 ATTGAAATTTGGAAGCAATCAATTGGTCTAATTTCTCCAAAAGACTTTCCGAAGCCCAGTTTTCATCTTC\n\
1764 bool no_exceptions_set = !annot.
GetData().
GetFtable().back()->IsSetExcept();
1765 BOOST_CHECK(no_exceptions_set);
1777 Seq-loc ::= packed-int { \
1828 Seq-loc ::= packed-int { \
User-defined methods of the data storage class.
User-defined methods of the data storage class.
@ eExtreme_Biological
5' and 3'
Base class for reading FASTA sequences.
CRef< objects::CSeq_feat > ConvertAlignToAnnot(const objects::CSeq_align &align, objects::CSeq_annot &annot, objects::CBioseq_set &seqs, Int8 gene_id=0, const objects::CSeq_feat *cdregion_on_mrna=NULL)
Convert an alignment to an annotation.
CConstRef< objects::CSeq_align > AdjustAlignment(const objects::CSeq_align &align, TSeqRange range, EProductPositionsMode mode=eForceProductFrom0)
void RecomputePartialFlags(objects::CSeq_annot &annot)
Recompute the correct partial states for all features in this annotation.
void SetMinIntron(TSeqPos)
void SetFlags(TFeatureGeneratorFlags)
void SetAllowedUnaligned(TSeqPos)
static const TSeqPos kDefaultMinIntron
CConstRef< objects::CSeq_align > CleanAlignment(const objects::CSeq_align &align)
Clean an alignment according to our best guess of its biological representation.
@ fGenerateStableLocalIds
void ConvertLocToAnnot(const objects::CSeq_loc &loc, objects::CSeq_annot &annot, objects::CBioseq_set &seqs, objects::CCdregion::EFrame frame=objects::CCdregion::eFrame_one, CRef< objects::CSeq_id > prot_id=CRef< objects::CSeq_id >(), CRef< objects::CSeq_id > rna_id=CRef< objects::CSeq_id >())
Convert genomic location to an annotation.
static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, CReader *reader=0, CObjectManager::EIsDefault is_default=CObjectManager::eDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)
static CNcbiApplication * Instance(void)
Singleton method.
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
ESubtype GetSubtype(void) const
void Validate(bool full_test=false) const
namespace ncbi::objects::
iterator_bool insert(const value_type &val)
Operators to edit gaps in sequences.
unsigned int TSeqPos
Type for sequence locations and lengths.
virtual const CArgs & GetArgs(void) const
Get parsed command line arguments.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
@ eInputFile
Name of file (must exist and be readable)
@ eString
An arbitrary string.
@ eOutputFile
Name of file (must be writable)
#define MSerial_AsnText
I/O stream manipulators –.
virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const
Check if both objects contain the same values.
@ eSerial_AsnText
ASN.1 text.
virtual CRef< CSeq_entry > ReadOneSeq(ILineErrorListener *pMessageListener=nullptr)
Read a single effective sequence, which may turn out to be a segmented set.
bool AtEOF(void) const
Indicates (negatively) whether there is any more input.
@ fAddMods
Parse defline mods and add to SeqEntry.
@ fParseRawID
Try to identify raw accessions.
static CSeq_id_Handle GetGiHandle(TGi gi)
Faster way to create a handle for a gi.
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
static CObjectOStream * Open(ESerialDataFormat format, CNcbiOstream &outStream, bool deleteOutStream)
Create serial object writer and attach it to an output stream.
static CObjectIStream * Open(ESerialDataFormat format, CNcbiIstream &inStream, bool deleteInStream)
Create serial object reader and attach it to an input stream.
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...
void AddDefaults(TPriority pri=kPriority_Default)
Add default data loaders from object manager.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
bool NotEmpty(void) const
CRange< TSeqPos > TSeqRange
typedefs for sequence ranges
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
bool IsSetSyn(void) const
synonyms for locus Check if a value has been assigned to Syn data member.
const TSyn & GetSyn(void) const
Get the Syn member data.
const TDesc & GetDesc(void) const
Get the Desc member data.
bool IsSetLocus(void) const
Official gene symbol Check if a value has been assigned to Locus data member.
bool IsSetDesc(void) const
descriptive name Check if a value has been assigned to Desc data member.
const TLocus & GetLocus(void) const
Get the Locus member data.
const TProtpos & GetProtpos(void) const
Get the variant data.
void SetProduct_start(TProduct_start &value)
Assign a value to Product_start data member.
TMatch GetMatch(void) const
Get the variant data.
void SetProduct_id(TProduct_id &value)
Assign a value to Product_id data member.
void SetProduct_end(TProduct_end &value)
Assign a value to Product_end data member.
TGenomic_start GetGenomic_start(void) const
Get the Genomic_start member data.
void SetSegs(TSegs &value)
Assign a value to Segs data member.
TExons & SetExons(void)
Assign a value to Exons data member.
TProduct_length GetProduct_length(void) const
Get the Product_length member data.
void SetProduct_length(TProduct_length value)
Assign a value to Product_length data member.
TMismatch GetMismatch(void) const
Get the variant data.
list< CRef< CUser_object > > TExt
TAmin GetAmin(void) const
Get the Amin member data.
void SetGenomic_start(TGenomic_start value)
Assign a value to Genomic_start data member.
void SetType(TType value)
Assign a value to Type data member.
const TParts & GetParts(void) const
Get the Parts member data.
const TProduct_start & GetProduct_start(void) const
Get the Product_start member data.
const TProduct_end & GetProduct_end(void) const
Get the Product_end member data.
const TSpliced & GetSpliced(void) const
Get the variant data.
TGenomic_ins GetGenomic_ins(void) const
Get the variant data.
void SetGenomic_strand(TGenomic_strand value)
Assign a value to Genomic_strand data member.
void SetProduct_type(TProduct_type value)
Assign a value to Product_type data member.
list< CRef< CSpliced_exon > > TExons
const TExons & GetExons(void) const
Get the Exons member data.
void SetGenomic_id(TGenomic_id &value)
Assign a value to Genomic_id data member.
void SetGenomic_end(TGenomic_end value)
Assign a value to Genomic_end data member.
const TExt & GetExt(void) const
Get the Ext member data.
list< CRef< CSpliced_exon_chunk > > TParts
TGenomic_end GetGenomic_end(void) const
Get the Genomic_end member data.
TProduct_ins GetProduct_ins(void) const
Get the variant data.
const TSegs & GetSegs(void) const
Get the Segs member data.
E_Choice Which(void) const
Which variant is currently selected.
@ e_Product_ins
insertion in product sequence (i.e. gap in the genomic sequence)
@ e_Genomic_ins
insertion in genomic sequence (i.e. gap in the product sequence)
@ e_Match
both sequences represented, product and genomic sequences match
@ e_Mismatch
both sequences represented, product and genomic sequences do not match
@ eType_partial
mapping pieces together
@ eProduct_type_transcript
bool IsSetComment(void) const
Check if a value has been assigned to Comment data member.
bool IsCdregion(void) const
Check if variant Cdregion is selected.
bool IsSetPartial(void) const
incomplete in some way? Check if a value has been assigned to Partial data member.
const TLocation & GetLocation(void) const
Get the Location member data.
bool IsGene(void) const
Check if variant Gene is selected.
list< CRef< CCode_break > > TCode_break
const TData & GetData(void) const
Get the Data member data.
bool IsSetExcept(void) const
something funny about this? Check if a value has been assigned to Except data member.
const TExcept_text & GetExcept_text(void) const
Get the Except_text member data.
bool IsSetExcept_text(void) const
explain if except=TRUE Check if a value has been assigned to Except_text data member.
const TCdregion & GetCdregion(void) const
Get the variant data.
TPseudo GetPseudo(void) const
Get the Pseudo member data.
const TProduct & GetProduct(void) const
Get the Product member data.
bool IsSetPseudo(void) const
annotated on pseudogene? Check if a value has been assigned to Pseudo data member.
const TComment & GetComment(void) const
Get the Comment member data.
const TGene & GetGene(void) const
Get the variant data.
TPartial GetPartial(void) const
Get the Partial member data.
TExcept GetExcept(void) const
Get the Except member data.
bool IsSetDbxref(void) const
support for xref to other databases Check if a value has been assigned to Dbxref data member.
const TCode_break & GetCode_break(void) const
Get the Code_break member data.
bool IsSetProduct(void) const
product of process Check if a value has been assigned to Product data member.
bool IsSetCode_break(void) const
individual exceptions Check if a value has been assigned to Code_break data member.
@ eFrame_three
reading frame
TOther & SetOther(void)
Select the variant.
void SetAccession(const TAccession &value)
Assign a value to Accession data member.
void SetVersion(TVersion value)
Assign a value to Version data member.
TSet & SetSet(void)
Select the variant.
const TSeq_set & GetSeq_set(void) const
Get the Seq_set member data.
TSeq_set & SetSeq_set(void)
Assign a value to Seq_set data member.
void SetData(TData &value)
Assign a value to Data data member.
const TFtable & GetFtable(void) const
Get the variant data.
list< CRef< CSeq_feat > > TFtable
const TData & GetData(void) const
Get the Data member data.
range(_Ty, _Ty) -> range< _Ty >
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
Defines command line argument related classes.
Defines unified interface to application:
static const char * expected[]
BOOST_AUTO_TEST_SUITE(psiblast_iteration)
CRef< objects::CObjectManager > om
Utility stuff for more convenient using of Boost.Test library.
BOOST_AUTO_TEST_CASE(TestUsingArg)
NCBITEST_INIT_CMDLINE(arg_desc)
void AddFastaToScope(const string &fasta_file, CScope &scope)
void s_CompareFtables(const CSeq_annot::TData::TFtable &actual, const CSeq_annot::TData::TFtable &expected, const string &compared_features)
static bool s_CompareFeatRefs(const CRef< CSeq_feat > &ref1, const CRef< CSeq_feat > &ref2)
Function to compare Cref<Cseq_feat>s by their referents.
BOOST_AUTO_TEST_SUITE_END()
Auxiliary class to convert a string into an argument count and vector.