(cDIterator ==
end())
116 if(it->cd->GetAccession() == acc) {
126 if(it->cd->GetAccession() == acc) {
149 while(sit != pit.
end())
151cds.push_back(sit->cd);
161 while(sit != pit.
end())
170vector<CCdCore*> tmpCds;
172 for(
unsigned int i= 0;
i< tmpCds.size(); ++
i) {
173cds.push_back(tmpCds[
i]);
179vector<CCdCore*> tmpCds;
182 for(
unsigned int i= 0;
i< tmpCds.size(); ++
i) {
189vector<CCdCore*> cds;
190cds.push_back(cit->cd);
195vector<CDFamily*> families;
197subfam = families[0];
216 if(find(cds.begin(), cds.end(), fit->cd) != cds.end())
217fit->selected =
true;
219fit->selected =
false;
227fit->selected =
true;
236cds.push_back(fit->cd);
250 for(; cit !=
end(); ++cit)
251cds.push_back(cit->cd);
260 CCdCore* parentCd = initialCD;
267currentCd = parentCd;
268path.push_back(currentCd);
278vector<CCdCore*> pathToRoot1, pathToRoot2;
281vector<CCdCore*>::reverse_iterator rit1 = pathToRoot1.rbegin();
282vector<CCdCore*>::reverse_iterator rit2 = pathToRoot2.rbegin();
283vector<CCdCore*>::reverse_iterator lastConvergedIt1, lastConvergedIt2;
284 if( (rit1 == pathToRoot1.rend()) || (rit2 == pathToRoot2.rend()))
286 assert((*rit1) = (*rit2));
287 CCdCore* lastConvergedPoint = *rit1;
288 for(; rit1 != pathToRoot1.rend() && rit2 != pathToRoot2.rend(); rit1++, rit2++)
290 if(*rit1 == *rit2) {
291lastConvergedPoint = *rit1;
292lastConvergedIt1 = rit1;
293lastConvergedIt2 = rit2;
301 for(rit1 = lastConvergedIt1; rit1 != pathToRoot1.rend(); ++rit1) {
302path1.push_back(*rit1);
305reverse(path1.begin(), path1.end());
308 for(rit2 = lastConvergedIt2; rit2 != pathToRoot2.rend(); ++rit2) {
309path2.push_back(*rit2);
312reverse(path2.begin(), path2.end());
314 return findCD(lastConvergedPoint);
320vector<CCdCore*> path1, path2;
323vector<CCdCore*>::reverse_iterator rit1 = path1.rbegin();
324vector<CCdCore*>::reverse_iterator rit2 = path2.rbegin();
325 if( (rit1 == path1.rend()) || (rit2 == path2.rend()))
327 assert((*rit1) = (*rit2));
328 CCdCore* lastConvergedPoint = *rit1;
329 for(; rit1 != path1.rend() && rit2 != path2.rend(); rit1++, rit2++)
331 if((!byAccession && *rit1 == *rit2) || (byAccession && (*rit1)->GetAccession() == (*rit2)->GetAccession()))
332lastConvergedPoint = *rit1;
341 if(cds.
size() == 0)
344 CCdCore* lastConvergedPoint = *cit;
346 if(fit ==
begin() || fit ==
end())
349 for(; cit != cds.
end(); cit++)
351fit =
convergeTo(lastConvergedPoint, *cit, byAccession);
352 if(fit ==
begin() || fit ==
end())
354lastConvergedPoint = fit->cd;
371notOnPath.push_back(cit->cd);
374notOnPath.push_back(cit->cd);
378 returnnotOnPath.size();
384 boolisAncestor =
false;
386 if(cd && potentialAncestorCd && cd != potentialAncestorCd) {
387 if(potentialAncestorCd ==
getRootCD()) {
391 while(
parent&& !isAncestor) {
392 if(
parent== potentialAncestorCd) {
409 boolhasError =
false;
411err.append(
"Null CDFamily Object.\n");
415err.append(
"CDFamily Object Has No Root.\n");
418err.append(
"CDFamily Object With No CDs.\n");
429 for(; fit !=
end(); ++fit)
432acc = fit->cd->GetAccession();
443 CCdCore* cd = one.getRootCD();
444 for(
unsigned int i= 0;
i<
all.size();
i++)
449 returnoccurrence > 1;
454 for(
unsigned int i= 0;
i< families.size();
i++)
456 if(families[
i].
findCD(cd) != families[
i].
end())
457 return&(families[
i]);
466vector<CCdCore*>::iterator cdIterator = cds.begin();
467 while(cdIterator != cds.end())
473cds.erase(cdIterator);
475families.push_back(cdFamily);
476cdIterator = cds.begin();
481 returnfamilies.size();
493cdFamily.
addChild(cds[*sit], parentCD);
496vector<CCdCore*>
tmp(cds);
498 for(
unsigned int i= 0;
i<
tmp.size();
i++)
500 if(children.
find(
i) == children.
end())
502cds.push_back(
tmp[
i]);
516 for(
unsigned int i= 0;
i< cds.size();
i++)
519 if(acc.compare(cds[
i]->GetAccession()) == 0)
528 for(
int i= 0;
i< (
int) cds.size();
i++)
531 if(acc.compare(cds[
i]->GetClassicalParentAccession()) == 0)
534 returnchildren.
size() > 0;
546 static const stringunderscore(
"_");
547 static unsigned int n;
553 boolisRoot = (cursor ==
begin());
570 while(sib != cursor.
end()) {
string GetAccession(int &Version) const
string GetClassicalParentAccession(int &Version) const
CCdCore * getClassicalParent(CCdCore *childCD) const
static bool findParent(CCdCore *cd, vector< CCdCore * > &cds)
bool isDescendant(CCdCore *cd, CCdCore *potentialDescendantCd) const
int getCdsNotOnPathToRoot(CCdCore *initialCD, vector< CCdCore * > ¬OnPath) const
CDFamilyIterator convergeTo(CCdCore *cd1, CCdCore *cd2, bool byAccession=false) const
void getDescendants(vector< CCdCore * > &cds, CCdCore *parentCD) const
int getPathToRoot(CCdCore *initialCD, vector< CCdCore * > &path) const
int getAllCD(vector< CCdCore * > &cds) const
string getNewickRepresentation() const
static void extractFamily(CCdCore *parentCD, CDFamily &cdFamily, vector< CCdCore * > &cds)
CDFamilyIterator setRootCD(CCdCore *rootCD)
static bool findChildren(CCdCore *cd, vector< CCdCore * > &cds, set< int > &children)
CCdCore * getRootCD() const
static int createFamilies(vector< CCdCore * > &cds, vector< CDFamily * > &families)
CDFamilyIterator findCDByAccession(CCdCore *cd) const
void selectCDs(const vector< CCdCore * > &cds)
void subfamily(CDFamilyIterator cit, CDFamily *&subfam, bool childrenOnly=false)
CDFamilyIterator findCD(CCdCore *cd) const
bool removeChild(CCdCore *cd)
int getSelectedCDs(vector< CCdCore * > &cds)
CDFamilyIterator addChild(CCdCore *cd, CCdCore *parentCD)
bool isDirectAncestor(CCdCore *cd, CCdCore *potentialAncestorCd) const
static bool IsFamilyValid(const CDFamily *family, string &err)
static CDFamily * findFamily(CCdCore *cd, vector< CDFamily > &families)
static bool isDup(CDFamily &one, vector< CDFamily > &all)
void getChildren(vector< CCdCore * > &cds, CCdCore *parentCD) const
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
iterator_bool insert(const value_type &val)
const_iterator begin() const
const_iterator find(const key_type &key) const
const_iterator end() const
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
pre_order_iterator end() const
CDFamilyBase::iterator CDFamilyIterator
#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.
static string UIntToString(unsigned int value, TNumToStringFlags flags=0, int base=10)
Convert UInt to string.
static const char label[]
unsigned int
A callback function used to compare two keys in a database.
where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is smart and slim</td> n<td> orig</td> n</tr> n<tr> n<td> last_modified</td> n<td> optional</td> n<td> Integer</td> n<td class=\"description\"> The blob last modification If provided then the exact match will be requested with n the Cassandra storage corresponding field value</td> n<td> Positive integer Not provided means that the most recent match will be selected</td> n<td></td> n</tr> n<tr> n<td> use_cache</td> n<td> optional</td> n<td> String</td> n<td class=\"description\"> The option controls if the Cassandra LMDB cache and or database should be used It n affects the seq id resolution step and the blob properties lookup step The following n options are BIOSEQ_INFO and BLOB_PROP at all
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