(ch ==
'(') || (ch ==
')') ||(ch ==
',') ||(ch ==
';');
51 return read(ifs, seqTree);
61 while((ch !=
'(') && (is.good()))
77 if(!
isspace((
unsigned char) ch))
93 if(distance.size() >0)
96 intcolon_loc = distance.find_first_of(
":");
98cursor->name = distance.substr(0, colon_loc);
99distance = distance.erase(0, colon_loc);
104 if(distance[0] !=
':') {
105 intsemi_loc = distance.find_first_of(
";");
107cursor->name = distance.substr(0, semi_loc);
108is.putback(distance[semi_loc]);
116 doubledist = atof(distance.c_str());
119std::cout <<
"Warning: negative branch length! " 120<< cursor->name <<
", D = "<< distance << std::endl;
123cursor->distance = dist;
126std::cout<<
"Warning: already reached top before processing )";
130cursor = seqTree.
parent(cursor);
150ncbi::CNcbiIstrstream iss(
str);
160 returnncbi::CNcbiOstrstreamToString(oss);
165 intnesting_level = 0;
169std::string::const_iterator sci = s.begin();
172 while(*sci !=
'('|| sci == s.end()) {
176 while(sci != s.end()) {
181 if(nesting_level != 0 && !line.empty()) {
182newString.append(line +
"\n");
191}
else if(*sci ==
')') {
193newString.append(line +
"\n");
201 if(line.length() == 0 && nesting_level > 0) {
212newString.append(line);
220 if(newString[newString.length() - 1] !=
';') {
221 if(line.length()==0 || line[line.length() - 1] !=
';') {
224newString.append(line);
244 if(cursor->rowID >= 0)
245os<<cursor->rowID<<
'_';
246os<<cursor->name.c_str()<<
':'<<cursor->distance;
258 while(sib != cursor.
end())
264d = cursor->distance;
267os<<
") "<< cursor->name.c_str() <<
":"<<d;
273os<<
") "<< cursor->name.c_str() <<
";";
static const int NESTED_INDENT
static void readToDelimiter(std::istream &is, std::string &str)
static std::string toNestedString(const SeqTree &seqTree)
static bool read(std::istream &is, SeqTree &seqTree)
static bool readFromFile(std::ifstream &ifs, SeqTree &seqTree)
static bool write(std::ostream &os, const SeqTree &stree, const SeqTree::iterator &cursor)
static bool writeToFile(std::ofstream &ofs, const SeqTree &seqTree)
static void fromString(const std::string &strTree, SeqTree &seqTree)
static std::string toString(const SeqTree &seqTree)
sibling_iterator end() const
unsigned int number_of_children() const
sibling_iterator begin() const
iter append_child(iter position)
pre_order_iterator begin() const
iter insert(iter position, const T &x)
unsigned int number_of_siblings(const iterator_base &) const
bool isDelimiter(char ch)
static const char * str(char *buf, int n)
#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.
CNcbistrstream_Base< IO_PREFIX::ostrstream, IOS_BASE::out > CNcbiOstrstream
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