: m_Space(0), m_Gap(0)
64: m_Options(0), m_Space(0), m_Gap(0)
81: m_Worst(
orig.m_Worst),
82m_Best(
orig.m_Best),
83m_Options(
orig.m_Options),
84m_Space(
orig.m_Space),
121 #define QUALITY_DESCR "This scheme assigns scores to residues"\
122" based on how well a particular residue agrees with the others in a column."
158 size_tcolumn_size =
column.size() - n_space;
159vector<double> X(symbols.size(), 0);
160 for(
size_t r= 0;
r<symbols.size(); ++
r) {
161 ITERATE(
string, c_it, symbols) {
164X[
r] /= column_size;
167 doublequality_score = 0;
168 for(
size_t i= 0;
i<
column.size(); ++
i) {
175 doublescore_sq_sum = 0;
176 for(
size_t r= 0;
r< symbols.size(); ++
r) {
178score_sq_sum += score_diff * score_diff;
182scores[
i] = resid_score;
184quality_score += resid_score;
188col_score = (
TScore) (quality_score / column_size);
191 for(
size_t i= 0;
i<
column.size(); ++
i) {
196scores[
i] = col_score;
236 if(score < 0.0) score = 0.0;
239 intindex = (
int) floor(score *
size);
265DECLARE_EVENT_TABLE()
271 void OnApply( wxCommandEvent& event );
287m_MatrixChoice(), m_GradPanel()
303wxBoxSizer* itemBoxSizer1 =
newwxBoxSizer(wxVERTICAL);
304this->SetSizer(itemBoxSizer1);
314itemBoxSizer1->Add(
m_GradPanel, 1, wxGROW|wxALL, 5);
320wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxHORIZONTAL);
321itemBoxSizer1->Add(itemBoxSizer2, 0, wxALIGN_RIGHT|wxALL, 5);
323itemBoxSizer2->Add(
newwxStaticText(
this, wxID_STATIC,
_(
"Substitution matrix:")),
3240, wxALIGN_CENTER_VERTICAL|wxALL, 5);
327itemBoxSizer2->Add(
m_MatrixChoice, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
331 ITERATE(vector<string>, iter, table_names) {
337 if(!matrix_name.empty()) {
342wxCheckBox* itemCheckBox1 =
newwxCheckBox(
this,
wxID_ANY,
_(
"Score column as a whole"));
343itemCheckBox1->SetValidator(wxGenericValidator(&
m_ColScore));
344itemBoxSizer1->Add(itemCheckBox1, 0, wxALIGN_LEFT|wxALL, 5);
346wxCheckBox* itemCheckBox2 =
newwxCheckBox(
this,
wxID_ANY,
_(
"Ignore Gaps"));
347itemCheckBox2->SetValidator(wxGenericValidator(&
m_Gap));
348itemBoxSizer1->Add(itemCheckBox2, 0, wxALIGN_LEFT|wxALL, 5);
369 if(!matrix_name.empty()) {
404 return "Column Quality score - DNA";
422 return string(
"ACGTU");
471 return "Column Quality score - Protein";
536 m_Worst= {30, 144, 255, 255 };
537 m_Best= { 255, 26, 26, 255 };
546m_ConservedOption(
orig.m_ConservedOption),
547m_NotScored(
orig.m_NotScored)
571 return "Conservation";
574 const string CONSERVATION_METOD_DESCR= R
"foo(This is a column-based method that highlights highly conserved and less conserved columns based on residues's relative entropy threshold. 575 Alignment columns with no gaps are colored in blue or red. 576 The red color indicates highly conserved columns and blue indicates less conserved ones.)foo"; 609 returnresidue_counts[kGap] == 0 && residue_counts[kResidueX] == 0
610&& residue_counts[kResidueB] == 0 && residue_counts[kResidueZ] == 0
611&& residue_counts[kResidueU] == 0 && residue_counts[kResidueStar] == 0;
620 const double* std_prob)
625 for(
size_t i= 1;
i< counts.size();
i++) {
626 if(counts[
i] == 0) {
632 if(!(std_prob[
i] > 0.0))
continue;
633 doublefreq = (double)counts[
i] / (
double)num_rows;
634retval += freq *
log(freq / std_prob[
i]) /
log(2.0);
647 for(
size_t i= 1;
i< counts.size();
i++) {
648 if(counts[
i] > 0 && counts[
i] < num_rows) {
651 if(counts[
i] == num_rows) {
661 const double* std_prob)
const 663 boolretval =
false;
668 doublebit_threshold = 0.0;
670 case eOneBit: bit_threshold = 1.0;
break;
671 case eTwoBits: bit_threshold = 2.0;
break;
672 case eThreeBits: bit_threshold = 3.0;
break;
673 case eFourBits: bit_threshold = 4.0;
break;
691 for(
auto& aa :
column) {
694residue_counts[residue]++;
704fill(scores.begin(), scores.end(), col_score);
721 static const CRgbaColorcolor_black(
"black");
730 intindex = (
int)floor(score *
size);
734 static const CRgbaColorcolor_white(
"white");
753 if(opt.second == l_name) {
758 ERR_POST(
"Invalid conservation setting:\""<< name <<
"\"");
767DECLARE_EVENT_TABLE()
773 void OnApply(wxCommandEvent& event);
785m_ConservedOptionChoice(),
799wxBoxSizer* itemBoxSizer1 =
newwxBoxSizer(wxVERTICAL);
800this->SetSizer(itemBoxSizer1);
810itemBoxSizer1->Add(
m_GradPanel, 1, wxGROW | wxALL, 5);
812wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxHORIZONTAL);
813itemBoxSizer1->Add(itemBoxSizer2, 0, wxALIGN_RIGHT | wxALL, 5);
815itemBoxSizer2->Add(
newwxStaticText(
this, wxID_STATIC,
_(
"Conservation Setting:")),
8160, wxALIGN_CENTER_VERTICAL | wxALL, 5);
822s.Replace(
wxT(
"_"),
wxT(
" "));
823s[0] = wxToupper(s[0]);
Declarations of static arrays used to define some NCBI encodings to be used in a toolkit independent ...
Various auxiliary BLAST utility functions.
double * BLAST_GetStandardAaProbabilities(void)
Get the standard amino acid probabilities.
CConservationScoringMethod - implementation of IScoringMethod.
virtual const CRgbaColor & GetColorForScore(TScore score, EColorType type) const
returns a color corresponding to a given score value.
CConservationScoringMethod()
CConservationScoringMethod.
bool x_IsConserved(const vector< int > &counts, int num_rows, const double *std_prob) const
void SetConservedOption(const string &name)
virtual int GetType() const
returns combination of EAlignType flags defining types of alignments that can be colored with this me...
virtual ~CConservationScoringMethod()
virtual wxWindow * CreatePropertiesPanel(wxWindow *parent)
This a factory method that shall produce a CPropertiesPanel representing properties of the method; th...
virtual void CalculateScores(char cons, const string &column, TScore &col_score, TScoreVector &scores)
virtual IUITool * Clone() const
virtual int GetSupportedColorTypes() const
returns a combination of EColorType flags
virtual string GetName() const
returns unique name of the method that is used in UI to identify it
EOptions m_ConservedOption
virtual string GetDescription() const
returns a detailed description of the method that is used in UI
friend class CConservationScoringPanel
CConservationScoringPanel.
CConservationScoringPanel(CConservationScoringMethod &method, wxWindow *parent, wxWindowID id=wxID_ANY)
void OnApply(wxCommandEvent &event)
CConservationScoringMethod & m_Method
CGradientColorPanel * m_GradPanel
wxChoice * m_ConservedOptionChoice
void GetParams(stParams ¶ms) const
CQualityScoringMethodAA - Quality scoring method for Amino Acids (Protein alignments).
virtual IUITool * Clone() const
const SNCBIPackedScoreMatrix * m_SubstMatrix
SNCBIFullScoreMatrix m_FullSubstMatrix
virtual string GetName() const
returns unique name of the method that is used in UI to identify it
const SNCBIPackedScoreMatrix * GetSubstitutionMatrix()
CQualityScoringMethodAA()
CQualityScoringMethodAA.
virtual ~CQualityScoringMethodAA()
virtual TNCBIScore GetSubstitutionScore(int aa1, int aa2) const
virtual string GetAllowedSymbols() const
void SetSubstitutionMatrix(const SNCBIPackedScoreMatrix *m)
virtual int GetType() const
returns combination of EAlignType flags defining types of alignments that can be colored with this me...
virtual string GetAllowedSymbols() const
CQualityScoringMethodNA()
CQualityScoringMethodNA.
virtual string GetName() const
returns unique name of the method that is used in UI to identify it
virtual TNCBIScore GetSubstitutionScore(int aa1, int aa2) const
virtual IUITool * Clone() const
virtual int GetType() const
returns combination of EAlignType flags defining types of alignments that can be colored with this me...
virtual ~CQualityScoringMethodNA()
CQualityScoringMethod - Like CSimpleScoringMethod, in that it calculate the quality of the alignment ...
virtual ~CQualityScoringMethod()
CQualityScoringMethod()
CQualityScoringMethod.
virtual const CMenuItem * GetMenu()
Returns a pointer to the submenu.
CRgbaGradColorTable m_ColorTable
friend class CQualityScoringPanel
virtual const CRgbaColor & GetColorForNoScore(EColorType type) const
Call for display colors when CanCalculateScores returns false.
virtual bool CanCalculateScores(const IScoringAlignment &aln)
Do we have what it takes to calculate scores? e.g. a master row selected?
virtual TNCBIScore GetSubstitutionScore(int aa1, int aa2) const =0
bool IsScoreWholeColumn() const
virtual string GetDescription() const
returns a detailed description of the method that is used in UI
virtual void SetColorForNoScore(EColorType type, const CRgbaColor &color)
void CreateColorTable(int size)
virtual wxWindow * CreatePropertiesPanel(wxWindow *parent)
This a factory method that shall produce a CPropertiesPanel representing properties of the method; th...
@ fIgnoreGaps
Do not count gaps in the alignment in the score.
@ fScoreWholeColumn
The column's total score is also the score for each residue.
@ fIgnoreEmptySpace
Do not count unaligned regions in score.
virtual bool IsAverageable() const
return "true" if scores could be averaged
virtual const CRgbaColor & GetColorForScore(TScore score, EColorType type) const
returns a color corresponding to a given score value.
virtual void CalculateScores(char cons, const string &column, TScore &col_score, TScoreVector &scores)
virtual string GetAllowedSymbols() const =0
virtual int GetSupportedColorTypes() const
returns a combination of EColorType flags
void SetOptions(int options)
virtual bool HasPropertiesPanel() const
returns true if the method supports properties dialog
void OnApply(wxCommandEvent &event)
CQualityScoringPanel(CQualityScoringMethod &method, wxWindow *parent, wxWindowID id=wxID_ANY)
wxChoice * m_MatrixChoice
CQualityScoringMethod & m_Method
CGradientColorPanel * m_GradPanel
class CRgbaColor provides a simple abstraction for managing colors.
char m_AmbiguousResidue
Ambiguous Residue, typically 'N' for nucleotides, 'X' for proteins.
static const int kAmbiguousResidueScore
vector< TScore > TScoreVector
virtual int GetType() const =0
returns combination of EAlignType flags defining types of alignments that can be colored with this me...
static const int sm_DefGradientSize
default number of colors in gradient
static const Colors colors
static const char * column
const Uint1 AMINOACID_TO_NCBISTDAA[]
Translates between ncbieaa and ncbistdaa.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void SetSize(size_t size)
void FillGradient(const CRgbaColor &start_c, const CRgbaColor &end_c)
initialize the whole table with gradient colors in [start_c, end_c] range
static const SNCBIPackedScoreMatrix * NameToTable(const string &name)
static vector< string > AllTableNames()
void Set(float r, float g, float b)
set the color from an Fl_Color
static string TableToName(const SNCBIPackedScoreMatrix *)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static string & ToLower(string &str)
Convert string to lower case â string& version.
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 orig
const struct ncbi::grid::netcache::search::fields::SIZE size
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
static const int kAlphabetSize
static bool s_IsIdentity(const vector< int > &counts, int num_rows)
const string CONSERVATION_METOD_DESCR
static map< CConservationScoringMethod::EOptions, string > sm_ConservationValues
static bool s_IsResidueOnlyColumn(const vector< int > &residue_counts)
static double s_GetInfoContent(const vector< int > &counts, int num_rows, const double *std_prob)
const SNCBIPackedScoreMatrix NCBISM_Blosum62
#define NCBI_FSM_DIM
Recommended approach: unpack and index directly.
void NCBISM_Unpack(const SNCBIPackedScoreMatrix *psm, SNCBIFullScoreMatrix *fsm)
Expand a packed score matrix into an unpacked one, which callers can proceed to index directly by sta...
int TNCBIScore
data types
static const char * kMaxScore
const char * symbols
order of residues
wxString ToWxString(const string &s)
string ToStdString(const wxString &s)
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