32 #include <wx/graphics.h>
33 #include <wx/settings.h>
34 #include <wx/clipbrd.h>
35 #include <wx/msgdlg.h>
36 #include <wx/evtloop.h>
65 const vector<
int> &feat_frames,
67 const string &allowed_char_set,
const vector<
string> &real_prot,
const vector<
bool> &read_only,
70 : wxVScrolledWindow(parent,
id, pos,
size, wxFULL_REPAINT_ON_RESIZE|wxWANTS_CHARS), m_Seq(seq), m_SeqLen(seq_len), m_FeatRanges(feat_ranges), m_FeatTypes(feat_types), m_FeatStrand(feat_strand),
71 m_FeatFrames(feat_frames), m_GeneticCode(genetic_code), m_Feat5Partial(feat_partial5),
72 m_AllowedCharSet(allowed_char_set), m_RealProt(real_prot), m_read_only(read_only), m_start(start), m_ProtFeatRanges(prot_feat_ranges),
73 m_EnableTranslation(
true), m_EnableTranslation1(
true), m_EnableTranslation2(
true), m_EnableComplement(
true), m_EnableFeatures(
true), m_EnableOnTheFly(
true), m_EnableMismatch(
true),
74 m_EnableRevTranslation(
true), m_EnableRevTranslation1(
true), m_EnableRevTranslation2(
true), m_Down(
false)
76 SetBackgroundStyle(wxBG_STYLE_PAINT);
78 SetBackgroundColour(*wxWHITE);
79 m_Font = wxFont(9, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
91 m_FeatureStart = pair<int,int>(-1,-1);
92 m_FeatureStop = pair<int,int>(-1,-1);
97 m_EnableTranslation =
false;
98 m_EnableTranslation1 =
false;
99 m_EnableTranslation2 =
false;
100 m_EnableRevTranslation =
false;
101 m_EnableRevTranslation1 =
false;
102 m_EnableRevTranslation2 =
false;
103 m_EnableComplement =
false;
104 m_EnableFeatures =
false;
105 m_EnableOnTheFly =
false;
106 m_EnableMismatch =
false;
107 m_ShowTripletMismatch = -1;
108 m_ShowTripletTranslation = -4;
111 wxWindow *win = GetParent();
117 win = win->GetParent();
126 wxGraphicsContext *gc = wxGraphicsContext::Create();
127 gc->SetFont(
m_Font, *wxBLACK);
138 vector<unsigned int> feats_in_row =
GetFeaturesInRow(
static_cast<int>(row));
149 const vector<pair<string,objects::CSeqFeatData::ESubtype> > &feat_types,
150 const vector<objects::CBioseq_Handle::EVectorStrand> &feat_strand,
151 const vector<int> &feat_frames,
153 const vector<bool> &feat_partial5,
154 const vector<string> &real_prot,
155 const unordered_map<
int, vector<vector<pair<TSeqPos,TSeqPos> > > > &prot_feat_ranges)
260 if (
m_FeatStrand[
i] == objects::CBioseq_Handle::eStrand_Minus)
374 if (m_CursorSeq < 0 || m_CursorSeq >=
m_Seq.size() - 1)
376 if (
m_Seq.size() == 2)
378 wxMessageBox (
_(
"Unable to delete the whole sequence"),
_(
"Error"), wxOK|wxICON_ERROR);
410 int uc =
tolower(event.GetKeyCode());
411 if ( !event.HasModifiers() && uc != WXK_NONE && uc >= 32 && uc < 255 &&
m_AllowedCharSet.find(uc) != string::npos)
423 wxSize sz = GetClientSize();
424 int num_rows =
static_cast<int>(GetVisibleRowsEnd() - GetVisibleRowsBegin());
426 int uc =
event.GetKeyCode();
435 case WXK_PAGEUP :
m_CursorRow =
static_cast<int>(GetVisibleRowsBegin() - num_rows);
m_CursorSeq = -1;
break;
436 case WXK_PAGEDOWN :
m_CursorRow =
static_cast<int>(GetVisibleRowsBegin() + num_rows);
m_CursorSeq = -1;
break;
501 int row =
static_cast<int>(GetVisibleRowsBegin());
503 while ( y_row < y && row <= GetVisibleRowsEnd()+1 )
545 for (
unsigned int k = 0; k < feats_in_row.size(); k++)
547 unsigned int i = feats_in_row[k];
548 auto it = feats_with_exons.
find(
i);
551 if (it != feats_with_exons.
end())
553 for (
unsigned int m = 0; m < it->second.size(); m++)
555 unsigned int j = it->second[m];
596 if (evt.GetModifiers() == wxMOD_SHIFT)
598 wxPoint p = evt.GetPosition();
628 wxPoint p = evt.GetPosition();
638 int current = p.y - y_row;
648 if ( current > y && current < y_trial)
714 for (
size_t k = 0; k < feats_in_row.size(); k++)
718 unsigned int i = feats_in_row[k];
723 if ( current > y && current < y_next)
745 if (
m_Down && evt.Dragging())
749 wxPoint p = evt.GetPosition();
792 wxPoint p = evt.GetPosition();
863 if (IsShownOnScreen())
884 wxAutoBufferedPaintDC dc(
this);
885 wxGraphicsContext *gc = wxGraphicsContext::Create( dc );
886 if (gc && !
m_Seq.empty())
889 gc->SetFont(
m_Font, *wxBLACK);
900 size_t hidden_rows = GetVisibleRowsBegin();
902 size_t row = hidden_rows;
903 int client_y = GetClientSize().y;
904 size_t seq_pos = start;
906 while (start <
m_Seq.size())
909 DrawTextLine(substr, y,
static_cast<int>(row), gc, seq_pos);
934 while ((*pos) + 1 == pos1)
948 while ((*pos) - 1 == pos2)
990 wxColour backgroundColour = GetBackgroundColour();
991 if (!backgroundColour.Ok())
992 backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
993 wxSize sz = GetClientSize();
994 wxRect windowRect(wxPoint(0,0), sz);
995 gc->SetBrush(wxBrush(backgroundColour));
996 gc->SetPen(wxPen(backgroundColour, 1));
997 gc->DrawRectangle(windowRect.GetX(),windowRect.GetY(),windowRect.GetWidth(),windowRect.GetHeight());
1005 wxDouble externalLeading;
1006 if (
m_Seq.size() > 1000)
1008 gc->GetTextExtent(wxString(
m_Seq.substr(0,1000)), &width, &height, &descent, &externalLeading);
1013 gc->GetTextExtent(wxString(
m_Seq), &width, &height, &descent, &externalLeading);
1014 width /=
m_Seq.size();
1016 width = ceil(1+width);
1017 height = ceil(2+height);
1024 int width =
int(GetClientSize().x);
1028 if (num_groups == 0)
1040 unsigned int orig_pos =
static_cast<int>(seq_pos);
1041 int orig_y = y_label;
1044 DrawLabelCell(orig_pos,x,y_label,row, feats_in_row, feats_with_exons, gc);
1046 for (
unsigned int i=0;
i<substr.size();
i++)
1049 DrawTextCell(wxString(substr[
i]),
i,row,
static_cast<unsigned int>(seq_pos),x,y, feats_in_row, feats_with_exons, gc);
1066 void CPaintSequence::DrawLabelCell(
unsigned int pos,
int x,
int &y,
int row,
const vector<unsigned int> &feats_in_row,
const map<
unsigned int, vector<unsigned int> > &feats_with_exons, wxGraphicsContext *gc)
const
1077 void CPaintSequence::DrawTextCell(
const wxString &substr,
int col,
int row,
unsigned int seq_pos,
int x,
int &y,
const vector<unsigned int> &feats_in_row,
const map<
unsigned int, vector<unsigned int> > &feats_with_exons, wxGraphicsContext *gc)
const
1085 gc->SetFont(
m_Font, wxColour(255,0,255));
1086 gc->DrawText(
label,x,y);
1087 gc->SetFont(
m_Font,*wxBLACK);
1093 gc->SetPen(wxPen(wxColour(255,0,255)));
1105 gc->SetFont(
m_Font, wxColour(237,222,14));
1109 gc->SetFont(
m_Font,*wxBLACK);
1115 if (pos1 >= 0 && pos2 >= 0 && seq_pos >= pos1 && seq_pos <= pos2)
1116 gc->DrawText(substr,x,y, gc->CreateBrush(*wxLIGHT_GREY_BRUSH));
1118 gc->DrawText(substr,x,y);
1119 gc->SetFont(
m_Font,*wxBLACK);
1122 gc->SetPen( *wxGREY_PEN);
1139 DrawFeatures(row,seq_pos,x,y,y_base,feats_in_row,feats_with_exons,gc);
1147 gc->SetPen( *wxRED_PEN);
1196 if ( seq_pos >=
offset+1 && (seq_pos - 1 -
offset) % 3 == 0 )
1198 int prot_pos = (seq_pos - 1 -
offset) / 3 ;
1199 if (gc && prot_pos <
prot.size() && prot_pos >= 0)
1200 gc->DrawText (wxString(
prot[prot_pos]),x,y);
1210 if (
m_FeatStrand[
i] == objects::CBioseq_Handle::eStrand_Plus)
1211 for (
unsigned int m = 0; m < ranges.size(); m++)
1213 unsigned int j = ranges[m];
1216 if (seq_pos >= start && seq_pos <= stop )
1221 if ( prot_pos % 3 == 1)
1223 if (
i < translation.size() && prot_pos / 3 < translation[
i].size())
1224 prot = translation[
i][prot_pos / 3];
1226 else if (prot_pos % 3 == 0)
1228 else if (prot_pos % 3 == 2)
1234 if (
m_FeatStrand[
i] == objects::CBioseq_Handle::eStrand_Minus)
1235 for (
int m =
static_cast<int>(ranges.size()) - 1; m >= 0; m--)
1237 unsigned int j = ranges[m];
1240 if (seq_pos >= start && seq_pos <= stop )
1245 if ( prot_pos % 3 == 1)
1247 if (
i < translation.size() && prot_pos / 3 < translation[
i].size())
1248 prot = translation[
i][prot_pos / 3];
1250 else if (prot_pos % 3 == 0)
1252 else if (prot_pos % 3 == 2)
1266 gc->SetPen( *wxGREY_PEN);
1272 void CPaintSequence::DrawOnTheFly(
int x,
int &y,
int y_base,
unsigned int seq_pos,
int i,
const map<
unsigned int, vector<unsigned int> > &feats_with_exons, wxGraphicsContext *gc)
const
1284 gc->SetFont(
m_Font, *wxBLUE);
1285 gc->DrawText (wxString(
prot),x,y);
1286 gc->SetFont(
m_Font,*wxBLACK);
1298 void CPaintSequence::DrawMismatch(
int x,
int &y,
int y_base,
unsigned int seq_pos,
int i,
const map<
unsigned int, vector<unsigned int> > &feats_with_exons, wxGraphicsContext *gc)
const
1311 if (
prot != translated_prot)
1312 gc->SetFont(
m_Font,*wxRED);
1314 gc->SetFont(
m_Font, *wxBLUE);
1315 gc->DrawText(wxString(
prot),x,y);
1316 gc->SetFont(
m_Font,*wxBLACK);
1348 const wxPen* pen = wxBLACK_PEN;
1352 default : pen = wxBLACK_PEN;
break;
1363 gc->SetFont(
m_Font, wxColour(255,0,255));
1364 gc->DrawText(
label,x,y);
1365 gc->SetFont(
m_Font,*wxBLACK);
1371 void CPaintSequence::DrawFeatureLabels(
int row,
int x,
int &y,
const vector<unsigned int> &feats_in_row,
const map<
unsigned int, vector<unsigned int> > &feats_with_exons, wxGraphicsContext *gc)
const
1373 for (
unsigned int k = 0; k < feats_in_row.size(); k++)
1375 unsigned int i = feats_in_row[k];
1382 gc->SetFont(
m_Font,*wxBLUE);
1383 gc->DrawText(wxString(
label),x,y);
1384 gc->SetFont(
m_Font,*wxBLACK);
1396 vector<unsigned int> feats_in_row;
1403 int row_end = row_start +
m_NumCols - 1;
1404 if ( (row_start >= start && row_end <= stop) ||
1405 (start >= row_start && start <= row_end) ||
1406 (stop >= row_start && stop <= row_end) )
1408 feats_in_row.push_back(
static_cast<unsigned int>(
i));
1412 return feats_in_row;
1421 gc->DrawText(
_(
"complement"),x,y);
1433 gc->SetFont(
m_Font, *wxBLUE);
1434 gc->DrawText (
_(
"on-the-fly"),x,y);
1435 gc->SetFont(
m_Font, *wxBLACK);
1446 gc->DrawText (
_(
"frame +1"),x,y);
1452 gc->DrawText (
_(
"frame +2"),x,y);
1458 gc->DrawText (
_(
"frame +3"),x,y);
1464 gc->DrawText (
_(
"frame -1"),x,y);
1470 gc->DrawText (
_(
"frame -2"),x,y);
1476 gc->DrawText (
_(
"frame -3"),x,y);
1481 void CPaintSequence::DrawFeatures(
int row,
unsigned int seq_pos,
int x,
int &y,
int y_base,
const vector<unsigned int> &feats_in_row,
const map<
unsigned int, vector<unsigned int> > &feats_with_exons, wxGraphicsContext *gc)
const
1483 for (
unsigned int k = 0; k < feats_in_row.size(); k++)
1485 unsigned int i = feats_in_row[k];
1491 bool startpoint =
false;
1492 bool endpoint =
false;
1494 if (
f != feats_with_exons.end())
1496 for (
unsigned int m = 0; m <
f->second.size(); m++)
1498 unsigned int j =
f->second[m];
1502 if (seq_pos >= start && seq_pos <= stop)
1505 if (seq_pos == start)
1507 if (seq_pos == stop)
1518 gc->SetBrush(*wxBLACK_BRUSH);
1528 if (
m_FeatStrand[
i] == objects::CBioseq_Handle::eStrand_Plus)
1535 gc->DrawLines(3,lines);
1543 gc->DrawLines(3,lines);
1559 if (wxTheClipboard->Open())
1567 if (pos1 >= 0 && pos2 >= 0)
1568 wxTheClipboard->SetData(
new wxTextDataObject(
m_Seq.substr(pos1, pos2 - pos1 + 1)) );
1569 wxTheClipboard->Close();
1581 if (pos1 >= 0 && pos2 >= 0)
1583 if (pos1 == 0 && pos2 ==
m_Seq.size() - 2)
1585 wxMessageBox (
_(
"Unable to delete the whole sequence"),
_(
"Error"), wxOK|wxICON_ERROR);
1589 bool read_only =
false;
1591 for (
int i = pos1;
i <= pos2;
i++)
1611 str1 =
m_Seq.substr(0, pos1);
1613 if (pos2 + 1 <
m_Seq.size())
1614 str2 =
m_Seq.substr(pos2 + 1);
1617 for (
int i = pos1;
i <= pos2;
i++)
1639 if (wxTheClipboard->Open())
1646 wxTheClipboard->SetData(
new wxTextDataObject(
result) );
1649 wxTheClipboard->Close();
1662 if (wxTheClipboard->Open())
1664 if (wxTheClipboard->IsSupported( wxDF_UNICODETEXT ) &&
m_CursorSeq >= 0)
1666 wxTextDataObject data;
1667 wxTheClipboard->GetData( data );
1668 string str = data.GetText().ToStdString();
1670 bool allowed =
true;
1671 for (
size_t i=0;
i<
str.size();
i++)
1677 if (!
str.empty() && allowed)
1696 wxTheClipboard->Close();
1703 if (wxTheClipboard->Open())
1705 if (wxTheClipboard->IsSupported( wxDF_UNICODETEXT ))
1707 wxTextDataObject data;
1708 wxTheClipboard->GetData( data );
1709 string str = data.GetText().ToStdString();
1711 bool allowed =
true;
1712 for (
size_t i=0;
i<
str.size();
i++)
1718 if (!
str.empty() && allowed)
1723 wxTheClipboard->Close();
1742 return pair<int,int>(pos1, pos2);
1775 return static_cast<int>(
m_Seq.size() - 1);
1799 seq +=
m_Seq.substr(start, stop-start+1);
1803 if (
m_FeatStrand[
i] == objects::CBioseq_Handle::eStrand_Minus)
1821 if (
m_FeatStrand[
i] == objects::CBioseq_Handle::eStrand_Minus)
1828 if (
m_FeatStrand[
i] == objects::CBioseq_Handle::eStrand_Minus)
1870 if (
offset < 0 && origin <= start && origin - offset >= stop)
1919 start =
static_cast<int>(
m_Seq.size() - 2);
1921 stop =
static_cast<int>(
m_Seq.size() - 2);
1940 vector<TSeqPos> length_before;
1947 length_before.push_back(length);
1959 vector<unsigned int> ranges;
1965 int row_end = row_start +
m_NumCols - 1;
1966 if ( (row_start >= start && row_end <= stop) ||
1967 (start >= row_start && start <= row_end) ||
1968 (stop >= row_start && stop <= row_end) )
1970 ranges.push_back(j);
1980 for (
unsigned int k = 0; k < feats_in_row.size(); k++)
1982 unsigned int i = feats_in_row[k];
1984 if (!ranges.empty())
1985 feats_with_exons[
i] = ranges;
1987 return feats_with_exons;
void ReportRange(int pos1, int pos2)
void ShowReadOnlyWarning()
void EnableCommit(bool enable)
set< int > & SetHighlights()
vector< vector< pair< TSeqPos, TSeqPos > > > m_FeatRanges
virtual wxCoord OnGetRowHeight(size_t row) const
int m_ShowTripletMismatch
vector< CRef< objects::CGenetic_code > > m_GeneticCode
void EnableRevTranslation1(bool enable)
virtual ~CPaintSequence()
void DrawOnTheFlyLabel(int x, int &y, bool is_exon_present, wxGraphicsContext *gc) const
void EnableOnTheFly(bool enable)
vector< pair< TSeqPos, TSeqPos > > m_FeatWholeRange
void DrawLineNumber(unsigned int seq_pos, int x, int &y, wxGraphicsContext *gc) const
const wxPen * GetColorForFeature(objects::CSeqFeatData::ESubtype subtype) const
bool m_EnableTranslation2
void DrawLabelCell(unsigned int pos, int x, int &y, int row, const vector< unsigned int > &feats_in_row, const map< unsigned int, vector< unsigned int > > &feats_with_exons, wxGraphicsContext *gc) const
vector< bool > m_Feat5Partial
vector< string > m_RealProt
vector< int > m_FeatFrames
void AdjustFeatStartStop(int origin, int offset, int &start, int &stop)
void DrawOffsetTranslation(int x, int y, unsigned int seq_pos, int offset, const string &prot, wxGraphicsContext *gc) const
vector< string > m_Translated
void OnChar(wxKeyEvent &event)
vector< unsigned int > GetFeaturesInRow(int row) const
void ClearScreen(wxGraphicsContext *gc)
void OnCut(wxCommandEvent &event)
vector< bool > m_read_only
virtual void OnEraseBackground(wxEraseEvent &event)
vector< int > & GetSeqLen()
pair< int, int > m_FeatureStart
string * GetFindString(bool is_nuc, bool is_revcomp, const string &choice)
bool m_EnableRevTranslation1
pair< int, int > GetSelection()
void DrawMismatch(int x, int &y, int y_base, unsigned int seq_pos, int i, const map< unsigned int, vector< unsigned int > > &feats_with_exons, wxGraphicsContext *gc) const
void DrawOnTheFly(int x, int &y, int y_base, unsigned int seq_pos, int i, const map< unsigned int, vector< unsigned int > > &feats_with_exons, wxGraphicsContext *gc) const
void DrawTranslation(int x, int &y, unsigned int seq_pos, wxGraphicsContext *gc) const
void EnableMismatch(bool enable)
void DrawMismatchLabel(int x, int &y, bool is_exon_present, wxGraphicsContext *gc) const
void DrawCursor(int col, int row, int x, int &y, wxGraphicsContext *gc) const
void EnableComplement(bool enable)
void DrawTranslationLabels(int row, int x, int &y, wxGraphicsContext *gc) const
void OnMouseDrag(wxMouseEvent &evt)
int FindRowByCoord(int y, int &y_row)
void UpdateFeatures(const vector< vector< pair< TSeqPos, TSeqPos > > > &feat_ranges, const vector< pair< string, objects::CSeqFeatData::ESubtype > > &feat_types, const vector< objects::CBioseq_Handle::EVectorStrand > &feat_strand, const vector< int > &feat_frames, const vector< CRef< objects::CGenetic_code > > &genetic_code, const vector< bool > &feat_partial5, const vector< string > &real_prot, const unordered_map< int, vector< vector< pair< TSeqPos, TSeqPos > > > > &prot_feat_ranges)
void OnPaste(wxCommandEvent &event)
void DrawFeatures(int row, unsigned int seq_pos, int x, int &y, int y_base, const vector< unsigned int > &feats_in_row, const map< unsigned int, vector< unsigned int > > &feats_with_exons, wxGraphicsContext *gc) const
int m_ShowTripletTranslation
void OnKeyDown(wxKeyEvent &event)
void EnableTranslation1(bool enable)
void SetRange(int pos1, int pos2)
void DrawComplement(int x, int &y, unsigned int seq_pos, wxGraphicsContext *gc) const
void OnMouseClick(wxMouseEvent &evt)
void OnCopy(wxCommandEvent &event)
void DrawFeatureLabels(int row, int x, int &y, const vector< unsigned int > &feats_in_row, const map< unsigned int, vector< unsigned int > > &feats_with_exons, wxGraphicsContext *gc) const
void EnableRevTranslation(bool enable)
void MouseToFeature(wxPoint p, int row, int y0)
bool MouseToSeqPos(wxPoint p, int &row, int &y_row)
void DrawTextLine(const string &substr, int &y_label, int row, wxGraphicsContext *gc, size_t &seq_pos)
void NormalizeCursorColRows()
void EnableTranslation2(bool enable)
virtual void OnUpdate()
Notification for the derived class that moment is good for doing its update and drawing stuff.
void AdjustProtFeatRange(int origin, int offset, int i)
void OnResize(wxSizeEvent &)
void EnableTranslation(bool enable)
void AdjustFeatureRange(int origin, int offset)
bool m_EnableRevTranslation2
char TranslateOnTheFly(unsigned int seq_pos, int i, const vector< unsigned int > &ranges, const vector< string > &translation, bool &left, bool &right) const
void Search(const string &val)
bool m_EnableTranslation1
virtual void OnPaint(wxPaintEvent &event)
Painting.
void EnableRevTranslation2(bool enable)
vector< pair< string, objects::CSeqFeatData::ESubtype > > m_FeatTypes
void DrawTextCell(const wxString &substr, int col, int row, unsigned int seq_pos, int x, int &y, const vector< unsigned int > &feats_in_row, const map< unsigned int, vector< unsigned int > > &feats_with_exons, wxGraphicsContext *gc) const
void SetClean(bool clean)
vector< TSeqPos > m_FeatTotalLength
TSeqPos GetFeatureStop(int i, int j)
vector< vector< TSeqPos > > m_FeatLengthBefore
vector< unsigned int > IsExonPresent(int i, int row) const
pair< int, int > m_FeatureStop
unsigned int PosToSegment()
void EnableFeatures(bool enable)
void CalculateFontWidthAndHeight(wxGraphicsContext *gc)
unordered_map< int, vector< vector< pair< TSeqPos, TSeqPos > > > > m_ProtFeatRanges
map< unsigned int, vector< unsigned int > > GetFeatsWithExons(int row, const vector< unsigned int > &feats_in_row) const
vector< objects::CBioseq_Handle::EVectorStrand > m_FeatStrand
void OnMouseDown(wxMouseEvent &evt)
void DrawTripletMismatch(int x, int y, int y_base, int i, wxGraphicsContext *gc) const
bool m_EnableRevTranslation
TSeqPos GetFeatureStart(int i, int j)
void DrawComplementLabel(int row, int x, int &y, wxGraphicsContext *gc) const
static SIZE_TYPE ReverseComplement(const string &src, TCoding src_coding, TSeqPos pos, TSeqPos length, string &dst)
static SIZE_TYPE Complement(const string &src, TCoding src_coding, TSeqPos pos, TSeqPos length, string &dst)
const_iterator end() const
const_iterator find(const key_type &key) const
const_iterator begin() const
const_iterator find(const key_type &key) const
const_iterator end() const
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
unsigned int TSeqPos
Type for sequence locations and lengths.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
static void Translate(const string &seq, string &prot, const CGenetic_code *code, bool include_stop=true, bool remove_trailing_X=false, bool *alt_start=NULL, bool is_5prime_complete=true, bool is_3prime_complete=true)
Translate a string using a specified genetic code.
@ fIs5PrimePartial
= 0x4 Translate first codon even if not start codon (because sequence is 5' partial)
@ fRemoveTrailingX
= 0x2 Remove trailing Xs from protein
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case insensitive search.
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string.
static string & ToLower(string &str)
Convert string to lower case – string& version.
static const char label[]
unsigned int
A callback function used to compare two keys in a database.
const struct ncbi::grid::netcache::search::fields::SIZE size
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
double f(double x_, const double &y_)
static const GLdouble origin[]
static const int chars_per_group
static const int space_between_groups
BOOL UpdateData(HWND hDlg, CProjBulderApp *pApp, BOOL bGet)
static const char * str(char *buf, int n)