43 #include "wx/wxprec.h"
53 #include <wx/textdlg.h>
72 if ((*id_it)->IsGeneral() && (*id_it)->GetGeneral().IsSetDb() &&
73 (*id_it)->GetGeneral().GetDb() !=
"TMSMART" && (*id_it)->GetGeneral().GetDb() !=
"BankIt" && (*id_it)->GetGeneral().GetDb() !=
"NCBIFILE")
75 existing_db = (*id_it)->GetGeneral().GetDb();
79 if (!existing_db.empty())
83 string dbname = wxGetTextFromUser(
_(
"Database"),
_(
"Create Protein IDs"), wxString(existing_db), parent).ToStdString();
98 if (locus_tag.empty())
111 new_feat->
Assign(orig_feat);
115 id->SetGeneral().SetDb(
dbname);
116 id->SetGeneral().SetTag().SetStr(locus_tag);
130 if ((*id_it)->IsGeneral() && (*id_it)->GetGeneral().IsSetDb() &&
131 (*id_it)->GetGeneral().GetDb() !=
"TMSMART" && (*id_it)->GetGeneral().GetDb() !=
"BankIt" && (*id_it)->GetGeneral().GetDb() !=
"NCBIFILE")
142 if ((*id_it)->IsLocal())
151 new_seq->
SetId().push_back(
id);
158 if ((*prot_feat)->IsSetData() && (*prot_feat)->GetData().IsProt() && (*prot_feat)->GetLocation().GetId()->IsLocal() && (*prot_feat)->GetLocation().GetId()->Match(*old_id))
160 (*prot_feat)->SetLocation().SetId(*
id);
171 new_prot->
SetSeq(*new_seq);
182 if (dlg.ShowModal() != wxID_OK)
191 create_protein_ids =
false;
199 ss <<
prefix <<
"_" << std::setw(4) << std::setfill(
'0') << count;
210 new_feat->
SetData().SetGene().SetLocus_tag(locus_tag);
218 new_feat->
SetData().SetGene().SetLocus_tag(locus_tag);
220 loc->
Assign(feat_ci->GetLocation());
222 if (feat_ci->IsSetPartial() && feat_ci->GetPartial()) {
231 if (create_protein_ids)
270 Create(parent,
id, caption, pos,
size, style);
281 SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
282 wxDialog::Create( parent,
id, caption, pos,
size, style );
287 GetSizer()->SetSizeHints(
this);
331 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
332 itemDialog1->SetSizer(itemBoxSizer2);
334 wxBoxSizer* itemBoxSizer3 =
new wxBoxSizer(wxHORIZONTAL);
335 itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_LEFT|wxALL, 5);
337 wxStaticText* itemStaticText4 =
new wxStaticText( itemDialog1, wxID_STATIC,
_(
"Prefix"), wxDefaultPosition, wxDefaultSize, 0 );
338 itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
341 itemBoxSizer3->Add(
m_Prefix, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
343 wxBoxSizer* itemBoxSizer6 =
new wxBoxSizer(wxHORIZONTAL);
344 itemBoxSizer2->Add(itemBoxSizer6, 0, wxALIGN_LEFT|wxALL, 5);
348 itemBoxSizer6->Add(
m_CreateProtIds, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
350 wxBoxSizer* itemBoxSizer8 =
new wxBoxSizer(wxHORIZONTAL);
351 itemBoxSizer2->Add(itemBoxSizer8, 0, wxALIGN_LEFT|wxALL, 5);
353 wxStaticText* itemStaticText9 =
new wxStaticText( itemDialog1, wxID_STATIC,
_(
"Database"), wxDefaultPosition, wxDefaultSize, 0 );
354 itemBoxSizer8->Add(itemStaticText9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
357 itemBoxSizer8->Add(
m_Database, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
359 wxBoxSizer* itemBoxSizer11 =
new wxBoxSizer(wxHORIZONTAL);
360 itemBoxSizer2->Add(itemBoxSizer11, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
362 wxButton* itemButton12 =
new wxButton( itemDialog1, wxID_OK,
_(
"Accept"), wxDefaultPosition, wxDefaultSize, 0 );
363 itemBoxSizer11->Add(itemButton12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
365 wxButton* itemButton13 =
new wxButton( itemDialog1, wxID_CANCEL,
_(
"Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
366 itemBoxSizer11->Add(itemButton13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
static void apply(CSeq_entry_Handle tse, ICommandProccessor *cmdProcessor, wxWindow *parent)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
static bool ShowToolTips()
Should we show tooltips?
CCreateLocusTagGenesDlg()
Constructors.
void CreateControls()
Creates the controls and sizers.
bool Create(wxWindow *parent, wxWindowID id=10000, const wxString &caption=_("Create locus-tag genes"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
wxCheckBox * m_CreateProtIds
~CCreateLocusTagGenesDlg()
Destructor.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void Init()
Initialises member variables.
static void create_protein_ids(CSeq_feat_Handle fh, const string &dbname, const string &locus_tag, CScope &scope, CRef< CCmdComposite > cmd)
static void apply(CSeq_entry_Handle tse, ICommandProccessor *cmdProcessor, wxWindow *parent)
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
namespace ncbi::objects::
Undo/Redo interface for editing operations.
virtual void Execute(IEditCommand *command, wxWindow *window=0)=0
#define ID_CREATE_LOCUSTAG_GENE_PREFIX
#define ID_CREATE_LOCUSTAG_GENES_PROT_ID
#define ID_CREATE_LOCUSTAG_GENE_DATABASE
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
bool Match(const CSeq_id &sid2) const
Match() - TRUE if SeqIds are equivalent.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Override Assign() to incorporate cache invalidation.
void SetId(CSeq_id &id)
set the 'id' field in all parts of this location
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
CMappedFeat GetBestGeneForCds(const CMappedFeat &cds_feat, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0, CFeatTree::EBestGeneType lookup_type=CFeatTree::eBestGene_TreeOnly)
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
CSeq_feat_Handle GetSeq_featHandle(const CSeq_feat &feat, EMissing action=eMissing_Default)
TBioseqCore GetBioseqCore(void) const
Get bioseq core structure.
virtual CConstRef< CSeq_feat > GetSeq_feat(void) const
CSeq_entry_Handle GetSeq_entry_Handle(void) const
Get parent Seq-entry handle.
virtual const CSeq_loc & GetProduct(void) const
bool IsSetProduct(void) const
bool IsProtein(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
CScope & GetScope(void) const
Get scope this handle belongs to.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
bool IsSetLocus_tag(void) const
systematic gene name (e.g., MI0001, ORF0069) Check if a value has been assigned to Locus_tag data mem...
const TLocus_tag & GetLocus_tag(void) const
Get the Locus_tag member data.
void SetLocation(TLocation &value)
Assign a value to Location data member.
void SetPartial(TPartial value)
Assign a value to Partial data member.
void SetProduct(TProduct &value)
Assign a value to Product data member.
const TData & GetData(void) const
Get the Data member data.
void SetData(TData &value)
Assign a value to Data data member.
const TGene & GetGene(void) const
Get the variant data.
bool IsLocal(void) const
Check if variant Local is selected.
TSeq & SetSeq(void)
Select the variant.
TId & SetId(void)
Assign a value to Id data member.
char * dbname(DBPROCESS *dbproc)
Get name of current database.
const struct ncbi::grid::netcache::search::fields::SIZE size
static const char * prefix[]
Utility macros and typedefs for exploring NCBI objects from seq.asn.
#define FOR_EACH_SEQID_ON_BIOSEQ(Itr, Var)
FOR_EACH_SEQID_ON_BIOSEQ EDIT_EACH_SEQID_ON_BIOSEQ.
#define EDIT_EACH_SEQFEAT_ON_SEQANNOT(Itr, Var)
#define EDIT_EACH_SEQANNOT_ON_BIOSEQ(Itr, Var)
#define EDIT_EACH_SEQID_ON_BIOSEQ(Itr, Var)