A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/single__sequence__panel_8cpp_source.html below:

NCBI C++ ToolKit: src/gui/widgets/edit/single_sequence_panel.cpp Source File

47 #include <wx/textctrl.h> 48 #include <wx/choice.h> 49 #include <wx/stattext.h> 50 #include <wx/checkbox.h> 80

: m_is_organelle(

false

)

86  const

vector<objects::CBioSource::EGenome> &organelle_types,wxWindowID

id

,

const

wxPoint& pos,

const

wxSize&

size

,

long

style )

87

: m_Seh(seh), m_Subtype(subtype), m_is_organelle(is_organelle), m_organelle_types(organelle_types)

101 

SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY);

102

wxPanel::Create( parent,

id

, pos,

size

, style );

107

GetSizer()->SetSizeHints(

this

);

152

wxBoxSizer* itemBoxSizer2 =

new

wxBoxSizer(wxVERTICAL);

153

itemPanel1->SetSizer(itemBoxSizer2);

155

wxBoxSizer* itemBoxSizer1 =

new

wxBoxSizer(wxHORIZONTAL);

156

itemBoxSizer2->Add(itemBoxSizer1, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);

158

wxArrayString m_SeqIdStrings;

159

m_SeqIdStrings.Add(

wxT

(

""

));

161  for

(objects::CBioseq_CI bi(

m_Seh

, objects::CSeq_inst::eMol_na); bi; ++bi) {

162  string

id_str = bi->GetSeqId()->AsFastaString();

166  m_SeqId

=

new

wxChoice( itemPanel1,

ID_SINGLESEQID

, wxDefaultPosition, wxSize(130, -1), m_SeqIdStrings, 0 );

167

itemBoxSizer1->Add(

m_SeqId

, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);

169  m_LengthLabel

=

new

wxStaticText( itemPanel1, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxSize(70, -1), wxALIGN_CENTRE);

170

itemBoxSizer1->Add(

m_LengthLabel

, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);

174

wxArrayString choices;

180 #ifdef __WXOSX_COCOA__ 183

itemBoxSizer1->Add(

m_OrganelleCtrl

, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);

193

itemBoxSizer1->Add(

m_NameCtrl

, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);

196

itemBoxSizer1->Add(30, 5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);

200

itemBoxSizer1->Add(

m_Complete

, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);

202

itemBoxSizer1->Add(30, 5, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 0);

206

itemBoxSizer1->Add(

m_Circular

, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);

208

itemBoxSizer1->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."

));

268

objects::CSeqdesc_CI di(bh, objects::CSeqdesc::e_Source);

270  const

objects::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

(

auto

s : di->GetSource().GetSubtype()) {

281  if

(s->IsSetSubtype() && s->GetSubtype() == subtype &&

293

objects::CSeqdesc_CI di(bh, objects::CSeqdesc::e_Source);

294  if

(di && di->GetSource().IsSetGenome()) {

295  auto

it = find(organelle_types.begin(), organelle_types.end(), di->GetSource().GetGenome());

296  if

(it != organelle_types.end())

304  const

objects::CBioseq& seq = *(bh.GetCompleteBioseq());

305  if

(!seq.IsSetInst() || !seq.GetInst().IsSetExt() ||

306

!seq.GetInst().GetExt().IsDelta() ||

307

!seq.GetInst().GetExt().GetDelta().IsSet()) {

311  bool

found_gap =

false

;

312  for

(

auto

it : 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  bool

is_complete =

false

;

335

objects::CSeqdesc_CI di(bh, objects::CSeqdesc::e_Source);

336  if

(di && di->GetSource().IsSetSubtype()) {

337  const

objects::CBioSource& src = di->GetSource();

338  if

(

m_Subtype

== objects::CSubSource::eSubtype_chromosome && src.IsSetGenome() && src.GetGenome() == objects::CBioSource::eGenome_chromosome) {

342  bool

found_name =

false

;

343  for

(

auto

s : src.GetSubtype()) {

344  if

(s->IsSetSubtype() && s->GetSubtype() ==

m_Subtype

&&

368

objects::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()) {

399

objects::CBioseq_Handle bh =

m_Seh

.GetScope().GetBioseqHandle(*

id

);

428  bool

any_changes =

false

;

430  if

(!seqid.empty()) {

432

objects::CBioseq_Handle bh =

m_Seh

.GetScope().GetBioseqHandle(*

id

);

436

objects::CSeqdesc_CI oldsrc(bh, objects::CSeqdesc::e_Source);

440

new_src->Assign(*oldsrc);

441

objects::CBioSource& bsrc = new_src->SetSource();

443  if

(bsrc.IsSetSubtype()) {

445  auto

sit = bsrc.SetSubtype().begin();

446  while

(sit != bsrc.SetSubtype().end()) {

449  if

(val_name.empty()) {

450

sit = 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() &&

478

new_src->GetSource().GetGenome() == objects::CBioSource::eGenome_plasmid) {

479

new_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) {

484

new_src->SetSource().SetGenome(objects::CBioSource::eGenome_plasmid);

490  if

(sel == wxNOT_FOUND)

491

new_src->SetSource().ResetGenome();

496  if

(!oldsrc->Equals(*new_src)) {

498  cmd

.AddCommand(*chg);

501

}

else if

(!val_name.empty()) {

504

new_src->SetSource().SetOrg();

506

new_src->SetSource().SetSubtype().push_back(subsrc);

507  if

(

m_Subtype

== objects::CSubSource::eSubtype_plastid_name) {

508

new_src->SetSource().SetGenome(objects::CBioSource::eGenome_plasmid);

511  cmd

.AddCommand(*cmdAddDesc);

519  cmd

.AddCommand(*cmdAddDesc);

525

objects::CSeqdesc_CI oldmol(bh, objects::CSeqdesc::e_Molinfo);

527  bool

current_completeness = (oldmol->GetMolinfo().IsSetCompleteness() && oldmol->GetMolinfo().GetCompleteness() == objects::CMolInfo::eCompleteness_complete);

531

new_mol->Assign(*oldmol);

533

new_mol->SetMolinfo().SetCompleteness(objects::CMolInfo::eCompleteness_complete);

536

new_mol->SetMolinfo().ResetCompleteness();

539  cmd

.AddCommand(*chg);

546

new_mol->SetMolinfo().SetCompleteness(objects::CMolInfo::eCompleteness_complete);

548  cmd

.AddCommand(*cmdAddDesc);

556  bool

currently_circular = (bh.IsSetInst_Topology() && bh.GetInst_Topology() == objects::CSeq_inst::eTopology_circular);

559

new_inst->Assign(bh.GetInst());

561

new_inst->SetTopology(objects::CSeq_inst::eTopology_circular);

564

new_inst->ResetTopology();

568  cmd

.AddCommand(*chgInst);

578  bool

change_val =

false

;

581

objects::CSeqdesc_CI oldsrc(bh, objects::CSeqdesc::e_Source);

582  if

(oldsrc && oldsrc->GetSource().IsSetSubtype()) {

585

new_src->Assign(*oldsrc);

586

objects::CBioSource& bsrc = new_src->SetSource();

588  auto

sit = bsrc.SetSubtype().begin();

589  while

(sit != bsrc.SetSubtype().end()) {

590  if

((*sit)->IsSetSubtype() && (*sit)->GetSubtype() == subtype) {

591

sit = 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