50 #ifndef SKIP_DOXYGEN_PROCESSING
116 if (!(*it)->IsSetParent()) {
127 vector< CRef<CSeq_id> > ids(num, seq_id);
145 vector<string> queries;
146 queries.push_back(
"KC128904.1");
147 queries.push_back(
"AB682225.1");
148 queries.push_back(
"HM748810.1");
155 size_t num_queries_found = 0;
159 if (!(*node)->IsSetParent()) {
176 accession = (*it)->GetValue();
181 node_info = (*it)->GetValue();
186 BOOST_REQUIRE(!accession.empty());
187 bool found_query =
false;
190 ITERATE (vector<string>, q, queries) {
192 if (accession == *q) {
194 BOOST_REQUIRE_EQUAL(node_info,
201 BOOST_REQUIRE(found_query ||
206 BOOST_REQUIRE_EQUAL(num_queries_found, queries.size());
225 if (!(*it)->IsSetParent()) {
236 vector< CRef<CSeq_id> > ids(num - 1, seq_id);
244 istr.open(
"data/bare_tree.asn");
249 ids.resize(num + 1, seq_id);
270 if (!(*it)->IsSetParent()) {
295 const int kBlastNameFeatureId = 6;
302 bool is_single_blast_name =
true;
306 if (!(*node)->IsSetParent()) {
312 if ((*it)->CanGetFeatureid()
313 && (*it)->GetFeatureid() == kBlastNameFeatureId) {
315 if ((*it)->CanGetValue()) {
316 if (blast_name.empty()) {
317 blast_name = (*it)->GetValue();
319 else if (blast_name != (*it)->GetValue()) {
320 is_single_blast_name =
false;
325 if (!bn_node_feature) {
331 if (!is_single_blast_name) {
336 BOOST_REQUIRE(is_single_blast_name);
340 BOOST_REQUIRE(
tree->IsSingleBlastName());
343 bn_node_feature->
SetValue(blast_name +
"fake_name");
345 BOOST_REQUIRE(!
tree->IsSingleBlastName());
359 const int kBlastNameFeatureId = 6;
363 bool is_single_blast_name =
true;
367 if (!(*node)->IsSetParent()) {
373 if ((*it)->CanGetFeatureid()
374 && (*it)->GetFeatureid() == kBlastNameFeatureId) {
376 if ((*it)->CanGetValue()) {
377 if (blast_name.empty()) {
378 blast_name = (*it)->GetValue();
380 else if (blast_name != (*it)->GetValue()) {
381 is_single_blast_name =
false;
387 if (!is_single_blast_name) {
392 BOOST_REQUIRE(is_single_blast_name);
397 const CBioTreeDynamic::CBioNode* node
398 =
tree.GetNonNullNode(
tree.GetRootNodeID());
401 BOOST_REQUIRE_EQUAL(node->GetFeature(
405 BOOST_REQUIRE_EQUAL(
tree.GetSimplifyMode(),
423 if (!(*it)->IsSetParent()) {
434 vector< CRef<CSeq_id> > ids(num, seq_id);
439 tree.ExpandCollapseSubtree(2);
448 if (!(*node)->IsSetParent()) {
455 if ((*it)->GetFeatureid()
459 BOOST_REQUIRE_EQUAL((*it)->GetValue(),
"0");
464 BOOST_REQUIRE_EQUAL(
tree.GetSimplifyMode(),
482 if (!(*it)->IsSetParent()) {
493 vector< CRef<CSeq_id> > ids(num, seq_id);
501 BOOST_REQUIRE_EQUAL(
tree.GetNonNullNode(
kNodeId)->GetFeature(
510 BOOST_REQUIRE_EQUAL(
tree.GetNonNullNode(
kNodeId)->GetFeature(
530 int old_root_id =
tree.GetRootNodeID();
531 BOOST_REQUIRE(old_root_id !=
kNodeId);
536 BOOST_REQUIRE_EQUAL(
tree.GetRootNodeID(),
kNodeId);
537 BOOST_REQUIRE_EQUAL((
int)
tree.GetTree().GetTreeNode()->GetValue().GetId(),
541 BOOST_REQUIRE(
tree.GetNode(old_root_id));
556 int old_root_id =
tree.GetRootNodeID();
557 BOOST_REQUIRE(old_root_id !=
kNodeId);
562 BOOST_REQUIRE_EQUAL(
tree.GetRootNodeID(),
kNodeId);
563 BOOST_REQUIRE_EQUAL((
int)
tree.GetTree().GetTreeNode()->GetValue().GetId(),
567 BOOST_REQUIRE(!
tree.GetNode(old_root_id));
585 tree->PrintNewickTree(*ostr);
588 BOOST_CHECK_EQUAL(
output,
"(serpin_B9__Homo_sapiens_:4.73586, (hypothetical_protein__Homo_sapiens_:0, ((serpin_peptidase_inhibitor__clade_B__ovalbumin___member_11__Homo_sapiens_:0.0646582, unnamed_protein_product__Homo_sapiens_:0):0.368709, (((antithrombin_III_precursor__Homo_sapiens_:0, antithrombin_III__Homo_sapiens_:0.00969429):0.00807382, antithrombin_III_variant__Homo_sapiens_:0):0.0311961, unnamed_protein_product__Homo_sapiens_:0):0.560057):0.656712):0);\n");
593 tree->PrintNewickTree(*ostr);
596 BOOST_CHECK_EQUAL(
output,
"(Homo_sapiens:4.73586, (Homo_sapiens:0, ((Homo_sapiens:0.0646582, Homo_sapiens:0):0.368709, (((Homo_sapiens:0, Homo_sapiens:0.00969429):0.00807382, Homo_sapiens:0):0.0311961, Homo_sapiens:0):0.560057):0.656712):0);\n");
601 tree->PrintNewickTree(*ostr);
603 BOOST_CHECK_EQUAL(
output,
"(primates:4.73586, (primates:0, ((primates:0.0646582, primates:0):0.368709, (((primates:0, primates:0.00969429):0.00807382, primates:0):0.0311961, primates:0):0.560057):0.656712):0);\n");
608 tree->PrintNewickTree(*ostr);
610 BOOST_CHECK_EQUAL(
output,
"(ref_NP_004146_1:4.73586, (emb_CAE45712_1:0, ((gb_EAW63158_1:0.0646582, dbj_BAG59299_1:0):0.368709, (((ref_NP_000479_1:0, gb_AAA51796_1:0.00969429):0.00807382, dbj_BAA06212_1:0):0.0311961, dbj_BAG35537_1:0):0.560057):0.656712):0);\n");
617 tree->PrintNewickTree(*ostr);
619 BOOST_CHECK_EQUAL(
output,
"(ref_NP_004146_1_primates_:4.73586, (emb_CAE45712_1_primates_:0, ((gb_EAW63158_1_primates_:0.0646582, dbj_BAG59299_1_primates_:0):0.368709, (((ref_NP_000479_1_primates_:0, gb_AAA51796_1_primates_:0.00969429):0.00807382, dbj_BAA06212_1_primates_:0):0.0311961, dbj_BAG35537_1_primates_:0):0.560057):0.656712):0);\n");
637 tree->PrintNexusTree(*ostr);
641 BOOST_REQUIRE(
output.find(
"BEGIN TAXA;") !=
NPOS);
642 BOOST_REQUIRE(
output.find(
"DIMENSIONS ntax=8;") !=
NPOS);
643 BOOST_REQUIRE(
output.find(
"TAXLABELS serpin_B9__Homo_sapiens_ hypothetical_protein__Homo_sapiens_ serpin_peptidase_inhibitor__clade_B__ovalbumin___member_11__Homo_sapiens_ unnamed_protein_product__Homo_sapiens_ antithrombin_III_precursor__Homo_sapiens_ antithrombin_III__Homo_sapiens_ antithrombin_III_variant__Homo_sapiens_ unnamed_protein_product__Homo_sapiens_;")
645 BOOST_REQUIRE(
output.find(
"BEGIN TREES;") !=
NPOS);
646 BOOST_REQUIRE(
output.find(
"TREE Blast_guide_tree = (serpin_B9__Homo_sapiens_:4.73586, (hypothetical_protein__Homo_sapiens_:0, ((serpin_peptidase_inhibitor__clade_B__ovalbumin___member_11__Homo_sapiens_:0.0646582, unnamed_protein_product__Homo_sapiens_:0):0.368709, (((antithrombin_III_precursor__Homo_sapiens_:0, antithrombin_III__Homo_sapiens_:0.00969429):0.00807382, antithrombin_III_variant__Homo_sapiens_:0):0.0311961, unnamed_protein_product__Homo_sapiens_:0):0.560057):0.656712):0);")
648 BOOST_REQUIRE(
output.find(
"ENDBLOCK;") !=
NPOS);
653 tree->PrintNexusTree(*ostr);
657 BOOST_REQUIRE(
output.find(
"BEGIN TAXA;") !=
NPOS);
658 BOOST_REQUIRE(
output.find(
"DIMENSIONS ntax=8;") !=
NPOS);
659 BOOST_REQUIRE(
output.find(
"TAXLABELS Homo_sapiens Homo_sapiens Homo_sapiens Homo_sapiens Homo_sapiens Homo_sapiens Homo_sapiens Homo_sapiens;")
661 BOOST_REQUIRE(
output.find(
"BEGIN TREES;") !=
NPOS);
662 BOOST_REQUIRE(
output.find(
"TREE Blast_guide_tree = (Homo_sapiens:4.73586, (Homo_sapiens:0, ((Homo_sapiens:0.0646582, Homo_sapiens:0):0.368709, (((Homo_sapiens:0, Homo_sapiens:0.00969429):0.00807382, Homo_sapiens:0):0.0311961, Homo_sapiens:0):0.560057):0.656712):0);")
664 BOOST_REQUIRE(
output.find(
"ENDBLOCK;") !=
NPOS);
669 tree->PrintNexusTree(*ostr);
673 BOOST_REQUIRE(
output.find(
"BEGIN TAXA;") !=
NPOS);
674 BOOST_REQUIRE(
output.find(
"DIMENSIONS ntax=8;") !=
NPOS);
675 BOOST_REQUIRE(
output.find(
"TAXLABELS primates primates primates primates primates primates primates primates;")
677 BOOST_REQUIRE(
output.find(
"BEGIN TREES;") !=
NPOS);
678 BOOST_REQUIRE(
output.find(
"TREE Blast_guide_tree = (primates:4.73586, (primates:0, ((primates:0.0646582, primates:0):0.368709, (((primates:0, primates:0.00969429):0.00807382, primates:0):0.0311961, primates:0):0.560057):0.656712):0);\n")
680 BOOST_REQUIRE(
output.find(
"ENDBLOCK;") !=
NPOS);
685 tree->PrintNexusTree(*ostr);
689 BOOST_REQUIRE(
output.find(
"BEGIN TAXA;") !=
NPOS);
690 BOOST_REQUIRE(
output.find(
"DIMENSIONS ntax=8;") !=
NPOS);
691 BOOST_REQUIRE(
output.find(
"TAXLABELS ref_NP_004146_1 emb_CAE45712_1 gb_EAW63158_1 dbj_BAG59299_1 ref_NP_000479_1 gb_AAA51796_1 dbj_BAA06212_1 dbj_BAG35537_1;")
693 BOOST_REQUIRE(
output.find(
"BEGIN TREES;") !=
NPOS);
694 BOOST_REQUIRE(
output.find(
"TREE Blast_guide_tree = (ref_NP_004146_1:4.73586, (emb_CAE45712_1:0, ((gb_EAW63158_1:0.0646582, dbj_BAG59299_1:0):0.368709, (((ref_NP_000479_1:0, gb_AAA51796_1:0.00969429):0.00807382, dbj_BAA06212_1:0):0.0311961, dbj_BAG35537_1:0):0.560057):0.656712):0);")
696 BOOST_REQUIRE(
output.find(
"ENDBLOCK;") !=
NPOS);
703 tree->PrintNexusTree(*ostr);
707 BOOST_REQUIRE(
output.find(
"BEGIN TAXA;") !=
NPOS);
708 BOOST_REQUIRE(
output.find(
"DIMENSIONS ntax=8;") !=
NPOS);
709 BOOST_REQUIRE(
output.find(
"TAXLABELS ref_NP_004146_1_primates_ emb_CAE45712_1_primates_ gb_EAW63158_1_primates_ dbj_BAG59299_1_primates_ ref_NP_000479_1_primates_ gb_AAA51796_1_primates_ dbj_BAA06212_1_primates_ dbj_BAG35537_1_primates_;")
711 BOOST_REQUIRE(
output.find(
"BEGIN TREES;") !=
NPOS);
712 BOOST_REQUIRE(
output.find(
"TREE Blast_guide_tree = (ref_NP_004146_1_primates_:4.73586, (emb_CAE45712_1_primates_:0, ((gb_EAW63158_1_primates_:0.0646582, dbj_BAG59299_1_primates_:0):0.368709, (((ref_NP_000479_1_primates_:0, gb_AAA51796_1_primates_:0.00969429):0.00807382, dbj_BAA06212_1_primates_:0):0.0311961, dbj_BAG35537_1_primates_:0):0.560057):0.656712):0);")
714 BOOST_REQUIRE(
output.find(
"ENDBLOCK") !=
NPOS);
734 vector<CPhyTreeFormatter::EFeatureID>
788 int id = (*it)->GetId();
792 BOOST_REQUIRE_EQUAL((*it)->GetName(),
799 ITERATE(vector<bool>, it, found) {
822 int id = (*it)->GetFeatureid();
831 node_info = (*it)->GetValue();
835 color = (*it)->GetValue();
838 BOOST_REQUIRE((*it)->GetValue() !=
"");
843 BOOST_REQUIRE_EQUAL(node_info.empty(),
color.empty());
846 BOOST_REQUIRE_EQUAL(
color,
"255 255 0");
865 BOOST_REQUIRE(
tree.CanGetFdict());
872 if (!(*it)->IsSetParent()) {
883 BOOST_REQUIRE_EQUAL(num, num_leaves);
static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, CReader *reader=0, CObjectManager::EIsDefault is_default=CObjectManager::eDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
Computaion of distance-based phylognetic tree.
CRef< CSeq_align > GetSeqAlign(void) const
Get seq_align that corresponds to current tree.
void SetMaxDivergence(double div)
Set maximum allowed divergence between sequences included in tree.
bool CalcBioTree(void)
Compute bio tree for the current alignment in a black box manner.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define MSerial_AsnText
I/O stream manipulators –.
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
void AddDefaults(TPriority pri=kPriority_Default)
Add default data loaders from object manager.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
list< CRef< CFeatureDescr > > Tdata
void SetValue(const TValue &value)
Assign a value to Value data member.
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 TFeatures & GetFeatures(void) const
Get the Features member data.
const Tdata & Get(void) const
Get the member data.
const TNodes & GetNodes(void) const
Get the Nodes member data.
TDim GetDim(void) const
Get the Dim member data.
static SQLCHAR output[256]
BOOST_AUTO_TEST_SUITE(psiblast_iteration)
Utility stuff for more convenient using of Boost.Test library.
static const char *const features[]