35 #ifndef CU_RESIDUE_PROFILE_HPP
36 #define CU_RESIDUE_PROFILE_HPP
49 static unsigned char getNcbiStdCode(
char eaa);
50 static char getEaaCode(
char stdCode) {
return m_residues[stdCode];}
55 void addOccurence(
char residue,
int row,
bool aligned);
56 double calculateColumnWeight(
char residue,
bool countGap,
int numRows)
const;
58 double sumUpColumnWeightsByRow(vector<double>& rowWeights,
bool countGap,
int numRows)
const;
59 double reweightColumnByRowWeights(
const vector<double>& rowWeights,
char& heaviestResidue)
const;
60 int getSumCount()
const;
61 char getMostFrequentResidue(
int&
count)
const ;
63 void getResiduesByRow(vector<char>& residues,
bool byNcbiStd=
true)
const;
65 unsigned char getResidueByRow(
int row);
66 bool isAligned(
char residue,
int row)
const;
67 bool isAligned(
int row);
68 bool isAllRowsAligned()
const;
75 double calcInformationContent();
80 return (
row > (
int)(m_residuesByRow.size()-1)) ? 0 : m_residuesByRow[
row];
89 static void useDefaultBackgroundResFreq();
90 double getBackgroundResFreq(
char res);
132 typedef pair<int,int>
Seg;
136 void setIndexSequence(
string& seq);
137 string getIndexSequence();
140 int getLenOfLongestSeg();
143 int getLongUnalignedSegs(
int length, vector<Seg>& segs);
144 string subtractLongestSeg(
int threshold);
146 string subtractSeg(Seg seg,
string&
in);
166 void calculateRowWeights();
167 const string& makeConsensus();
169 const string getConsensus(
bool inNcbieaa=
true) ;
172 int countColumnsOnMaster(
string& seq);
176 void adjustConsensusAndGuide();
183 double calcInformationContent(
bool byConsensus=
true);
196 unsigned int GetNumUnqualAfterIndex(
int index)
const;
197 bool HasUnqualAfterIndex(
int index)
const;
218 void segsToSet(vector<UnalignedSegReader::Seg>& segs,
set<int>& cols);
virtual void read(ColumnResidueProfile &crp)=0
static const string m_residues
unsigned char getResidueByRow(int row)
multimap< char, RowStatusPair > ResidueRowsMap
pair< int, bool > RowStatusPair
ResidueRowsMap::iterator * findRow(int row)
int getIndexByConsensus() const
static char getEaaCode(char stdCode)
void setIndexByConsensus(int col)
vector< ResidueRowsMap::iterator * > m_residuesByRow
static map< char, double > m_backgroundResFreq
ResidueRowsMap m_residueRowsMap
int getResidueTypeCount() const
virtual void read(ColumnResidueProfile &crp)
virtual ~MasterColumnCounter()
const vector< CRef< CSeq_id > > getSeqIdsByRow() const
void setInclusionThreshold(double th)
vector< double > m_rowWeights
set< int > m_colsToSkipOnConsensus
UnqualForConsMap::const_iterator UnqualForConsCit
BlockModelPair m_guideAlignment
UnqualForConsMap m_numUnqualAfterConsIndex
set< int > m_colsToSkipOnMaster
map< int, unsigned int > UnqualForConsMap
UnqualForConsMap::iterator UnqualForConsIt
map< ColumnAddress, ColumnResidueProfile > PosProfileMap
vector< CRef< CSeq_id > > m_seqIds
double m_frequencyThreshold
vector< Seg > m_unalignedSegs
container_type::const_iterator const_iterator
container_type::iterator iterator
container_type::iterator iterator
bool operator<(const CEquivRange &A, const CEquivRange &B)
thread_local unique_ptr< FtaMsgPost > bmp
#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.
#define NCBI_CDUTILS_EXPORT
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n th
std::istream & in(std::istream &in_, double &x_)
#define row(bind, expected)