28 #ifndef _PAINT_SEQUENCE_H_
29 #define _PAINT_SEQUENCE_H_
43 #include <wx/scrolwin.h>
44 #include <wx/vscroll.h>
45 #include <wx/textwrapper.h>
46 #include <wx/dcbuffer.h>
47 #include <wx/platform.h>
49 #include <unordered_map>
68 CPaintSequence(wxWindow *parent,
const string &seq,
const vector<int> &seq_len,
const vector<vector<pair<TSeqPos,TSeqPos> > > &feat_ranges,
const vector<pair<string,objects::CSeqFeatData::ESubtype> > &feat_types,
69 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,
70 const string &allowed_char_set,
const vector<string> &real_prot,
const vector<bool> &read_only,
const unordered_map<
int, vector<vector<pair<TSeqPos,TSeqPos> > > > &prot_feat_ranges,
const int start = 0,
71 wxWindowID
id =
wxID_ANY,
const wxPoint &pos=wxDefaultPosition,
const wxSize &
size=wxDefaultSize);
76 void OnChar(wxKeyEvent& event);
79 void OnCopy( wxCommandEvent& event );
80 void OnCut( wxCommandEvent& event );
81 void OnPaste( wxCommandEvent& event );
103 virtual void OnPaint(wxPaintEvent& event);
109 void UpdateFeatures(
const vector<vector<pair<TSeqPos,TSeqPos> > > &feat_ranges,
110 const vector<pair<string,objects::CSeqFeatData::ESubtype> > &feat_types,
111 const vector<objects::CBioseq_Handle::EVectorStrand> &feat_strand,
112 const vector<int> &feat_frames,
114 const vector<bool> &feat_partial5,
115 const vector<string> &real_prot,
116 const unordered_map<
int, vector<vector<pair<TSeqPos,TSeqPos> > > > &prot_feat_ranges);
119 string *
GetFindString(
bool is_nuc,
bool is_revcomp,
const string &choice);
136 void DrawTextLine(
const string & substr,
int &y_label,
int row, wxGraphicsContext *gc,
size_t &seq_pos);
137 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;
138 void DrawCursor(
int col,
int row,
int x,
int &y, wxGraphicsContext *gc)
const;
139 void DrawTranslation(
int x,
int &y,
unsigned int seq_pos, wxGraphicsContext *gc)
const;
141 void DrawComplement(
int x,
int &y,
unsigned int seq_pos, wxGraphicsContext *gc)
const;
143 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;
144 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;
146 void DrawLineNumber(
unsigned int seq_pos,
int x,
int &y, wxGraphicsContext *gc)
const;
147 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;
148 char TranslateOnTheFly(
unsigned int seq_pos,
int i,
const vector<unsigned int> &ranges,
const vector<string> & translation,
bool &left,
bool &right)
const;
149 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;
153 void DrawOnTheFlyLabel(
int x,
int &y,
bool is_exon_present, wxGraphicsContext *gc)
const;
155 void DrawMismatchLabel(
int x,
int &y,
bool is_exon_present, wxGraphicsContext *gc)
const;
163 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;
176 vector<pair<string,objects::CSeqFeatData::ESubtype> >
m_FeatTypes;
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
TSeqPos GetProtFeatureStart(int i, int k, int j)
void DrawTranslation(int x, int &y, unsigned int seq_pos, wxGraphicsContext *gc) const
void EnableMismatch(bool enable)
vector< bool > & GetReadOnly()
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()
TSeqPos GetProtFeatureStop(int i, int k, int j)
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
CPaintSequence(wxWindow *parent, const string &seq, const vector< int > &seq_len, 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 string &allowed_char_set, const vector< string > &real_prot, const vector< bool > &read_only, const unordered_map< int, vector< vector< pair< TSeqPos, TSeqPos > > > > &prot_feat_ranges, const int start=0, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
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
Include a standard set of the NCBI C++ Toolkit most basic headers.
unsigned int TSeqPos
Type for sequence locations and lengths.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
const struct ncbi::grid::netcache::search::fields::SIZE size
static const GLdouble origin[]
#define row(bind, expected)