99 wxPanel::Create( parent,
id, pos,
size, style );
104 GetSizer()->SetSizeHints(
this);
191 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
192 itemPanel1->SetSizer(itemBoxSizer2);
194 wxFlexGridSizer* itemFlexGridSizer3 =
new wxFlexGridSizer(0, 4, 0, 0);
195 itemBoxSizer2->Add(itemFlexGridSizer3, 0, wxALIGN_LEFT|wxALL, 5);
197 wxStaticText* itemStaticText4 =
new wxStaticText( itemPanel1, wxID_STATIC,
_(
"Sequencing Technology"), wxDefaultPosition, wxSize(60, -1), 0 );
198 itemStaticText4->Wrap(20);
199 itemFlexGridSizer3->Add(itemStaticText4, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
201 m_StarTech =
new wxStaticText( itemPanel1, wxID_STATIC,
_(
"*"), wxDefaultPosition, wxDefaultSize, 0 );
202 m_StarTech->SetForegroundColour(wxColour(255, 0, 0));
203 m_StarTech->SetFont(wxFont(12, wxSWISS, wxNORMAL, wxNORMAL,
false,
wxT(
"Tahoma")));
204 itemFlexGridSizer3->Add(
m_StarTech, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
210 itemFlexGridSizer3->Add(
m_SeqTechEdit, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
212 wxStaticText* itemStaticText8 =
new wxStaticText( itemPanel1, wxID_STATIC,
_(
"Source Type"), wxDefaultPosition, wxDefaultSize, 0 );
213 itemFlexGridSizer3->Add(itemStaticText8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
215 m_StarSourceType =
new wxStaticText( itemPanel1, wxID_STATIC,
_(
"*"), wxDefaultPosition, wxDefaultSize, 0 );
218 itemFlexGridSizer3->Add(
m_StarSourceType, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
220 wxArrayString m_SourceTypeStrings;
223 m_SourceType->SetToolTip(
_(
"If you provide correct information about the type of organism the sample was isolated, this tool will suggest the required and recommended information needed to help the submission be processed more quickly by GenBank staff.\n"));
224 itemFlexGridSizer3->Add(
m_SourceType, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
226 itemFlexGridSizer3->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
228 wxStaticText* itemStaticText12 =
new wxStaticText( itemPanel1, wxID_STATIC,
_(
"Source"), wxDefaultPosition, wxDefaultSize, 0 );
229 itemFlexGridSizer3->Add(itemStaticText12, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
231 m_StarSource =
new wxStaticText( itemPanel1, wxID_STATIC,
_(
"*"), wxDefaultPosition, wxDefaultSize, 0 );
233 m_StarSource->SetFont(wxFont(12, wxSWISS, wxNORMAL, wxNORMAL,
false,
wxT(
"Tahoma")));
234 itemFlexGridSizer3->Add(
m_StarSource, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
236 m_SourceLabel =
new wxTextCtrl( itemPanel1,
ID_TEXTCTRL2, wxEmptyString, wxDefaultPosition, wxSize(-1, 50), wxTE_MULTILINE|wxTE_READONLY );
237 itemFlexGridSizer3->Add(
m_SourceLabel, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
240 itemFlexGridSizer3->Add(
m_EditSourceLink, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
242 wxStaticText* itemStaticText16 =
new wxStaticText( itemPanel1, wxID_STATIC,
_(
"Features"), wxDefaultPosition, wxDefaultSize, 0 );
243 itemFlexGridSizer3->Add(itemStaticText16, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
245 m_StarFeatures =
new wxStaticText( itemPanel1, wxID_STATIC,
_(
"*"), wxDefaultPosition, wxDefaultSize, 0 );
247 m_StarFeatures->SetFont(wxFont(12, wxSWISS, wxNORMAL, wxNORMAL,
false,
wxT(
"Tahoma")));
248 itemFlexGridSizer3->Add(
m_StarFeatures, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
250 m_FeaturesLabel =
new wxTextCtrl( itemPanel1,
ID_TEXTCTRL1, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
251 itemFlexGridSizer3->Add(
m_FeaturesLabel, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
253 wxBoxSizer* itemBoxSizer19 =
new wxBoxSizer(wxVERTICAL);
254 itemFlexGridSizer3->Add(itemBoxSizer19, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
257 itemBoxSizer19->Add(
m_FeatureAddBtn, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
262 m_RemoveFeaturesBtn =
new wxHyperlinkCtrl( itemPanel1,
ID_REMOVE_FEAT,
_(
"Remove All Features"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
323 wxWindow* w = this->GetParent();
339 star->SetLabel(
wxT(
"*"));
341 star->SetLabel(
wxT(
" "));
355 bool ok_to_bulk_edit =
true;
358 bool missing_required =
false;
365 string all_summary =
"";
366 bool any_data =
false;
367 bool missing_required_col =
false;
368 for (
size_t i = 1;
i <
table->GetColumns().
size();
i++) {
369 string title =
table->GetColumns()[
i]->GetHeader().GetTitle();
371 string first_val =
table->GetColumns()[
i]->GetData().GetString()[0];
377 all_summary += title +
":" + first_val;
381 ok_to_bulk_edit =
false;
383 mixed =
"Record contains mixed values for ";
391 missing +=
"Missing required Sequencing Technology information. ";
392 missing_required_col =
true;
399 if ((required || any_data) && missing_required_col) {
400 missing_required =
true;
403 message = missing + mixed;
404 }
else if (required) {
405 message =
"Missing required sequencing technology information";
406 missing_required =
true;
409 message = all_summary;
413 message =
"Missing required sequencing technology information";
414 missing_required =
true;
421 if (missing_required) {
424 if (ok_to_bulk_edit) {
472 wxHyperlinkCtrl* link_ctrl =
dynamic_cast<wxHyperlinkCtrl*
>(
event.GetEventObject());
486 switch (wizard_type) {
492 m_SourceType->Append (
wxT(
"Not listed above or mixed set of different viruses"));
536 bool is_unchosen =
false;
554 if (choices.size() > 0 && choices.Last() == wxEmptyString) {
559 if (kit->first == src_type) {
560 wxArrayString::iterator it = choices.begin();
566 if (it != choices.end()) {
577 if (is_unchosen && choices.size() > 1) {
579 m_SourceType->SetSelection(
static_cast<int>(choices.size()));
605 switch (wizard_type) {
687 src_type = kit->first;
733 for (
int pos =
static_cast<int>(
m_FieldsInUse.size()) - 1; pos > -1; pos--) {
747 for (
int pos = 0; pos < num_keep; pos++) {
750 vector<CSubPrepFieldEditor * >::iterator it =
m_ExtraFields.begin();
764 string label,
string column_name,
766 bool must_choose,
bool required,
767 string default_val,
string url,
774 if (
NStr::Equal((*it)->GetColumnName(), column_name)) {
781 if (new_field ==
NULL) {
783 m_WizardExtras->Add(new_field, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 0);
790 new_field->
SetConverter(
label, column_name, converter, must_choose, required, default_val, url, allow_mix);
873 wxStaticText* star =
new wxStaticText(
this, wxID_STATIC,
_(
"*"), wxDefaultPosition, wxDefaultSize, 0 );
874 star->SetForegroundColour(wxColour(255, 0, 0));
875 sizer->Add(star, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
876 star->SetFont(wxFont(12, wxSWISS, wxNORMAL, wxNORMAL,
false,
wxT(
"Tahoma")));
895 if (!seh || !seh.IsSet()) {
899 int set_class = objects::CBioseq_set::eClass_not_set;
900 if (seh.GetSet().IsSetClass()) {
901 set_class = seh.GetSet().GetClass();
904 wxArrayString set_strings;
905 wxString tooltip_text = wxEmptyString;
907 wxString sel = wxEmptyString;
909 case objects::CBioseq_set::eClass_pop_set:
910 sel =
"Population Study";
912 case objects::CBioseq_set::eClass_phy_set:
913 sel =
"Phylogenetic Study";
915 case objects::CBioseq_set::eClass_mut_set:
916 sel =
"Mutation Study";
918 case objects::CBioseq_set::eClass_eco_set:
919 sel =
"Environmental set";
921 case objects::CBioseq_set::eClass_genbank:
929 switch (wizard_type) {
931 tooltip_text.append(
wxT(
"Batch: Do not process as a set.\n"));
932 tooltip_text.append(
wxT(
"Population Study: a set of sequences that were derived by sequencing the same gene from different isolates of the same organism.\n"));
933 tooltip_text.append(
wxT(
"Phylogenetic Study: a set of sequences that were derived by sequencing the same gene from different organisms.\n"));
934 tooltip_text.append(
wxT(
"Mutation Study: a set of sequences that were derived by sequencing multiple mutations of a single gene.\n"));
935 tooltip_text.append(
wxT(
"Environmental set: a set of sequences that were derived by sequencing the same gene from a population of unclassified or unknown organisms."));
937 set_strings.push_back(
wxT(
"Batch"));
938 set_strings.push_back(
wxT(
"Population Study"));
939 set_strings.push_back(
wxT(
"Phylogenetic Study"));
940 set_strings.push_back(
wxT(
"Mutation Study"));
941 set_strings.push_back(
wxT(
"Environmental set"));
944 tooltip_text.append(
wxT(
"Batch: Do not process as a set.\n"));
945 tooltip_text.append(
wxT(
"Environmental set: a set of sequences that were derived by sequencing the same gene from a population of unclassified or unknown organisms."));
946 set_strings.push_back(
wxT(
"Batch"));
947 set_strings.push_back(
wxT(
"Environmental set"));
953 tooltip_text.append(
wxT(
"Batch: Do not process as a set.\n"));
954 tooltip_text.append(
wxT(
"Population Study: a set of sequences that were derived by sequencing the same gene from different isolates of the same organism.\n"));
955 tooltip_text.append(
wxT(
"Phylogenetic Study: a set of sequences that were derived by sequencing the same gene from different organisms.\n"));
956 tooltip_text.append(
wxT(
"Mutation Study: a set of sequences that were derived by sequencing multiple mutations of a single gene.\n"));
957 tooltip_text.append(
wxT(
"Environmental set: a set of sequences that were derived by sequencing the same gene from a population of unclassified or unknown organisms."));
959 set_strings.push_back(
wxT(
"Batch"));
960 set_strings.push_back(
wxT(
"Population Study"));
961 set_strings.push_back(
wxT(
"Phylogenetic Study"));
962 set_strings.push_back(
wxT(
"Mutation Study"));
963 set_strings.push_back(
wxT(
"Environmental set"));
966 if (set_class == objects::CBioseq_set::eClass_genbank) {
969 set_strings.push_back(
wxT(
"Batch"));
973 if (set_strings.empty()) {
977 wxStaticText* itemStaticText =
new wxStaticText(
this, wxID_STATIC,
wxT(
"Set Type"),
978 wxDefaultPosition, wxSize(60, -1), wxALIGN_CENTRE );
979 m_ExtraGrid->Add(itemStaticText, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
983 wxChoice *choice =
new wxChoice(
this,
ID_SET_CHOICE, wxDefaultPosition, wxSize(400, -1), set_strings, 0 );
984 m_ExtraGrid->Add(choice, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
985 wxString please_choose =
wxT(
"Please choose a set type");
986 if (sel.empty() || !choice->SetStringSelection(sel)) {
987 choice->AppendString(please_choose);
988 choice->SetStringSelection(please_choose);
996 choice->SetToolTip(tooltip_text);
999 m_ExtraGrid->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
@ eWizardSrcType_cultured_fungus
@ eWizardSrcType_virus_norovirus
@ eWizardSrcType_virus_foot_and_mouth
@ eWizardSrcType_bacteria_or_archaea
@ eWizardSrcType_uncultured_fungus
@ eWizardSrcType_virus_influenza
@ eWizardSrcType_vouchered_fungus
@ eWizardSrcType_virus_rotavirus
@ eWizardType_uncultured_samples
@ eWizardType_microsatellite
@ eWizardType_rrna_its_igs
void SetConverter(string label, string column_name, CTableFieldCommandConverter *converter, bool must_choose=false, bool required=false, string default_val="", string url="", bool allow_mix=true)
void ImportFeatureTableFile()
void SetSubmissionNotReady(string error)
bool OkToBulkEditSeqTech()
bool IsSequencingTechnologyRequired(CSourceRequirements::EWizardType wizard_type)
string GetWizardSrcTypeField()
void LaunchFeatureAdder()
void LaunchSourceEditor()
CRef< objects::CSeq_table > GetSeqTechTable()
void LaunchSeqTechEditor()
void ClearSeqTechValues()
void SetSourceType(string src_type)
CSourceRequirements::EWizardType GetWizardType()
CVirusMoleculeQuestionsPanel * m_VirusMolQuestions
static bool ShowToolTips()
Should we show tooltips?
wxHyperlinkCtrl * m_SeqTechEdit
void OnClickSeqTechSummary(wxMouseEvent &event)
wxEVT_LEFT_DOWN event handler for ID_TEXTCTRL
wxHyperlinkCtrl * m_FeatureImportBtn
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void OnAddFeaturesClicked(wxHyperlinkEvent &event)
wxEVT_COMMAND_HYPERLINK event handler for ID_HYPERLINKCTRL3
void AddField(objects::CSeq_entry_Handle seh, ICommandProccessor *processor, IWorkbench *workbench, string label, string column_name, CTableFieldCommandConverter *converter, bool must_choose=false, bool required=false, string default_val="", string url="", bool allow_mix=true)
void OnEditSourceClicked(wxHyperlinkEvent &event)
wxEVT_COMMAND_HYPERLINK event handler for ID_HYPERLINKCTRL2
void ShowSourceLabelStar(bool val)
wxStaticText * m_StarTech
wxHyperlinkCtrl * m_EditSourceLink
CSubmissionPrepMainPanel()
Constructors.
~CSubmissionPrepMainPanel()
Destructor.
wxBoxSizer * m_WizardExtras
CSourceRequirements::EWizardSrcType GetWizardSrcTypeFromCtrls(CSourceRequirements::EWizardType wizard_type)
void Init()
Initialises member variables.
void ShowAddFeatureBtn(bool val)
wxStaticText * m_StarFeatures
void OnSourceTypeSelected(wxCommandEvent &event)
wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_SOURCETYPE
wxStaticText * m_StarSource
wxTextCtrl * m_SequencingTechLabel
void SetSourceType(CSourceRequirements::EWizardSrcType src_type)
wxHyperlinkCtrl * m_RemoveFeaturesBtn
void OnRemoveFeatHyperlinkClicked(wxHyperlinkEvent &event)
wxEVT_COMMAND_HYPERLINK event handler for ID_REMOVE_FEAT
void SetFeaturesLabel(string label)
void SetSourceTypeOptions(CSourceRequirements::EWizardType wizard_type)
pair< CSourceRequirements::EWizardSrcType, string > TWizardSrcTypeName
CSourceRequirements::EWizardSrcType GetWizardSrcTypeFromName(string name)
CSubPrep_panel * x_GetParent()
wxTextCtrl * m_FeaturesLabel
vector< CSubPrepFieldEditor * > m_ExtraFields
void OnClickFeatureSummary(wxMouseEvent &event)
wxEVT_LEFT_DOWN event handler for ID_TEXTCTRL1
void OnImportFeatureTableFile(wxHyperlinkEvent &event)
wxEVT_COMMAND_HYPERLINK event handler for ID_HYPERLINKCTRL4
vector< bool > m_FieldsInUse
void OnEditSequencingTechnologyClicked(wxHyperlinkEvent &event)
wxEVT_COMMAND_HYPERLINK event handler for ID_HYPERLINKCTRL1
TWizardSrcTypeNameList m_SrcTypeNames
void CreateSetChoice(CSourceRequirements::EWizardType wizard_type, objects::CSeq_entry_Handle seh)
vector< TWizardSrcTypeName > TWizardSrcTypeNameList
void UpdateSeqTechCtrls(CSourceRequirements::EWizardType wizard_type)
bool Create(wxWindow *parent, wxWindowID id=10001, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
wxBoxSizer * m_VirusMolSizer
wxFlexGridSizer * m_ExtraGrid
void SetSourceLabel(string label)
void CreateVirusMoleculeOptions(objects::CSeq_entry_Handle seh, ICommandProccessor *processor)
void OnClickSrcSummary(wxMouseEvent &event)
wxEVT_LEFT_DOWN event handler for ID_TEXTCTRL2
wxStaticText * x_AddStar(wxFlexGridSizer *sizer)
wxStaticText * m_StarSourceType
wxBoxSizer * m_ChimeraSizer
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxHyperlinkCtrl * m_FeatureAddBtn
wxTextCtrl * m_SourceLabel
void CreateControls()
Creates the controls and sizers.
void ShowFeaturesStar(bool val)
CChimeraPanel * m_ChimeraPanel
void ShowChimera(objects::CSeq_entry_Handle seh, ICommandProccessor *processor, IWorkbench *workbench, bool show)
Undo/Redo interface for editing operations.
IWorkbench is the central interface in the application framework.
const char * kMoleculeType
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
static bool Equal(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Test for equality of a substring with another string.
static const char label[]
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
CRef< objects::CSeq_table > BuildMolInfoValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh, CSourceRequirements::EWizardType wizard_type)
const struct ncbi::grid::netcache::search::fields::SIZE size
CRef< CSeqTable_column > FindSeqTableColumnByName(CRef< objects::CSeq_table > values_table, string column_name)
bool AreAnyColumnValuesMissing(CRef< objects::CSeqTable_column > col)
bool AreAllColumnValuesTheSame(CRef< objects::CSeqTable_column > col, string default_val="")
bool DoesColumnHaveValue(CRef< objects::CSeqTable_column > col, string val)
static int num_srctype_names
static CSubmissionPrepMainPanel::TWizardSrcTypeName s_srctype_names[]
static void s_ShowStar(wxStaticText *star, bool show)
#define ID_HYPERLINKCTRL1
#define ID_HYPERLINKCTRL3
#define ID_HYPERLINKCTRL2
#define ID_HYPERLINKCTRL4
wxString ToWxString(const string &s)
string ToStdString(const wxString &s)