46 #include <wx/stattext.h>
100 CBulkCmdPanel::Create( parent,
id, pos,
size, style );
105 GetSizer()->SetSizeHints(
this);
140 m_QualFeat->SetData().SetImp().SetKey(
"misc_feature");
153 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
154 itemCBulkCmdPanel1->SetSizer(itemBoxSizer2);
156 wxBoxSizer* itemBoxSizer3 =
new wxBoxSizer(wxHORIZONTAL);
157 itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_LEFT|wxALL, 5);
159 wxBoxSizer* itemBoxSizer4 =
new wxBoxSizer(wxVERTICAL);
160 itemBoxSizer3->Add(itemBoxSizer4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
162 wxStaticText* itemStaticText5 =
new wxStaticText( itemCBulkCmdPanel1, wxID_STATIC,
_(
"Feature Type"), wxDefaultPosition, wxDefaultSize, 0 );
163 itemBoxSizer4->Add(itemStaticText5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
165 wxArrayString m_FeatureTypeStrings;
167 itemBoxSizer4->Add(
m_FeatureType, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
172 wxFlexGridSizer* itemFlexGridSizer8 =
new wxFlexGridSizer(0, 2, 0, 0);
173 itemBoxSizer2->Add(itemFlexGridSizer8, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
175 wxStaticText* itemStaticText9 =
new wxStaticText( itemCBulkCmdPanel1, wxID_STATIC,
_(
"Gene Symbol"), wxDefaultPosition, wxDefaultSize, 0 );
176 itemFlexGridSizer8->Add(itemStaticText9, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
178 m_Locus =
new wxTextCtrl( itemCBulkCmdPanel1,
ID_TEXTCTRL11, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
179 itemFlexGridSizer8->Add(
m_Locus, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
181 wxStaticText* itemStaticText11 =
new wxStaticText( itemCBulkCmdPanel1, wxID_STATIC,
_(
"Gene Description"), wxDefaultPosition, wxDefaultSize, 0 );
182 itemFlexGridSizer8->Add(itemStaticText11, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
184 m_GeneDesc =
new wxTextCtrl( itemCBulkCmdPanel1,
ID_TEXTCTRL12, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
185 itemFlexGridSizer8->Add(
m_GeneDesc, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
187 wxStaticText* itemStaticText13 =
new wxStaticText( itemCBulkCmdPanel1, wxID_STATIC,
_(
"Comment"), wxDefaultPosition, wxDefaultSize, 0 );
188 itemFlexGridSizer8->Add(itemStaticText13, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
190 m_Comment =
new wxTextCtrl( itemCBulkCmdPanel1,
ID_TEXTCTRL14, wxEmptyString, wxDefaultPosition, wxSize(300, 70), wxTE_MULTILINE );
191 itemFlexGridSizer8->Add(
m_Comment, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
196 itemBoxSizer2->Add(
m_Location, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
199 itemBoxSizer2->Add(500, 0, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
229 vector<string> listed_feat;
233 listed_feat.push_back(
"Gene");
234 listed_feat.push_back(
"misc_feature");
235 existing.
insert(listed_feat[0]);
236 existing.
insert(listed_feat[1]);
239 ITERATE(vector<const CFeatListItem *>, feat_it, featlist) {
242 int feat_type = item.
GetType();
247 types[pair<int,int>(feat_type,feat_subtype)] = desc;
248 if (existing.
find(desc) == existing.
end()) {
250 listed_feat.push_back(desc);
256 for (
size_t i = 0;
i < listed_feat.size(); ++
i) {
260 if (find(listed_feat.begin(), listed_feat.end(),
m_DefaultKey) != listed_feat.end()) {
312 objects::CBioseq_CI b_iter(
m_TopSeqEntry, objects::CSeq_inst::eMol_na);
313 for ( ; b_iter ; ++b_iter ) {
340 feat->SetData().SetImp().SetKey(
key);
342 feat->SetComment(comment);
344 feat->SetLocation().Assign(*loc);
347 feat->SetPartial(
true);
355 new_gene->SetData().SetGene().SetLocus(gene_symbol);
357 new_gene->SetData().SetGene().SetDesc(gene_desc);
360 new_gene->SetComment(comment);
362 new_gene->SetLocation().Assign(*loc);
365 new_gene->SetPartial(
true);
376 return "You must select feature type!";
378 objects::CBioseq_CI b_iter(
m_TopSeqEntry, objects::CSeq_inst::eMol_na);
379 for ( ; b_iter ; ++b_iter ) {
380 objects::CSeq_entry_Handle seh = b_iter->GetSeq_entry_Handle();
383 return "You must specify valid location values!";
386 return "Unknown error";
432 feat.SetQual().push_back(q);
435 && feat.GetData().GetImp().IsSetKey() && feat.GetData().GetImp().GetKey() ==
"repeat_region" )
437 feat.SetData().SetImp().SetKey(
"mobile_element");
449 string val = (*it)->GetVal();
450 string qual = (*it)->GetQual();
452 gene.SetData().SetGene().SetLocus(
val);
453 if (qual ==
"locus_tag")
454 gene.SetData().SetGene().SetLocus_tag(
val);
455 if (qual ==
"allele")
456 gene.SetData().SetGene().SetAllele(
val);
458 gene.SetData().SetGene().SetMaploc(
val);
459 if (qual ==
"gene_synonym")
460 gene.SetData().SetGene().SetSyn().push_back(
val);
@ eExtreme_Biological
5' and 3'
static bool s_IsRNAFeature(int feat_subtype)
USING_SCOPE(ncbi::objects)
#define ID_FEATURE_TYPE_LISTBOX
CBulkLocationPanel * m_Location
bool m_add_location_panel
virtual bool ShouldAddToExisting()
virtual CRef< objects::CSeq_loc > GetLocForBioseq(const objects::CBioseq &bioseq)
virtual CRef< CCmdComposite > GetCommand()
void CreateControls()
Creates the controls and sizers.
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
~CBulkOtherAddPanel()
Destructor.
virtual void AddOneCommand(const objects::CBioseq_Handle &bsh, CRef< CCmdComposite > cmd)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void OnFeatureTypeListboxSelected(wxCommandEvent &event)
wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_FEATURE_TYPE_LISTBOX
CBulkOtherAddPanel()
Constructors.
void Init()
Initialises member variables.
CRef< objects::CSeq_feat > m_QualFeat
CGBQualPanel * m_GBQualPanel
void x_AddGeneQuals(objects::CSeq_feat &gene)
wxBoxSizer * m_GBQualSizer
virtual string GetErrorMessage()
wxListBox * m_FeatureType
void x_ChangeFeatureType(const string &key)
static bool ShowToolTips()
Should we show tooltips?
objects::CSeq_entry_Handle m_TopSeqEntry
void x_AddQuals(objects::CSeq_feat &feat)
CFeatListItem - basic configuration data for one "feature" type.
string GetDescription() const
static bool s_IsRarelyUsedOrDiscouragedFeatureType(int subtype)
virtual bool TransferDataToWindow()
virtual bool TransferDataFromWindow()
void PopulateGBQuals(objects::CSeq_feat &seq_feat)
@Gb_qual.hpp User-defined methods of the data storage class.
static bool IsRegulatory(ESubtype subtype)
namespace ncbi::objects::
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
vector< const objects::CFeatListItem * > GetSortedFeatList(objects::CSeq_entry_Handle seh, size_t max=numeric_limits< size_t >::max())
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
CConstRef< CBioseq > GetCompleteBioseq(void) const
Get the complete bioseq.
CSeq_entry_Handle GetSeq_entry_Handle(void) const
Get parent Seq-entry handle.
void Reset(void)
Reset reference object.
#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.
vector< CRef< CGb_qual > > TQual
const TQual & GetQual(void) const
Get the Qual member data.
constexpr bool empty(list< Ts... >) noexcept
const struct ncbi::grid::netcache::search::fields::SIZE size
const struct ncbi::grid::netcache::search::fields::KEY key
bool AlreadyHasFeature(objects::CBioseq_Handle bh, string key, string comment)
static const struct type types[]
wxString ToWxString(const string &s)
string ToStdString(const wxString &s)