63 #include "wx/wxprec.h"
73 #include <wx/button.h>
74 #include <wx/statbox.h>
75 #include <wx/stattext.h>
76 #include <wx/textdlg.h>
77 #include <wx/msgdlg.h>
78 #include <wx/display.h>
79 #include <wx/hyperlink.h>
368 wxWindowID
id,
const wxString& caption,
const wxPoint& pos,
const wxSize&
size,
long style )
369 : m_loc(loc), m_scope(&scope), m_start(start), m_readonly_timer(this,
READONLY_TIMER_ID)
373 Create(parent,
id, caption, pos,
size, style);
385 bool CEditSequence::Create( wxWindow* parent, wxWindowID
id,
const wxString& caption,
const wxPoint& pos,
const wxSize&
size,
long style )
389 wxFrame::Create( parent,
id, caption, pos,
size, style );
394 GetSizer()->SetSizeHints(
this);
397 Centre(wxBOTH|wxCENTRE_ON_SCREEN);
452 if (width >= 0 && height >= 0)
453 SetSize(wxSize(width,height));
458 if (pos_x >= 0 && pos_y >= 0)
461 for (
auto i = 0;
i < wxDisplay::GetCount();
i++)
463 wxDisplay display(
i);
464 max_x += display.GetGeometry().GetWidth();
466 if (pos_x + width > max_x) pos_x = wxGetDisplaySize().GetWidth()-width-5;
467 if (pos_y + height > wxGetDisplaySize().GetHeight()) pos_y = wxGetDisplaySize().GetHeight()-height-5;
469 SetPosition(wxPoint(pos_x,pos_y));
497 wxMenuBar *menubar =
new wxMenuBar();
498 wxMenu *menu =
new wxMenu();
499 menubar->Append(menu,
wxT(
"&Show"));
501 wxMenu *translate_menu =
new wxMenu();
533 menu->AppendSubMenu(translate_menu,
_(
"Reading frames"));
535 wxMenuItem *revcomp_item =
new wxMenuItem(menu,
ID_SHOW_REVCOMP_EDSEQ_MENU,
_(
"Complement\tAlt+c"),
_(
"Show complement"), wxITEM_CHECK);
536 menu->Append(revcomp_item);
539 menu->Append(features_item);
541 wxMenuItem * onthefly_item =
new wxMenuItem(menu,
ID_SHOW_ONTHEFLY_EDSEQ_MENU,
_(
"On-the-fly\tAlt+t"),
_(
"Show on-the-fly translation"), wxITEM_CHECK);
542 menu->Append(onthefly_item);
545 menu->Append(mismatch_item);
548 wxMenu *menu2 =
new wxMenu();
549 menubar->Append(menu2,
wxT(
"&Edit"));
551 wxMenuItem *cut_item =
new wxMenuItem(menu2,
ID_EDIT_CUT_EDSEQ_MENU,
_(
"Cut\tCtrl+X"),
_(
"Cut to clipboard"), wxITEM_NORMAL);
552 menu2->Append(cut_item);
554 wxMenuItem *copy_item =
new wxMenuItem(menu2,
ID_EDIT_COPY_EDSEQ_MENU,
_(
"Copy\tCtrl+C"),
_(
"Copy to clipboard"), wxITEM_NORMAL);
555 menu2->Append(copy_item);
557 wxMenuItem *paste_item =
new wxMenuItem(menu2,
ID_EDIT_PASTE_EDSEQ_MENU,
_(
"Paste\tCtrl+V"),
_(
"Paste from clipboard"), wxITEM_NORMAL);
558 menu2->Append(paste_item);
560 wxMenuItem *find_item =
new wxMenuItem(menu2,
ID_EDIT_FIND_EDSEQ_MENU,
_(
"Find\tCtrl+F"),
_(
"Find pattern"), wxITEM_NORMAL);
561 menu2->Append(find_item);
565 menubar->Append(menu3,
wxT(
"Annotate"));
567 menubar->Append(menu3,
wxT(
"Features"));
571 wxPanel *Dialog1 =
new wxPanel(
this,
wxID_ANY);
573 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
574 Dialog1->SetSizer(itemBoxSizer2);
576 wxBoxSizer* itemBoxSizer3 =
new wxBoxSizer(wxHORIZONTAL);
577 itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_LEFT|wxALL, 5);
579 wxButton* itemButton6 =
new wxButton( Dialog1,
ID_GOTO_EDSEQ_BUTTON,
wxT(
"Go to:"), wxDefaultPosition, wxDefaultSize, 0 );
580 itemBoxSizer3->Add(itemButton6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
583 itemBoxSizer3->Add(
m_GoTo_TextCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
585 wxStaticText* itemStaticText8 =
new wxStaticText( Dialog1, wxID_STATIC,
wxT(
"Position:"), wxDefaultPosition, wxDefaultSize, 0 );
586 itemBoxSizer3->Add(itemStaticText8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
588 m_Pos =
new wxStaticText( Dialog1, wxID_STATIC,
wxT(
""), wxDefaultPosition, wxSize(Dialog1->ConvertDialogToPixels(wxSize(40, -1)).x, -1), wxNO_BORDER );
589 itemBoxSizer3->Add(
m_Pos, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
592 wxButton* itemButton7 =
new wxButton( Dialog1,
ID_RANGE_EDSEQ_BUTTON,
wxT(
"Select:"), wxDefaultPosition, wxDefaultSize, 0 );
593 itemBoxSizer3->Add(itemButton7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
595 m_RangeFrom =
new wxTextCtrl( Dialog1,
wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
596 itemBoxSizer3->Add(
m_RangeFrom, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
597 m_RangeFrom->SetValidator( wxTextValidator( wxFILTER_NUMERIC ) );
599 wxStaticText* rangeDash =
new wxStaticText( Dialog1, wxID_STATIC,
wxT(
"-"), wxDefaultPosition, wxDefaultSize, 0 );
600 itemBoxSizer3->Add(rangeDash, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5);
602 m_RangeTo =
new wxTextCtrl( Dialog1,
wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
603 itemBoxSizer3->Add(
m_RangeTo, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5);
604 m_RangeTo->SetValidator( wxTextValidator( wxFILTER_NUMERIC ) );
611 vector<bool> read_only;
620 seq_len.push_back(
len);
622 read_only.push_back(
false);
624 read_only.push_back(
true);
633 seq_len.push_back(
static_cast<int>(seq.size()));
634 read_only.push_back(
true);
637 string allowed_char_set =
"ATUCGRYSWKMBDHVN";
639 allowed_char_set =
"ABCDEFGHIJKLMNOPQRSTUVWXYZ*";
641 wxBoxSizer *BoxSizer =
new wxBoxSizer(wxHORIZONTAL);
642 itemBoxSizer2->Add(BoxSizer, 1, wxGROW|wxALL, 5);
643 m_Panel =
new CPaintSequence(Dialog1, seq, seq_len,
m_FeatRanges,
m_FeatTypes,
m_FeatStrand,
m_FeatFrames,
m_GeneticCode,
m_Feat5Partial, allowed_char_set,
m_RealProt, read_only,
m_ProtFeatRanges,
m_start);
644 BoxSizer->Add(
m_Panel, 1, wxGROW|wxALL, 5);
645 features_item->Check();
649 mismatch_item->Check();
654 m_commit_warning =
new wxStaticText( Dialog1, wxID_STATIC,
wxT(
"You need to commit the changes to the sequence before annotating or retranslating"), wxDefaultPosition, wxDefaultSize, 0 );
656 itemBoxSizer2->Add(
m_commit_warning, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM|wxRESERVE_SPACE_EVEN_IF_HIDDEN, 5);
659 m_readonly_warning =
new wxStaticText( Dialog1, wxID_STATIC,
wxT(
"You need to convert to raw sequence before editing within the gap"), wxDefaultPosition, wxDefaultSize, 0 );
661 itemBoxSizer2->Add(
m_readonly_warning, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM|wxRESERVE_SPACE_EVEN_IF_HIDDEN, 5);
664 wxBoxSizer* itemBoxSizer12 =
new wxBoxSizer(wxHORIZONTAL);
665 itemBoxSizer2->Add(itemBoxSizer12, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
668 itemBoxSizer12->Add(
m_CommitButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
674 wxButton* itemButton13 =
new wxButton( Dialog1,
ID_CLOSE_EDSEQ_BUTTON,
_(
"Close"), wxDefaultPosition, wxDefaultSize, 0 );
675 itemBoxSizer12->Add(itemButton13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
677 wxButton* itemButton14 =
new wxButton( Dialog1,
ID_CANCEL_EDSEQ_BUTTON,
_(
"Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
678 itemBoxSizer12->Add(itemButton14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
680 wxHyperlinkCtrl* itemHyperlinkCtrl =
new wxHyperlinkCtrl( Dialog1, wxID_HELP,
_(
"Help"),
wxT(
"https://www.ncbi.nlm.nih.gov/tools/gbench/manual9/#edit-sequence"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
681 itemHyperlinkCtrl->SetForegroundColour(wxColour(192, 192, 192));
682 itemBoxSizer12->Add(itemHyperlinkCtrl, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
692 const CSeq_id &
id = *(it->GetSeqId());
693 if (
id.IsGenbank() &&
id.GetGenbank().IsSetAccession())
694 accession =
id.GetGenbank().GetAccession();
695 if (
id.IsLocal() &&
id.GetLocal().IsStr())
696 local =
id.GetLocal().GetStr();
698 if (!accession.empty())
794 bool modified =
false;
797 bool removed =
false;
805 string seq_out = seq.substr(start,seq_len[
i]);
806 if (seq_in != seq_out)
808 if (!seq_out.empty())
817 seqmap_i = seqmap_i.
Remove();
830 vector<int>::iterator seq_len_i = seq_len.begin();
831 vector<bool>::iterator read_only_i = read_only.begin();
832 while (seq_len_i != seq_len.end() && read_only_i != read_only.end())
836 seq_len_i = seq_len.erase(seq_len_i);
837 read_only_i = read_only.erase(read_only_i);
859 int answer = wxMessageBox (
ToWxString(
"Uncommitted changes, proceed with closing?"),
ToWxString(
"Warning"), wxYES_NO | wxICON_QUESTION);
891 if (pos1 > 0 && pos2 > 0)
913 else if (!
val.IsEmpty())
926 if(val1.ToLong(&pos1) && val2.ToLong(&pos2) && pos1 > 0 && pos2 > 0 && pos2 > pos1 && pos1 <= seq_len && pos2 <= seq_len)
941 if (event.IsChecked())
959 if (event.IsChecked())
977 if (event.IsChecked())
995 if (event.IsChecked())
1022 if (event.IsChecked())
1040 if (event.IsChecked())
1058 if (event.IsChecked())
1076 if (event.IsChecked())
1103 if (event.IsChecked())
1150 if (event.IsChecked())
1178 if (event.IsChecked())
1193 if (event.IsChecked())
1220 const CSeq_id* seq_id = loc.GetId();
1226 vector<pair<TSeqPos,TSeqPos> > vec;
1227 const CSeq_loc& feat_loc = feat_it->
GetLocation();
1236 vec.push_back(pair<TSeqPos, TSeqPos>(feat_start, feat_stop));
1258 if (strand == objects::CBioseq_Handle::eStrand_Minus && !prot_seq.empty())
1260 reverse(prot_seq.begin(), prot_seq.end());
1303 for (
CFeat_CI feat_ci(prot_bsh); feat_ci; ++feat_ci)
1311 vector<pair<TSeqPos,TSeqPos> > vec;
1320 vec.push_back(pair<TSeqPos, TSeqPos>(feat_start, feat_stop));
1333 CFeat_CI feat_it(scope, *loc, sel);
1342 const CSeq_loc& feat_loc = feat_it->
GetLocation();
1344 new_loc->
Assign(feat_loc);
1371 if (feat_start != new_start)
1375 if (feat_stop != new_stop)
1377 loc_it.
SetTo(new_stop);
1427 for (
CFeat_CI feat_ci(prot_bsh); feat_ci; ++feat_ci)
1460 if (feat_start != new_start)
1464 if (feat_stop != new_stop)
1466 loc_it.
SetTo(new_stop);
1491 new_feat->
Assign(feat_ci->GetOriginalFeature());
1517 if (event.IsChecked())
1531 if (event.IsChecked())
1595 if (sel.first >=0 && sel.second >= 0 && sel.second >= sel.first)
1598 interval->
SetInt().SetFrom(sel.first);
1599 interval->
SetInt().SetTo(sel.second);
1603 interval->
SetInt().SetId(*
id);
1610 wxWindow* editorWindow = editor->CreateWindow(&edit_dlg);
1613 if (edit_dlg.ShowModal() == wxID_OK)
1634 if (sel.first >=0 && sel.second >= 0 && sel.second >= sel.first)
1637 interval->
SetInt().SetFrom(sel.first);
1638 interval->
SetInt().SetTo(sel.second);
1642 interval->
SetInt().SetId(*
id);
1647 string regulatory_class;
1657 if (!regulatory_class.empty())
1660 q->
SetQual(
"regulatory_class");
1661 q->
SetVal(regulatory_class);
1668 wxWindow* editorWindow = editor->CreateWindow(&edit_dlg);
1671 if (edit_dlg.ShowModal() == wxID_OK)
1692 bool create_general_only =
false;
1695 if (!vec_tse.empty())
1697 for (
CFeat_CI feat_it(scope, *loc, sel); feat_it; ++feat_it)
1751 : m_Panel(panel), m_is_nucleotide(is_nucleotide)
1754 Create(parent,
id, caption, pos,
size, style);
1765 SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
1766 wxDialog::Create( parent,
id, caption, pos,
size, style );
1771 GetSizer()->SetSizeHints(
this);
1822 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
1823 itemDialog1->SetSizer(itemBoxSizer2);
1825 wxStaticText* itemStaticText3 =
new wxStaticText( itemDialog1, wxID_STATIC,
_(
"Find pattern"), wxDefaultPosition, wxDefaultSize, 0 );
1826 itemBoxSizer2->Add(itemStaticText3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
1828 wxBoxSizer* itemBoxSizer4 =
new wxBoxSizer(wxHORIZONTAL);
1829 itemBoxSizer2->Add(itemBoxSizer4, 0, wxGROW|wxALL, 5);
1832 itemBoxSizer4->Add(
m_Pattern, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1834 m_ItemOfText =
new wxStaticText( itemDialog1, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
1835 itemBoxSizer2->Add(
m_ItemOfText, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
1837 wxStaticBox* itemStaticBoxSizer7Static =
new wxStaticBox(itemDialog1,
wxID_ANY,
_(
"Search in"));
1838 wxStaticBoxSizer* itemStaticBoxSizer7 =
new wxStaticBoxSizer(itemStaticBoxSizer7Static, wxVERTICAL);
1839 itemBoxSizer2->Add(itemStaticBoxSizer7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
1841 wxBoxSizer* itemBoxSizer8 =
new wxBoxSizer(wxHORIZONTAL);
1842 itemStaticBoxSizer7->Add(itemBoxSizer8, 0, wxALIGN_LEFT|wxALL, 5);
1844 m_Nuc =
new wxRadioButton( itemStaticBoxSizer7->GetStaticBox(),
ID_NUC_FIND_EDIT_SEQ,
_(
"Nucleotide sequence"), wxDefaultPosition, wxDefaultSize, 0 );
1845 m_Nuc->SetValue(
true);
1846 itemBoxSizer8->Add(
m_Nuc, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1850 itemBoxSizer8->Add(
m_RevComp, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1852 wxBoxSizer* itemBoxSizer11 =
new wxBoxSizer(wxHORIZONTAL);
1853 itemStaticBoxSizer7->Add(itemBoxSizer11, 0, wxALIGN_LEFT|wxALL, 5);
1857 itemBoxSizer11->Add(
m_TransFrame, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1859 wxArrayString m_FrameChoiceStrings;
1860 m_FrameChoiceStrings.Add(
_(
"Any"));
1861 m_FrameChoiceStrings.Add(
_(
"+1"));
1862 m_FrameChoiceStrings.Add(
_(
"+2"));
1863 m_FrameChoiceStrings.Add(
_(
"+3"));
1864 m_FrameChoiceStrings.Add(
_(
"-1"));
1865 m_FrameChoiceStrings.Add(
_(
"-2"));
1866 m_FrameChoiceStrings.Add(
_(
"-3"));
1870 itemBoxSizer11->Add(
m_FrameChoice, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1872 wxBoxSizer* itemBoxSizer14 =
new wxBoxSizer(wxHORIZONTAL);
1873 itemBoxSizer2->Add(itemBoxSizer14, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
1876 itemBoxSizer14->Add(
m_Prev, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1880 itemBoxSizer14->Add(
m_Next, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1883 wxButton* itemButton17 =
new wxButton( itemDialog1,
ID_DISMISS_FIND_EDIT_SEQ,
_(
"Dismiss"), wxDefaultPosition, wxDefaultSize, 0 );
1884 itemBoxSizer14->Add(itemButton17, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
1889 itemStaticBoxSizer7Static->Hide();
1912 return wxNullBitmap;
1951 if (sel != wxNOT_FOUND)
1955 if (!
m_Nuc->GetValue() && choice ==
"Any")
2014 for (
size_t i=0;
i<
str.length();
i++)
2031 if (
m_Nuc->GetValue())
2064 while (pos !=
NPOS && pos <str->
size())
2069 auto pos_actual = pos;
2070 if (!
m_Nuc->GetValue())
2072 if (choice ==
"-1" || choice ==
"-2" || choice ==
"-3")
2073 pos_actual =
str->size() - pos_actual - 1 - (
value.size() - 1);
2102 if (!
m_Nuc->GetValue())
2109 for (
size_t j = 0; j < length; j++)
2110 highlights.
insert(
static_cast<int>((*it)+j));
User-defined methods of the data storage class.
@ eExtreme_Positional
numerical value
User-defined methods of the data storage class.
EVT_CHECKBOX(ID_CADJUSTFEATURES_CHECKBOX, CAdjustFeaturesForGaps::OnKnownUnknownSelected) EVT_CHECKBOX(ID_CADJUSTFEATURES_CHECKBOX1
@ eCmdCreateRegulatory_ribosome_binding_site
@ eCmdCreateMobileElement
@ eCmdCreateMiscStructure
@ eCmdCreateBiosourceFeat
@ eCmdCreatePrimTranscript
@ eCmdCreateRegulatory_promoter
@ eCmdCreateRegulatory_riboswitch
@ eCmdCreateCodingRegion_ext
@ eCmdCreateCommentDescriptor
@ eCmdCreatePubFeatureLabeled
@ eCmdCreateRegulatory_enhancer
@ eCmdCreateTransitPeptide
@ eCmdCreateSecondaryStructure
@ eCmdCreateRegulatory_terminator
@ eCmdCreateMiscDifference
bool IsGeneralIdProtPresent(objects::CSeq_entry_Handle tse)
static CRef< objects::CSeq_feat > MakeDefaultFeature(objects::CSeqFeatData::ESubtype subtype)
static objects::CSeqFeatData::ESubtype GetFeatTypeFromCmdID(int cmd_id)
void GetLabel(string *label, ELabelType type, bool worst=false) const
void AddCommand(IEditCommand &command)
void SetEditorWindow(wxWindow *editorWindow)
void SetEditor(CIRef< IEditObject > editor)
wxMenuItem * m_translate_item2
void IsSelectionAndClean(wxUpdateUIEvent &event)
void OnTranslate(wxCommandEvent &event)
void OnRevTranslate2(wxCommandEvent &event)
wxMenuItem * m_translate_item_none
void OnTranslateAll(wxCommandEvent &event)
static bool ShowToolTips()
Should we show tooltips?
void OnTranslate1(wxCommandEvent &event)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void OnMismatch(wxCommandEvent &event)
void ReportRange(int pos1, int pos2)
wxStaticText * m_readonly_warning
wxMenuItem * m_translate_item_everything
wxMenuItem * m_translate_item1
void IsNucleotide(wxUpdateUIEvent &event)
void CreateControls()
Creates the controls and sizers.
wxTextCtrl * m_GoTo_TextCtrl
void OnRevTranslateAll(wxCommandEvent &event)
void OnPaste(wxCommandEvent &event)
void OnTranslate2(wxCommandEvent &event)
void OnTranslateEverything(wxCommandEvent &event)
void IsClipboard(wxUpdateUIEvent &event)
wxMenuItem * m_translate_item_all
vector< vector< pair< TSeqPos, TSeqPos > > > m_FeatRanges
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
vector< pair< string, CSeqFeatData::ESubtype > > m_FeatTypes
void OnReadOnlyTimer(wxTimerEvent &event)
virtual ~CEditSequence()
Destructor.
wxMenuItem * m_revtranslate_item2
virtual void SaveSettings() const
CEditSequence()
Constructors.
void OnTranslateNone(wxCommandEvent &event)
virtual void SetRegistryPath(const string ®_path)
void OnFeatures(wxCommandEvent &event)
vector< CBioseq_Handle::EVectorStrand > m_FeatStrand
void AdjustProtFeatureLocations(CRef< CCmdComposite > composite, const CSeq_feat &old_cds, const CSeq_feat &cds, int i, const CSeq_id *seq_id, TSeqPos seq_start)
void CreateRegulatory(wxCommandEvent &event)
void Init()
Initialises member variables.
wxMenuItem * m_translate_item
vector< bool > m_Feat5Partial
void GetProteinFeatures(CBioseq_Handle prot_bsh, int i, const CSeq_id *seq_id, const CSeq_feat &old_cds, TSeqPos seq_start)
void GetFeatures(const CSeq_loc &loc, CScope &scope)
wxMenuItem * m_revtranslate_item
void OnGoTo(wxCommandEvent &event)
CSeq_entry_Handle m_edited_seh
void CreateFeature(wxCommandEvent &event)
vector< int > m_FeatFrames
wxButton * m_CommitButton
void OnRevTranslate1(wxCommandEvent &event)
wxButton * m_RetranslateButton
void OnRevTranslate(wxCommandEvent &event)
void OnRetranslate(wxCommandEvent &event)
virtual void LoadSettings()
vector< CRef< CGenetic_code > > m_GeneticCode
bool x_ExecuteCommand(IEditCommand *command)
IUndoManager * m_UndoManager
void OnCopy(wxCommandEvent &event)
void OnComplement(wxCommandEvent &event)
vector< string > m_RealProt
void ShowReadOnlyWarning()
unordered_map< int, vector< vector< pair< TSeqPos, TSeqPos > > > > m_ProtFeatRanges
void OnFind(wxCommandEvent &event)
void AdjustFeatureLocations(CRef< CCmdComposite > composite)
void OnCut(wxCommandEvent &event)
void EnableCommit(bool enable)
wxMenuItem * m_revtranslate_item_all
wxStaticText * m_commit_warning
void OnRange(wxCommandEvent &event)
void OnOnTheFly(wxCommandEvent &event)
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("Edit Sequence"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(704, 504), long style=wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
void IsSelection(wxUpdateUIEvent &event)
void OnClose(wxCommandEvent &event)
void OnAccept(wxCommandEvent &event)
void OnCancel(wxCommandEvent &event)
wxMenuItem * m_revtranslate_item1
void OnChange(wxCommandEvent &event)
void CreateControls()
Creates the controls and sizers.
static bool ShowToolTips()
Should we show tooltips?
set< int >::iterator m_CurrentPos
void OnPrev(wxCommandEvent &event)
void FindMatchPositions(const string &choice)
void OnDismiss(wxCommandEvent &event)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
CFindEditSequence()
Constructors.
wxRadioButton * m_TransFrame
void OnClose(wxCloseEvent &event)
~CFindEditSequence()
Destructor.
void Init()
Initialises member variables.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void OnNext(wxCommandEvent &event)
bool Create(wxWindow *parent, wxWindowID id=29000, const wxString &caption=_("find"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
wxStaticText * m_ItemOfText
@Gb_qual.hpp User-defined methods of the data storage class.
CRegistryWriteView GetWriteView(const string §ion)
get a read-write view at a particular level.
static CGuiRegistry & GetInstance()
access the application-wide singleton
CRegistryReadView GetReadView(const string §ion) const
get a read-only view at a particular level.
set< int > & SetHighlights()
void EnableRevTranslation1(bool enable)
void EnableOnTheFly(bool enable)
void OnCut(wxCommandEvent &event)
vector< int > & GetSeqLen()
string * GetFindString(bool is_nuc, bool is_revcomp, const string &choice)
pair< int, int > GetSelection()
TSeqPos GetProtFeatureStart(int i, int k, int j)
void EnableMismatch(bool enable)
vector< bool > & GetReadOnly()
void EnableComplement(bool enable)
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 EnableTranslation1(bool enable)
void SetRange(int pos1, int pos2)
void OnCopy(wxCommandEvent &event)
void EnableRevTranslation(bool enable)
void EnableTranslation2(bool enable)
void EnableTranslation(bool enable)
void Search(const string &val)
void EnableRevTranslation2(bool enable)
void SetClean(bool clean)
TSeqPos GetFeatureStop(int i, int j)
TSeqPos GetProtFeatureStop(int i, int k, int j)
void EnableFeatures(bool enable)
TSeqPos GetFeatureStart(int i, int j)
void GetLabel(string *label) const
class CRegistryReadView provides a nested hierarchical view at a particular key.
int GetInt(const string &key, int default_val=0) const
access a named key at this level, with no recursion
void Set(const string &key, int val)
access a named key at this level, with no recursion
static EFeatureLocationAllowed AllowedFeatureLocation(ESubtype subtype)
@ eFeatureLocationAllowed_NucOnly
@ eFeatureLocationAllowed_ProtOnly
ESubtype GetSubtype(void) const
Non-const iterator over CSeqMap (allows to edit the sequence).
namespace ncbi::objects::
Seq-loc iterator class – iterates all intervals from a seq-loc in the correct order.
static CUICommandRegistry & GetInstance()
the main instance associated with the application
wxMenu * CreateMenu(const SwxMenuItemRec *items)
create a menu from a static definition (see WX_*_MENU macros)
Undo/Redo interface for editing operations.
virtual void Execute(IEditCommand *command, wxWindow *window=0)=0
Interface (functor) for object editing.
virtual bool RequestExclusiveEdit(wxWindow *window, const string &descr)=0
virtual bool ReleaseExclusiveEdit(wxWindow *window)=0
virtual void Undo(wxWindow *window=0)=0
iterator_bool insert(const value_type &val)
const_iterator begin() const
const_iterator end() const
static const char * kFramePosX
static const char * kFrameHeight
const char * kExclusiveEditDescr
static const char * kFramePosY
static const char * kFrameWidth
#define ID_ACCEPT_EDSEQ_BUTTON
#define ID_TRANSFRAME_FIND_EDIT_SEQ
#define READONLY_TIMER_ID
#define ID_SHOW_ONTHEFLY_EDSEQ_MENU
#define ID_EDIT_CUT_EDSEQ_MENU
#define ID_EDIT_PASTE_EDSEQ_MENU
#define ID_SHOW_TRANSLATE_NONE_EDSEQ_MENU
#define ID_DISMISS_FIND_EDIT_SEQ
#define ID_SHOW_TRANSLATE_EVERYTHING_EDSEQ_MENU
#define ID_TEXTCTRL_FIND_EDIT_SEQ
#define ID_CLOSE_EDSEQ_BUTTON
#define ID_SHOW_TRANSLATE2_EDSEQ_MENU
#define ID_SHOW_REVTRANSLATE_EDSEQ_MENU
#define ID_SHOW_REVTRANSLATE2_EDSEQ_MENU
#define ID_SHOW_REVCOMP_EDSEQ_MENU
#define ID_SHOW_REVTRANSLATE1_EDSEQ_MENU
#define ID_GOTO_EDSEQ_BUTTON
#define ID_NUC_FIND_EDIT_SEQ
#define ID_SHOW_FEATURES_EDSEQ_MENU
#define ID_SHOW_MISMATCH_EDSEQ_MENU
#define ID_RANGE_EDSEQ_BUTTON
#define ID_RETRANSLATE_EDSEQ_BUTTON
#define ID_PREV_FIND_EDIT_SEQ
#define ID_SHOW_REVTRANSLATE_ALL_EDSEQ_MENU
#define ID_EDIT_COPY_EDSEQ_MENU
#define ID_NEXT_FIND_EDIT_SEQ
#define ID_REVCOMP_FIND_EDIT_SEQ
#define ID_EDIT_FIND_EDSEQ_MENU
#define ID_SHOW_TRANSLATE1_EDSEQ_MENU
#define ID_CANCEL_EDSEQ_BUTTON
#define ID_SHOW_TRANSLATE_EDSEQ_MENU
#define ID_FRAMECHOICE_FIND_EDIT_SEQ
#define ID_SHOW_TRANSLATE_ALL_EDSEQ_MENU
unsigned int TSeqPos
Type for sequence locations and lengths.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
string GetLabel(const CSeq_id &id)
CRef< CSeq_loc > MakeSeq_loc(EMakeType make_type=eMake_CompactType) const
return constructed CSeq_loc with all changes
void SetFrom(TSeqPos from)
Set the range from position.
void SetTo(TSeqPos to)
Set the range to position.
void Delete(void)
Delete current element, and make iterator to point to the next element.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Override Assign() to incorporate cache invalidation.
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
bool HasChanges(void) const
return true of any part was changed since initialization
bool IsEmpty(void) const
True if the current location is empty.
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
size_t GetSize(void) const
Get number of ranges.
TRange GetRange(void) const
Get the range.
const CSeq_id & GetSeq_id(void) const
Get seq_id of the current location.
@ fFGL_Content
Include its content if there is any.
bool IsSameBioseq(const CSeq_id &id1, const CSeq_id &id2, CScope *scope, CScope::EGetBioseqFlag get_flag=CScope::eGetBioseq_All)
Determines if two CSeq_ids represent the same CBioseq.
static CCdregion::EFrame FindBestFrame(const CSeq_feat &cds, CScope &scope)
Find "best" frame for a coding region.
CRef< CSeq_loc > Map(const CSeq_loc &src_loc)
Map seq-loc.
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
CSeq_entry_Handle AddTopLevelSeqEntry(CSeq_entry &top_entry, TPriority pri=kPriority_Default, EExist action=eExist_Default)
Add seq_entry, default priority is higher than for defaults or loaders Add object to the score with p...
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
void GetAllTSEs(TTSE_Handles &tses, enum ETSEKind kind=eManualTSEs)
CSeq_loc_Mapper_Base & SetMergeAbutting(void)
Merge only abutting intervals, keep overlapping.
vector< CSeq_entry_Handle > TTSE_Handles
@ eProductToLocation
Map from the feature's product to location.
@ eLocationToProduct
Map from the feature's location to product.
bool IsNucleotide(void) const
TBioseqCore GetBioseqCore(void) const
Get bioseq core structure.
const CSeqFeatData & GetData(void) const
TSeqPos GetBioseqLength(void) const
CSeq_entry_Handle GetSeq_entry_Handle(void) const
Get parent Seq-entry handle.
bool IsSetProduct(void) const
virtual const CSeq_loc & GetLocation(void) const
bool IsProtein(void) const
CConstRef< CSeq_entry > GetCompleteSeq_entry(void) const
Complete and get const reference to the seq-entry.
CScope & GetScope(void) const
Get scope this handle belongs to.
CScope & GetScope(void) const
Get scope this handle belongs to.
CScope & GetScope(void) const
Get scope this handle belongs to.
CSeqFeatData::ESubtype GetFeatSubtype(void) const
CRef< CSeq_loc > GetRangeSeq_loc(TSeqPos start, TSeqPos stop, ENa_strand strand=eNa_strand_unknown) const
Return CSeq_loc referencing the given range and strand on the bioseq If start == 0,...
bool IsPlainFeat(void) const
Check if this is plain feature.
const TId & GetId(void) const
CSeqVector GetSeqVector(EVectorCoding coding, ENa_strand strand=eNa_strand_plus) const
Get sequence: Iupacna or Iupacaa if use_iupac_coding is true.
@ eStrand_Plus
Plus strand.
@ eStrand_Minus
Minus strand.
@ eCoding_Iupac
Set coding to printable coding (Iupacna or Iupacaa)
CSeqMap_I & Remove(void)
Remove current segment.
void GetSequence(string &buffer, CSeqUtil::ECoding buffer_coding) const
Get current sequence as a string with the selected encoding.
const CSeq_loc & GetLocation(void) const
SSeqMapSelector & SetFlags(TFlags flags)
Select segment type(s)
void SetSequence(const string &buffer, CSeqUtil::ECoding buffer_coding, CSeq_data::E_Choice seq_data_coding)
Set sequence data.
const CSeq_feat & GetOriginalFeature(void) const
Get original feature with unmapped location/product.
const CSeq_feat_Handle & GetSeq_feat_Handle(void) const
Get original feature handle.
const CSeq_loc & GetProduct(void) const
CSeqMap::ESegmentType GetType(void) const
TSeqPos GetLength(void) const
return length of current segment
void GetSeqData(TSeqPos start, TSeqPos stop, string &buffer) const
Fill the buffer string with the sequence data for the interval [start, stop).
@ eSeqData
real sequence data
#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 IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static const char label[]
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
void SetQual(const TQual &value)
Assign a value to Qual data member.
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
bool IsSetCode(void) const
genetic code used Check if a value has been assigned to Code data member.
void SetLocation(TLocation &value)
Assign a value to Location data member.
bool IsCdregion(void) const
Check if variant Cdregion is selected.
TFrame GetFrame(void) const
Get the Frame member data.
const TData & GetData(void) const
Get the Data member data.
const TCode & GetCode(void) const
Get the Code member data.
void SetData(TData &value)
Assign a value to Data data member.
const TCdregion & GetCdregion(void) const
Get the variant data.
const TProduct & GetProduct(void) const
Get the Product member data.
void SetVal(const TVal &value)
Assign a value to Val data member.
const TProt & GetProt(void) const
Get the variant data.
TQual & SetQual(void)
Assign a value to Qual data member.
bool IsSetFrame(void) const
Check if a value has been assigned to Frame data member.
@ eFrame_three
reading frame
bool IsNull(void) const
Check if variant Null is selected.
const TSeq & GetSeq(void) const
Get the variant data.
const TInst & GetInst(void) const
Get the Inst member data.
@ e_Iupacna
IUPAC 1 letter nuc acid code.
@ e_Iupacaa
IUPAC 1 letter amino acid code.
CMinPanelContainer::OnRestoreWindow EVT_UPDATE_UI_RANGE(eCmdCloseDockPanel, eCmdWindowRestore, CMinPanelContainer::OnUpdateWindowCommand) CMinPanelContainer
void ReportUsage(const wxString &dialog_name)
Report opening & accepting events in the editing package.
constexpr bool empty(list< Ts... >) noexcept
const struct ncbi::grid::netcache::search::fields::SIZE size
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
ViewerWindowBase::OnEditMenu ViewerWindowBase::OnJustification EVT_MENU(MID_SHOW_GEOM_VLTNS, ViewerWindowBase::OnShowGeomVltns) EVT_MENU(MID_FIND_PATTERN
static const char * str(char *buf, int n)
Selector used in CSeqMap methods returning iterators.
#define WX_MENU_ITEM_EXT(cmd)
#define WX_DEFINE_MENU(name)
New macros for defining menus for use with CUICommandRegistry.
#define WX_SUBMENU_EXT(label)
#define WX_SUBMENU_INT(label)
#define WX_MENU_ITEM_INT(cmd)
static void SetTitle(CRef< CSeq_entry > entry, string title)
CRef< CCmdComposite > GetRetranslateCDSCommand(objects::CScope &scope, const objects::CSeq_feat &cds, bool create_general_only)
wxString ToWxString(const string &s)
wxRect GetScreenRect(const wxWindow &win)