m_cd(cd), m_clusteringThreshold(identityThreshold), m_replacingThreshold(identityThreshold), m_ac(cd,
CCdCore::USE_ALL_ALIGNMENT)
53vector< vector<int> * > clusters;
55vector< pair<int, int> > replacementPairs;
57 LOG_POST(
"Clustering is done (made "<< clusters.size() <<
" clusters)");
58 LOG_POST(
"Find replacements by BLAST in each cluster");
59 for(
unsigned int i= 0;
i< clusters.size();
i++)
61vector<int>* cluster = clusters[
i];
67 LOG_POST(
"Done with BLAST in each cluster");
70vector<int> selectedNormalRows;
72 for(
unsigned intp = 0; p < replacementPairs.size(); p++)
80 LOG_POST(
"replacing "<<nid<<
" with "<<pid);
82 if(replacementPairs[p].
first== 0)
83newMaster = replacementPairs[p].second - numNormal;
86selectedNormalRows.push_back(replacementPairs[p].
first);
87usedPendings.
insert(replacementPairs[p].second - numNormal);
91 if(structures.
size() > 0)
93 LOG_POST(
"Adding "<<structures.
size()<<
" structures");
95usedPendings.
insert(*sit - numNormal);
107rows.push_back(newMaster);
125 doublepid = ((double)identityThreshold)/100.0;
126 doubledistTh = 1.0 - pid;
128vector<SeqTreeIterator> nodes;
130 for(
unsigned int i= 0;
i< nodes.size();
i++)
132vector<int>* rowids =
newvector<int>;
134clusters.push_back(rowids);
142 if(cluster.size() == 0)
145vector<int> normalLocal, normalNonLocal, pending;
146 boolhasNormalPDB =
false;
148 for(
unsigned int i= 0;
i< cluster.size();
i++)
152pending.push_back(cluster[
i]);
155pending3D.
insert(cluster[
i]);
163normalLocal.push_back(cluster[
i]);
166normalNonLocal.push_back(cluster[
i]);
167 if(seqId->
IsPdb())
168hasNormalPDB =
true;
173 if((normalLocal.size() != 0) && (pending.size() != 0))
175vector< pair<int,int> > pairs;
177 for(
unsigned int i= 0;
i< pairs.size();
i++)
179replacementPairs.push_back(pairs[
i]);
181 if(sit != pending3D.
end())
183pending3D.
erase(sit);
189!pending3D.
empty() &&
190!normalNonLocal.empty())
192vector< pair<int,int> > pairsWith3D;
193vector<int> pending3DVec;
195pending3DVec.push_back(*sit);
197 if(pairsWith3D.size() > 0)
199structs.
insert(pairsWith3D[0].second);
206 if((normal.size() == 0) || (pending.size() == 0))
218 for(
int n= 0;
n< (
int) normal.size();
n++)
222 for(
intp = 0; p < (
int) pending.size(); p++)
224 if(usedPendingIndice.
find(p) == usedPendingIndice.
end())
234 if( maxIdIndex >= 0)
236usedPendingIndice.
insert(maxIdIndex);
237pairs.push_back(pair<int, int>(normal[
n], pending[maxIdIndex]));
247 for(
int i= 0;
i< num;
i++)
255 intmasterInPending = -1;
258masterInPending = *newMaster;
266 if(masterInPending >= 0)
267rows.
insert(masterInPending);
bool IsPdb(int row) const
CRef< CSeq_align > getSeqAlign(int row) const
bool IsPending(int row) const
bool GetSeqIDForRow(int row, CRef< CSeq_id > &SeqID) const
bool EraseTheseRows(const std::vector< int > &TossRows)
bool AddSeqAlign(CRef< CSeq_align > seqAlign)
void ErasePendingRows(set< int > &rows)
void setQueryRows(const vector< int > *rows)
double getPairwiseScore(int row1, int row2)
void setScoreType(CSeq_align::EScoreType scoreType)
bool blast(NotifierFunction notifier=0)
void setSubjectRows(const vector< int > *rows)
void findBestPairings(const vector< int > &normal, const vector< int > &pending, vector< pair< int, int > > &pairs)
int m_clusteringThreshold
void makeClusters(int identityThreshold, vector< vector< int > * > &clusters)
void findReplacements(vector< int > &cluster, vector< pair< int, int > > &replacementPairs, set< int > &structs)
void promotePendingRows(set< int > &rows, int *newMaster=0)
void findStructuralPendings(set< int > &rows)
void getDistantNodes(double dist, vector< SeqTreeIterator > &nodes)
void getSequenceRowid(const iterator &node, vector< int > &selections)
double getMaxDistanceToRoot()
static SeqTree * makeTree(AlignmentCollection *alignData, const TreeOptions &treeOptions)
iterator_bool insert(const value_type &val)
const_iterator begin() const
const_iterator find(const key_type &key) const
const_iterator end() const
bool ReMasterCdWithoutUnifiedBlocks(CCdCore *cd, int Row, bool resetFields=true)
@ ePercentIdentityRelaxed
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
const string AsFastaString(void) const
#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 ResetPending(void)
Reset Pending data member.
bool IsPdb(void) const
Check if variant Pdb is selected.
bool IsLocal(void) const
Check if variant Local is selected.
unsigned int
A callback function used to compare two keys in a database.
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