: m_is_organelle(
false)
86 constvector<objects::CBioSource::EGenome> &organelle_types,wxWindowID
id,
constwxPoint& pos,
constwxSize&
size,
longstyle )
87: m_Seh(seh), m_Subtype(subtype), m_is_organelle(is_organelle), m_organelle_types(organelle_types)
101SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY);
102wxPanel::Create( parent,
id, pos,
size, style );
107GetSizer()->SetSizeHints(
this);
152wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxVERTICAL);
153itemPanel1->SetSizer(itemBoxSizer2);
155wxBoxSizer* itemBoxSizer1 =
newwxBoxSizer(wxHORIZONTAL);
156itemBoxSizer2->Add(itemBoxSizer1, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
158wxArrayString m_SeqIdStrings;
159m_SeqIdStrings.Add(
wxT(
""));
161 for(objects::CBioseq_CI bi(
m_Seh, objects::CSeq_inst::eMol_na); bi; ++bi) {
162 stringid_str = bi->GetSeqId()->AsFastaString();
166 m_SeqId=
newwxChoice( itemPanel1,
ID_SINGLESEQID, wxDefaultPosition, wxSize(130, -1), m_SeqIdStrings, 0 );
167itemBoxSizer1->Add(
m_SeqId, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);
169 m_LengthLabel=
newwxStaticText( itemPanel1, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxSize(70, -1), wxALIGN_CENTRE);
170itemBoxSizer1->Add(
m_LengthLabel, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);
174wxArrayString choices;
180 #ifdef __WXOSX_COCOA__ 183itemBoxSizer1->Add(
m_OrganelleCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);
193itemBoxSizer1->Add(
m_NameCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);
196itemBoxSizer1->Add(30, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);
200itemBoxSizer1->Add(
m_Complete, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);
202itemBoxSizer1->Add(30, 5, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 0);
206itemBoxSizer1->Add(
m_Circular, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);
208itemBoxSizer1->Add(13, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);
211 if(
m_Subtype== objects::CSubSource::eSubtype_plasmid_name) {
212 m_NameCtrl->SetToolTip(
wxT(
"Plasmid names must begin with 'p'. However, use 'unnamed' if the name \ 213 is not determined; use 'unnamed1' and 'unnamed2', etc(without spaces) \ 214 if there are multiple plasmids whose names are not determined."));
215}
else if(
m_Subtype== objects::CSubSource::eSubtype_chromosome) {
216 m_NameCtrl->SetToolTip(
wxT(
"Use the community accepted values for the chromosome or \ 217 linkage group name, eg 1 or IX or LG3"));
218 m_Complete->SetToolTip(
wxT(
"This sequence represents the chromosome, although it may still have \ 219 gaps or be missing telomere or centromere sequence."));
268objects::CSeqdesc_CI di(bh, objects::CSeqdesc::e_Source);
270 constobjects::CBioSource& src = di->GetSource();
271 if(subtype == objects::CSubSource::eSubtype_plasmid_name
272&& src.IsSetGenome() && src.GetGenome() == objects::CBioSource::eGenome_plasmid) {
274}
else if(subtype == objects::CSubSource::eSubtype_chromosome
275&& src.IsSetGenome() && src.GetGenome() == objects::CBioSource::eGenome_chromosome) {
279 if(di->GetSource().IsSetSubtype()) {
280 for(
autos : di->GetSource().GetSubtype()) {
281 if(s->IsSetSubtype() && s->GetSubtype() == subtype &&
293objects::CSeqdesc_CI di(bh, objects::CSeqdesc::e_Source);
294 if(di && di->GetSource().IsSetGenome()) {
295 autoit = find(organelle_types.begin(), organelle_types.end(), di->GetSource().GetGenome());
296 if(it != organelle_types.end())
304 constobjects::CBioseq& seq = *(bh.GetCompleteBioseq());
305 if(!seq.IsSetInst() || !seq.GetInst().IsSetExt() ||
306!seq.GetInst().GetExt().IsDelta() ||
307!seq.GetInst().GetExt().GetDelta().IsSet()) {
311 boolfound_gap =
false;
312 for(
autoit : seq.GetInst().GetExt().GetDelta().Get()) {
313 if(it->IsLiteral()) {
314 if(!it->GetLiteral().IsSetSeq_data()) {
317}
else if(it->GetLiteral().GetSeq_data().IsGap()) {
330 m_Circular->SetValue(bh.IsSetInst_Topology() && bh.GetInst_Topology() == objects::CSeq_inst::eTopology_circular);
334 boolis_complete =
false;
335objects::CSeqdesc_CI di(bh, objects::CSeqdesc::e_Source);
336 if(di && di->GetSource().IsSetSubtype()) {
337 constobjects::CBioSource& src = di->GetSource();
338 if(
m_Subtype== objects::CSubSource::eSubtype_chromosome && src.IsSetGenome() && src.GetGenome() == objects::CBioSource::eGenome_chromosome) {
342 boolfound_name =
false;
343 for(
autos : src.GetSubtype()) {
344 if(s->IsSetSubtype() && s->GetSubtype() ==
m_Subtype&&
368objects::CSeqdesc_CI mi(bh, objects::CSeqdesc::e_Molinfo);
369 if(mi && mi->GetMolinfo().IsSetCompleteness() && mi->GetMolinfo().GetCompleteness() == objects::CMolInfo::eCompleteness_complete) {
397 if(!seqid.empty()) {
399objects::CBioseq_Handle bh =
m_Seh.GetScope().GetBioseqHandle(*
id);
428 boolany_changes =
false;
430 if(!seqid.empty()) {
432objects::CBioseq_Handle bh =
m_Seh.GetScope().GetBioseqHandle(*
id);
436objects::CSeqdesc_CI oldsrc(bh, objects::CSeqdesc::e_Source);
440new_src->Assign(*oldsrc);
441objects::CBioSource& bsrc = new_src->SetSource();
443 if(bsrc.IsSetSubtype()) {
445 autosit = bsrc.SetSubtype().begin();
446 while(sit != bsrc.SetSubtype().end()) {
449 if(val_name.empty()) {
450sit = bsrc.SetSubtype().erase(sit);
453 if(!(*sit)->IsSetName() || !
NStr::Equal((*sit)->GetName(), val_name)) {
454(*sit)->SetName(val_name);
463 if(!found && !val_name.empty()) {
466 if(bsrc.GetSubtype().empty()) {
470 if(!val_name.empty()) {
476 if(val_name.empty()) {
477 if(
m_Subtype== objects::CSubSource::eSubtype_plasmid_name && new_src->GetSource().IsSetGenome() &&
478new_src->GetSource().GetGenome() == objects::CBioSource::eGenome_plasmid) {
479new_src->SetSource().ResetGenome();
482 if(
m_Subtype== objects::CSubSource::eSubtype_plasmid_name) {
483 if(!new_src->GetSource().IsSetGenome() || new_src->GetSource().GetGenome() != objects::CBioSource::eGenome_plasmid) {
484new_src->SetSource().SetGenome(objects::CBioSource::eGenome_plasmid);
490 if(sel == wxNOT_FOUND)
491new_src->SetSource().ResetGenome();
496 if(!oldsrc->Equals(*new_src)) {
498 cmd.AddCommand(*chg);
501}
else if(!val_name.empty()) {
504new_src->SetSource().SetOrg();
506new_src->SetSource().SetSubtype().push_back(subsrc);
507 if(
m_Subtype== objects::CSubSource::eSubtype_plastid_name) {
508new_src->SetSource().SetGenome(objects::CBioSource::eGenome_plasmid);
511 cmd.AddCommand(*cmdAddDesc);
519 cmd.AddCommand(*cmdAddDesc);
525objects::CSeqdesc_CI oldmol(bh, objects::CSeqdesc::e_Molinfo);
527 boolcurrent_completeness = (oldmol->GetMolinfo().IsSetCompleteness() && oldmol->GetMolinfo().GetCompleteness() == objects::CMolInfo::eCompleteness_complete);
531new_mol->Assign(*oldmol);
533new_mol->SetMolinfo().SetCompleteness(objects::CMolInfo::eCompleteness_complete);
536new_mol->SetMolinfo().ResetCompleteness();
539 cmd.AddCommand(*chg);
546new_mol->SetMolinfo().SetCompleteness(objects::CMolInfo::eCompleteness_complete);
548 cmd.AddCommand(*cmdAddDesc);
556 boolcurrently_circular = (bh.IsSetInst_Topology() && bh.GetInst_Topology() == objects::CSeq_inst::eTopology_circular);
559new_inst->Assign(bh.GetInst());
561new_inst->SetTopology(objects::CSeq_inst::eTopology_circular);
564new_inst->ResetTopology();
568 cmd.AddCommand(*chgInst);
578 boolchange_val =
false;
581objects::CSeqdesc_CI oldsrc(bh, objects::CSeqdesc::e_Source);
582 if(oldsrc && oldsrc->GetSource().IsSetSubtype()) {
585new_src->Assign(*oldsrc);
586objects::CBioSource& bsrc = new_src->SetSource();
588 autosit = bsrc.SetSubtype().begin();
589 while(sit != bsrc.SetSubtype().end()) {
590 if((*sit)->IsSetSubtype() && (*sit)->GetSubtype() == subtype) {
591sit = bsrc.SetSubtype().erase(sit);
598 if(bsrc.GetSubtype().empty()) {
605 cmd.AddCommand(*chg);
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
wxChoice * m_OrganelleCtrl
wxStaticText * m_LengthLabel
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void OnChangeSeqId(wxCommandEvent &event)
string GetOrganelleValue()
objects::CSeq_entry_Handle m_Seh
static bool ShowToolTips()
Should we show tooltips?
void CreateControls()
Creates the controls and sizers.
void SetValue(objects::CBioseq_Handle bh)
objects::CSubSource::ESubtype m_Subtype
vector< objects::CBioSource::EGenome > m_organelle_types
bool Create(wxWindow *parent, wxWindowID id=ID_CSINGLESEQUENCEPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
~CSingleSequencePanel()
Destructor.
static bool NeedsRow(objects::CBioseq_Handle bh, objects::CSubSource::ESubtype subtype)
void EnableTextCtrl(bool value)
bool AddToUpdateCommand(CCmdComposite &cmd)
static bool NeedsOrganelleRow(objects::CBioseq_Handle bh, const vector< objects::CBioSource::EGenome > &organelle_types)
static bool RemoveNamedValue(CCmdComposite &cmd, objects::CSubSource::ESubtype subtype, objects::CBioseq_Handle bh)
void Init()
Initialises member variables.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
CSingleSequencePanel()
Constructors.
string GetModifierValue()
#define ENUM_METHOD_NAME(EnumName)
#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 enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to 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.
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
bool s_HasGaps(objects::CBioseq_Handle bh)
wxString ToWxString(const string &s)
string ToStdString(const wxString &s)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4