orgName(rhs.orgName), rankId(rhs.rankId), rowId(rhs.rowId), cd(rhs.cd), seqName(rhs.seqName),
48numLeaves(rhs.numLeaves),selectedLeaves(rhs.selectedLeaves)
88sprintf(name,
"row_%d_of_%s", rowInCd,
cd->
GetAccession().c_str());
96 returnnode.
rowId>= 0;
106m_rowToTaxNode(), m_rankNameToId(), m_failedRows()
123vector<TaxTreeIterator> nodes;
125 for(
unsigned int i= 0;
i< nodes.size();
i++)
135nodes.push_back(taxNode);
139 while(sib != taxNode.
end())
149 for(
unsigned int i= 0;
i< rowIDs.size();
i++)
167 if(taxIt->selectedLeaves > 0)
168rows.push_back(taxIt->rowId);
181 while(sib != cursor.
end())
192cursor->selectedLeaves = 1;
194cursor->selectedLeaves = 0;
196 else if(cursor->cd == cd)
199cursor->selectedLeaves = 1;
201cursor->selectedLeaves = 0;
207cursor->selectedLeaves = 1;
209cursor->selectedLeaves = 0;
249insert(begin(), *root);
261 for(
int i= 0;
i< num;
i++)
278cursor->numLeaves = 0;
279cursor->selectedLeaves = 0;
283 while(sib != cursor.
end())
289 if(cursor != begin())
292parentIt->numLeaves += cursor->numLeaves;
293parentIt->selectedLeaves += cursor->selectedLeaves;
299stack<TaxNode*> lineage;
316 while(pos != end() && !(*pos == *top) ) {
333lineage.push(parentTax);
341 while(!lineage.empty())
343 TaxNode* topNode = lineage.top();
344cursor = append_child(cursor,*topNode);
352vector<RowSource> rss;
356 for(
unsigned int i= 0;
i< rss.size();
i++)
362append_child(cursor,*subSeqNode);
389 boolgotGI = aligns.
GetGI(rowID, gi,
false);
397 if(seqEntry->
IsSeq())
400 if(localTaxid != taxid)
419 if(seqDescr.
IsSet())
421list< CRef< CSeqdesc > >& descrList = seqDescr.
Set();
422list< CRef< CSeqdesc > >::iterator cit = descrList.begin();
424 while(cit != descrList.end())
426 if((*cit)->IsSource())
428cit = descrList.erase(cit);
439descrList.push_back(
source);
450std::ofstream fout(
".\\SeqTree\\ranks");
455fout<<mit->first<<
' '<<mit->second<<endl;
462ofstream os(fname.c_str());
475ofstream os(fname.c_str());
486 if(number_of_children(cursor) > 1)
488os <<cursor->taxId<<
","<<branchingNode->taxId<<
"\n";
489sibling_iterator sib = cursor.begin();
490 while(sib != cursor.end())
496 else if(number_of_children(cursor) == 1)
498sibling_iterator onlychild = child(cursor,0);
503os<<cursor->seqName<<
","<<branchingNode->taxId<<
"\n";
513 if(cursor->rowId >= 0)
520 if(number_of_children(cursor) > 1)
523sibling_iterator sib = cursor.begin();
524 while(sib != cursor.end())
530 if(number_of_children(cursor) > 1)
536 if(cursor == begin())
539 else if(number_of_siblings(cursor) > 1)
552 if(
leaf->rowId < 0)
556 while(parentNode != begin())
558 if(parentNode->rankId == rank)
562oneBeforeParentNode = parentNode;
563parentNode = parent(parentNode);
567 returnoneBeforeParentNode;
bool GetGI(int row, TGi &gi, bool ignorePDBs=true) const
bool GetSeqEntryForRow(int row, CRef< CSeq_entry > &seqEntry) const
bool Get_GI_or_PDB_String_FromAlignment(int row, std::string &result) const
const RowSourceTable & GetRowSourceTable() const
bool isCDInScope(CCdCore *cd) const
string GetAccession(int &Version) const
TTaxId SetTaxId(TTaxId tax_id)
@Seq_descr.hpp User-defined methods of the data storage class.
int findEntries(int row, vector< RowSource > &src, bool scopedOnly=false) const
virtual short GetRankID(TTaxId taxId, string &rankName)
virtual TTaxId GetTaxIDFromBioseq(const CBioseq &bioseq, bool lookInBioseq)
virtual TTaxId GetParentTaxID(TTaxId taxid)
virtual TTaxId GetTaxIDForGI(TGi gi)
virtual string GetTaxNameForTaxID(TTaxId taxid)
static bool isSubSeqLeaf(const TaxNode &node)
static TaxNode * makeTaxNode(TTaxId taxID, std::string taxName, short rankId=-1)
static bool isSeqLeaf(const TaxNode &node)
static TaxNode * makeSeqLeaf(int rowID, std::string sequenceName)
static TaxNode * makeSubSeqLeaf(int rowID, CCdCore *cd, int rowInCd)
bool writeToFile(string fname) const
short getRankId(string rankName)
void growAndInsertLineage(stack< TaxNode * > &lineage)
RankNameToId m_rankNameToId
void addTaxToBioseq(CBioseq &bioseq, TTaxId taxid, string &taxName)
bool writeToFileAsTable(string fname) const
TaxTreeData(const AlignmentCollection &ac)
const AlignmentCollection & m_ac
TaxClient * m_taxDataSource
int getAllLeafNodes(const TaxTreeIterator &taxNode, vector< TaxTreeIterator > &nodes) const
vector< int > m_failedRows
void fillLeafCount(const TaxTreeIterator &cursor)
void setSelections(const vector< int > &rowIDs, CCdCore *cd=0)
bool write(std::ostream &os, const iterator &cursor) const
RowToTaxNode m_rowToTaxNode
void addSeqTax(int rowID, string seqName, TTaxId taxid)
TTaxId GetTaxIDForSequence(const AlignmentCollection &aligns, int rowID)
void selectTaxTreeLeaf(const TaxTreeIterator &cursor, bool select, CCdCore *cd=0)
TaxTreeIterator getParentAtRank(int row, string rankName)
void selectTaxNode(TaxTreeIterator &taxNode, bool select)
void insertLineage(TaxTreeIterator &pos, stack< TaxNode * > &lineage)
int getSelections(vector< int > &rows)
bool writeAsTable(std::ostream &os, const iterator &cursor, const iterator &branchingNode) const
void cacheRank(short rank, string rankName)
void deselectAllTaxNodes()
void addRows(const AlignmentCollection &ac)
container_type::iterator iterator
const_iterator begin() const
const_iterator end() const
iterator_bool insert(const value_type &val)
container_type::value_type value_type
const_iterator find(const key_type &key) const
sibling_iterator end() const
unsigned int number_of_children() const
sibling_iterator begin() const
static void DLIST_NAME() init(DLIST_LIST_TYPE *list)
SStrictId_Tax::TId TTaxId
Taxon id type.
#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.
void SetTaxname(const TTaxname &value)
Assign a value to Taxname data member.
const TSeq & GetSeq(void) const
Get the variant data.
bool IsSeq(void) const
Check if variant Seq is selected.
TSeq & SetSeq(void)
Select the variant.
bool IsSet(void) const
Check if a value has been assigned to data member.
void SetDescr(TDescr &value)
Assign a value to Descr data member.
Tdata & Set(void)
Assign a value to data member.
const CharType(& source)[N]
#define row(bind, expected)
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