82 BOOST_CHECK(data_iter);
84 vector<const CSeq_feat*> features;
87 while (!data_iter->IsEnd()) {
90 features.push_back(feat);
99 return features.size();
105 string fname(
"genes.asn");
130 cout <<
"[" << start <<
", " << stop <<
"]" << endl;
139 cout <<
"\n\n[" << start <<
", " << stop <<
"]" << endl;
148 cout <<
"\n\n[" << start <<
", " << stop <<
"]" << endl;
157 cout <<
"\n\n(" << start <<
", " << stop <<
"]" << endl;
167 cout <<
"\n\n[" << start <<
", " << stop <<
"]" << endl;
176 cout <<
"\n\n[" << start <<
", " << stop <<
")" << endl;
186 cout <<
"\n\n(" << start <<
", " << stop <<
")" << endl;
195 cout <<
"\n\n(" << start <<
", " << stop <<
"]" << endl;
205 cout <<
"\n\n[" << start <<
", " << stop <<
"]" << endl;
215 cout <<
"\n\n[" << start <<
", " << stop <<
")" << endl;
224 BOOST_CHECK_EQUAL(
MakeAsn(*bsrc),
236 BOOST_CHECK(
result.empty());
242 BOOST_CHECK_EQUAL(
MakeAsn(*bsrc),
255 BOOST_CHECK(
result.front().field.GetPrimitiveValueString() ==
"genomic");
256 BOOST_CHECK_EQUAL(
MakeAsn(*bsrc),
266 BOOST_CHECK_EQUAL(
MakeAsn(*bsrc),
281 " taxname \"Bubo scandiacus\",\n"
293 " seq \"aggctctctctcaa\",\n"
299 " seq \"aggctctctctcaa\",\n"
318 BOOST_CHECK(
result.size() == 1);
323 primer->
SetName().Set(
"nbam33");
324 primer->
SetSeq().Set(
"aggggaaattt");
327 reaction->
SetForward().Set().push_back(primer);
334 BOOST_CHECK(
result.size() == 2);
336 BOOST_CHECK_EQUAL(
MakeAsn(*bsrc),
340 " taxname \"Bubo scandiacus\",\n"
352 " seq \"aggctctctctcaa\",\n"
358 " seq \"aggctctctctcaa\",\n"
366 " seq \"aggggaaattt\",\n"
381 " taxname \"Bubo scandiacus\",\n"
393 " seq \"aggctctctctcaa\",\n"
397 " seq \"aggctctaagatatt\",\n"
403 " seq \"aggctctctctcaa\",\n"
407 " seq \"aggctctaagatatt\",\n"
420 BOOST_CHECK(
result.size() == 2);
440 BOOST_CHECK_EQUAL(
result.front().field.GetPrimitiveValueString(),
string(
"Bubo scandiacus"));
447 BOOST_CHECK(
result.empty());
453 BOOST_CHECK(
result.empty());
454 BOOST_CHECK_EQUAL(
MakeAsn(*bsrc),
458 " taxname \"Bubo scandiacus\",\n"
473 BOOST_CHECK(
result.empty());
474 BOOST_CHECK_EQUAL(
MakeAsn(*bsrc),
478 " taxname \"Bubo scandiacus\",\n"
494 BOOST_CHECK_EQUAL(
MakeAsn(*bsrc),
498 " taxname \"Bubo scandiacus\",\n"
509 bsrc->
SetOrg().SetCommon(
"snowy owl");
515 BOOST_CHECK_EQUAL(
result.front().field.GetPrimitiveValueString(),
string(
"snowy owl"));
524 BOOST_CHECK_EQUAL(
MakeAsn(*bsrc),
528 " taxname \"Bubo scandiacus\",\n"
548 " taxname \"Bubo scandiacus\",\n"
549 " common \"snowy owl\",\n"
551 " \"modifier_01\",\n"
552 " \"modifier_02\",\n"
574 BOOST_CHECK(
result.size() == 1);
576 BOOST_CHECK_EQUAL(
MakeAsn(*bsrc),
580 " taxname \"Bubo scandiacus\",\n"
581 " common \"snowy owl\",\n"
583 " \"modifier_01\",\n"
584 " \"modifier_02\",\n"
601 BOOST_CHECK(
result.empty());
602 BOOST_CHECK_EQUAL(
MakeAsn(*bsrc),
606 " taxname \"Bubo scandiacus\",\n"
607 " common \"snowy owl\",\n"
609 " \"modifier_01\",\n"
610 " \"modifier_02\",\n"
628 BOOST_CHECK_EQUAL(
MakeAsn(*bsrc),
632 " taxname \"Bubo scandiacus\",\n"
633 " common \"snowy owl\",\n"
635 " \"modifier_01\",\n"
636 " \"modifier_02\",\n"
657 BOOST_CHECK_EQUAL(
MakeAsn(*bsrc),
661 " taxname \"Bubo scandiacus\",\n"
662 " common \"snowy owl\",\n"
664 " \"modifier_01\",\n"
665 " \"modifier_02\",\n"
683 bsrc->
SetOrg().SetOrgname().SetMgcode(5);
684 BOOST_CHECK_EQUAL(
MakeAsn(*bsrc),
688 " taxname \"Bubo scandiacus\",\n"
689 " common \"snowy owl\",\n"
691 " \"modifier_01\",\n"
692 " \"modifier_02\",\n"
712 bsrc->
SetOrg().SetOrgname().SetMod().push_back(orgmod1);
713 bsrc->
SetOrg().SetOrgname().SetMod().push_back(orgmod2);
714 BOOST_CHECK_EQUAL(
MakeAsn(*bsrc),
718 " taxname \"Bubo scandiacus\",\n"
719 " common \"snowy owl\",\n"
721 " \"modifier_01\",\n"
722 " \"modifier_02\",\n"
734 " subtype ecotype,\n"
735 " subname \"eco_type\"\n"
739 " subname \"note about the owl\"\n"
760 BOOST_CHECK_EQUAL(
MakeAsn(*bsrc),
764 " taxname \"Bubo scandiacus\",\n"
765 " common \"snowy owl\",\n"
767 " \"modifier_01\",\n"
768 " \"modifier_02\",\n"
781 " subname \"note about the owl\"\n"
795 BOOST_CHECK_EQUAL(
MakeAsn(*bsrc),
799 " taxname \"Bubo scandiacus\",\n"
800 " common \"snowy owl\",\n"
802 " \"modifier_01\",\n"
803 " \"modifier_02\",\n"
823 bsrc->
SetOrg().SetOrgname().SetMod().push_back(orgmod2);
832 BOOST_CHECK_EQUAL(
MakeAsn(*bsrc),
836 " taxname \"Bubo scandiacus\",\n"
837 " common \"snowy owl\",\n"
839 " \"modifier_01\",\n"
840 " \"modifier_02\",\n"
853 " subname \"note about the owl\"\n"
865 BOOST_CHECK_EQUAL(
MakeAsn(*bsrc),
869 " taxname \"Bubo scandiacus\",\n"
870 " common \"snowy owl\",\n"
872 " \"modifier_01\",\n"
873 " \"modifier_02\",\n"
899 " taxname \"Bubo scandiacus\",\n"
900 " common \"snowy owl\",\n"
902 " \"modifier_01\",\n"
903 " \"modifier_02\",\n"
915 " subtype ecotype,\n"
916 " subname \"eco_type\"\n"
920 " subname \"test_strain\"\n"
923 " subtype serovar,\n"
924 " subname \"test_serovar\"\n"
932 " subname \"note about the owl\"\n"
954 BOOST_CHECK(
result.empty());
962 bseq->
SetId().push_back(seq_id);
966 bseq->
SetInst().SetSeq_data().SetIupacna().Set(
"AATTGGCCAAAATTGGCCAAAATTGGCCAAAATTGGCCAA");
975 BOOST_CHECK(
result.empty());
976 BOOST_CHECK_EQUAL(
MakeAsn(*bseq),
979 " local str \"Seq_01\"\n"
985 " seq-data iupacna \"AATTGGCCAAAATTGGCCAAAATTGGCCAAAATTGGCCAA\"\n"
995 desc_title->
SetTitle(
"The title of this sequence");
999 desc_user->
SetUser().
AddField(
"StructuredCommentPrefix",
string(
"##Assembly-Data-START##"));
1000 desc_user->
SetUser().
AddField(
"Sequencing Technology",
string(
"Sanger dideoxy sequencing"));
1001 desc_user->
SetUser().
AddField(
"StructuredCommentSuffix",
string(
"##Assembly-Data-END##"));
1003 bseq->
SetDescr().Set().push_back(desc_molinfo);
1004 bseq->
SetDescr().Set().push_back(desc_title);
1005 bseq->
SetDescr().Set().push_back(desc_user);
1013 BOOST_CHECK_EQUAL(
result.front().field.GetPrimitiveValueString(),
"genomic");
1014 BOOST_CHECK_EQUAL(
MakeAsn(*bseq),
1017 " local str \"Seq_01\"\n"
1021 " biomol genomic,\n"
1022 " completeness complete\n"
1024 " title \"The title of this sequence\",\n"
1026 " type str \"Structured Comment\",\n"
1029 " label str \"StructuredCommentPrefix\",\n"
1030 " data str \"##Assembly-Data-START##\"\n"
1033 " label str \"Sequencing Technology\",\n"
1034 " data str \"Sanger dideoxy sequencing\"\n"
1037 " label str \"StructuredCommentSuffix\",\n"
1038 " data str \"##Assembly-Data-END##\"\n"
1047 " seq-data iupacna \"AATTGGCCAAAATTGGCCAAAATTGGCCAAAATTGGCCAA\"\n"
1056 BOOST_CHECK_EQUAL(
result.front().field.GetPrimitiveValueString(),
string(
"The title of this sequence"));
1078 BOOST_CHECK(
result.front().field.GetPrimitiveValueString() ==
"raw");
1087 " seq-data iupacna \"AATTGGCCAAAATTGGCCAAAATTGGCCAAAATTGGCCAA\"\n"
1096 bseq->
SetId().push_back(seq_id);
1100 bseq->
SetInst().SetSeq_data().SetIupacna().Set(
"AATTGGCCAAAATTGGCCAAAATTGGCCAAAATTGGCCAA");
1101 bseq->
SetInst().SetLength(40);
1107 BOOST_CHECK_EQUAL(
result.front().field.GetPrimitiveValueString(),
"unknown");
1108 BOOST_CHECK_EQUAL(
MakeAsn(*bseq),
1111 " local str \"Seq_01\"\n"
1122 " seq-data iupacna \"AATTGGCCAAAATTGGCCAAAATTGGCCAAAATTGGCCAA\"\n"
1127 desc_title->
SetTitle(
"The title of this sequence");
1128 bseq->
SetDescr().Set().push_back(desc_title);
1134 BOOST_CHECK_EQUAL(
result.front().field.GetPrimitiveValueString(),
"unknown");
1135 BOOST_CHECK_EQUAL(
MakeAsn(*bseq),
1138 " local str \"Seq_01\"\n"
1142 " biomol unknown,\n"
1143 " completeness unknown\n"
1145 " title \"The title of this sequence\"\n"
1151 " seq-data iupacna \"AATTGGCCAAAATTGGCCAAAATTGGCCAAAATTGGCCAA\"\n"
1169 BOOST_CHECK_EQUAL(
MakeAsn(*feat),
1177 " id local str \"Seq_01\"\n"
1187 BOOST_CHECK_EQUAL(
MakeAsn(*feat),
1195 " id local str \"Seq_01\"\n"
1230 bseq->
SetId().push_back(seq_id);
1234 bseq->
SetInst().SetSeq_data().SetIupacna().Set(
"AATTGGCCAAAATTGGCCAAAATTGGCCAAAATTGGCCAA");
1235 bseq->
SetInst().SetLength(40);
1244 bseq->
SetDescr().Set().push_back(desc_molinfo1);
1245 bseq->
SetDescr().Set().push_back(desc_molinfo2);
1251 BOOST_CHECK_EQUAL(
result.front().field.GetPrimitiveValueString(),
"genomic");
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.
The following asn-selectors are defined to be used in the FOR EACH statement:
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
@OrgMod.hpp User-defined methods of the data storage class.
TTaxId SetTaxId(TTaxId tax_id)
namespace ncbi::objects::
CUser_object & AddField(const string &label, const string &value, EParseField parse=eParse_String)
add a data field to the user object that holds a given value
static void DLIST_NAME() remove(DLIST_LIST_TYPE *list, DLIST_TYPE *item)
static const char * str(char *buf, int n)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
void Error(CExceptionArgs_Base &args)
string ReportAll(TDiagPostFlags flags=eDPF_Exception) const
Report all exceptions.
bool RemoveFieldByName(CMQueryNodeValue::SResolvedField &res_field)
Remove the object information instance corresponding to field, using information about its parent nod...
list< SResolvedField > TObs
bool GetFieldsByName(CMQueryNodeValue::TObs *results, const CObjectInfo &oi_i, const string &field_name)
Resolve existing dot qualified ASN.1 name (field_name) starting from the object information instance ...
bool SetFieldsByName(CMQueryNodeValue::TObs *results, CObjectInfo &oi_i, const string &field_name)
Resolve not necessarily existing dot qualified ASN.1 name (field_name) starting from the object infor...
static const char * sm_Gene
virtual const CTypeInfo * GetThisTypeInfo(void) const =0
#define MSerial_AsnText
I/O stream manipulators –.
@ ePrimitiveValueString
string|char*|const char*
@ ePrimitiveValueInteger
(signed|unsigned) (char|short|int|long)
@ ePrimitiveValueEnum
enum
@ eSerial_AsnText
ASN.1 text.
void SetPrimitiveValueString(const string &value)
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) const THROWS_NONE
Get pointer,.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
CRange< TSeqPos > TSeqRange
typedefs for sequence ranges
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
void Stop(void)
Suspend the timer.
void Start(void)
Start the timer.
virtual void Reset(void)
Reset the whole object.
void SetSeq(const TSeq &value)
Assign a value to Seq data member.
void SetGenome(TGenome value)
Assign a value to Genome data member.
void SetForward(TForward &value)
Assign a value to Forward data member.
void SetPcr_primers(TPcr_primers &value)
Assign a value to Pcr_primers data member.
void SetName(const TName &value)
Assign a value to Name data member.
void SetOrg(TOrg &value)
Assign a value to Org data member.
TStr & SetStr(void)
Select the variant.
void SetType(TType &value)
Assign a value to Type data member.
void SetTaxname(const TTaxname &value)
Assign a value to Taxname data member.
@ eSubtype_other
ASN5: old-name (254) will be added to next spec.
const TName & GetName(void) const
Get the Name member data.
void SetLocation(TLocation &value)
Assign a value to Location data member.
const TData & GetData(void) const
Get the Data member data.
void SetData(TData &value)
Assign a value to Data data member.
const TProt & GetProt(void) const
Get the variant data.
TLocal & SetLocal(void)
Select the variant.
void SetCompleteness(TCompleteness value)
Assign a value to Completeness data member.
TId & SetId(void)
Assign a value to Id data member.
const TInst & GetInst(void) const
Get the Inst member data.
TTitle & SetTitle(void)
Select the variant.
void SetInst(TInst &value)
Assign a value to Inst data member.
void SetBiomol(TBiomol value)
Assign a value to Biomol data member.
void SetDescr(TDescr &value)
Assign a value to Descr data member.
TUser & SetUser(void)
Select the variant.
TMolinfo & SetMolinfo(void)
Select the variant.
@ eRepr_raw
continuous sequence
@ eCompleteness_complete
complete biological entity
Functions that resolve field names described in asn format.
Utility stuff for more convenient using of Boost.Test library.
string MakeAsn(const T &object)
size_t TestFeaturesInRange(const CMacroBioData &data, const SFeatInterval &interval)
BOOST_AUTO_TEST_CASE(Test_FeatureIterator)