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/edit__object__seq__desc_8cpp_source.html below:

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

60 #include <wx/treebook.h> 61 #include <wx/msgdlg.h> 62 #include <wx/toplevel.h> 119  "CEditObjectSeq_desc::CreateWindow - Window already created!"

);

122

wxTopLevelWindow* gui_widget =

dynamic_cast<

wxTopLevelWindow*

>

(parent);

137  if

(

m_SEH

.IsSeq()) {

138

orig_bioseq =

m_SEH

.GetSeq().GetCompleteBioseq();

145

new_bioseq->

Assign

(*bioseq);

150  CSeqdesc

& edited_seq_desc =

dynamic_cast<CSeqdesc

&

>

(*m_EditedDescriptor);

156

wxBoxSizer* holder_sizer = 0;

161

holder_sizer =

new

wxBoxSizer(wxHORIZONTAL);

162

holder->SetSizer(holder_sizer);

165

holder_sizer->Add(

m_Placement

, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);

172

holder_sizer =

new

wxBoxSizer(wxVERTICAL);

173

parent->SetSizer(holder_sizer);

175  bool

replace_all =

false

;

177  switch

(desc_type.first) {

182

gui_widget->SetTitle(

_

(

"Comment"

));

190

gui_widget->SetTitle(

_

(

"Title"

));

197

gui_widget->SetTitle(

_

(

"Name"

));

204

gui_widget->SetTitle(

_

(

"Region"

));

212

gui_widget->SetTitle(

_

(

"Publication"

));

214

help_client->

SetHelpUrl

(

_

(

"https://www.ncbi.nlm.nih.gov/tools/gbench/manual13/"

));

223  CBioseq

& edited_bioseq =

dynamic_cast<CBioseq

&

>

(*m_EditedBioseq);

224

bioseq = &(edited_bioseq);

228

gui_widget->SetTitle(

_

(

"MolInfo"

));

240

gui_widget->SetTitle(

_

(

"TPA"

));

245  if

(desc_type.second ==

"##Assembly-Data-START##"

)

250

gui_widget->SetTitle(

_

(

"Sequencing Technology"

));

257

gui_widget->SetTitle(

_

(

"Structured Comment"

));

262  if

(desc_type.second ==

"##Genome-Assembly-Data-START##"

)

263

help_client->

SetHelpUrl

(

_

(

"https://www.ncbi.nlm.nih.gov/tools/gbench/manual12/#assembly-comment"

));

273

gui_widget->SetTitle(

_

(

"RefGene"

));

282

gui_widget->SetTitle(

_

(

"DBLink"

));

292

gui_widget->SetTitle(

_

(

"Unverified"

));

301

gui_widget->SetTitle(

_

(

"Unreviewed"

));

310

gui_widget->SetTitle(

_

(

"Authorized access"

));

319

parent->SetMinSize(wxSize(810, 650));

321

gui_widget->SetTitle(

_

(

"BioSource"

));

331  edit

->ChangeSeqdesc(edited_seq_desc);

338

holder_sizer->Add(

m_Window

, 1, wxGROW|wxALL, 5);

342  m_ReplaceAll

=

new

wxCheckBox( parent,

wxID_ANY

,

_

(

"Replace All"

), wxDefaultPosition, wxDefaultSize, 0 );

344

holder_sizer->Add(

m_ReplaceAll

, 0, wxALIGN_BOTTOM|wxALL, 0);

348

holder_sizer->Add(

m_Window

, 1, wxGROW|wxALL, 0);

355  m_ReplaceAll

=

new

wxCheckBox( parent,

wxID_ANY

,

_

(

"Replace All"

), wxDefaultPosition, wxDefaultSize, 0 );

357

holder_sizer->Add(

m_ReplaceAll

, 0, wxALIGN_RIGHT|wxALL, 0);

366  void

ConsolidateObjectList(vector<SeqdescEntryPair>& obj_list)

368  if

(obj_list.size() < 2) {

371

vector<SeqdescEntryPair>::iterator it = obj_list.begin();

372

vector<SeqdescEntryPair>::iterator

prev

= it;

374  while

(

prev

!= obj_list.end()) {

377  while

(it != obj_list.end()) {

378  if

(it->first.GetPointer() ==

prev

->first.GetPointer()) {

379

it = obj_list.erase(it);

391

vector<SeqdescEntryPair>

objects

;

393  for

(

CSeqdesc_CI

desc_it(*bi, choice); desc_it; ++desc_it) {

394  objects

.emplace_back(

ConstRef

(&(*desc_it)), desc_it.GetSeq_entry_Handle());

398  sort

(

objects

.begin(),

objects

.end(), [](

const

SeqdescEntryPair&

a

,

const

SeqdescEntryPair&

b

) { return a.first < b.first; });

399

ConsolidateObjectList(

objects

);

409  if

(seh.

IsSet

() && propagate) {

420  cmd

->AddCommand(*subcmd);

426  cmd

->AddCommand(*subcmd);

454  cmd

->AddCommand(*chgd_cmd);

462  cmd

->AddCommand(*subcmd);

469

new_bioseq->

Assign

(*bioseq);

472  cmd

->AddCommand(*chgInst);

479  if

(!entry_it->IsSet())

485  cmd

->AddCommand(*cmdDelDesc);

489  if

(num_nuc > 1 && num_desc != 0)

492

prompt <<

"There are "

<< num_desc <<

" molinfo descriptors on "

<< num_nuc <<

" bioseqs.\n They will be overwritten.\n Procced?"

;

493  int

choice = wxMessageBox(prompt,

_

(

"Warning"

), wxYES_NO | wxICON_WARNING,

NULL

);

511  const auto

& orig_inst = orig_bseq.

GetInst

();

512  for

(

CBioseq_CI

b_iter(seh); b_iter; ++b_iter) {

523  bool

same_inst = same_mol && same_strand && same_topology;

527  bool

updated =

false

;

529  if

(desc_it->Equals(orig_desc)) {

531

replacement->

Assign

(edited_desc);

533  cmd

->AddCommand(*chgd_cmd);

541

new_bioseq->

Assign

(*bioseq);

547

new_bioseq->

SetInst

().ResetTopology();

553

new_bioseq->

SetInst

().ResetStrand();

559

new_bioseq->

SetInst

().ResetMol();

563  cmd

->AddCommand(*chgInst);

577  m_Window

->TransferDataFromWindow();

590  if

(specific && specific.

IsSeq

()) {

596

new_bioseq->

Assign

(*bioseq);

605  CSeqdesc

& edited_seq_desc =

dynamic_cast<CSeqdesc

&

>

(*m_EditedDescriptor);

614  edit

->UpdateSeqdesc(edited_seq_desc);

622  CBioseq

& edited_bioseq =

dynamic_cast<CBioseq

&

>

(*m_EditedBioseq);

636  else if

(edited_seq_desc.

IsMolinfo

()) {

647  if

(original && orig_bseq && edited_bioseq) {

657  cmd

->AddCommand(*chgd_cmd);

663  cmd

->AddCommand(*chgInst);

671  bool

propagate =

false

;

673  int

choice = wxMessageBox(

wxT

(

"Do you wish to propagate the descriptor to the sequences in the set?"

),

wxT

(

"Warning"

),

675  if

(choice == wxYES) {

689  for

(

auto

& it : obj_list) {

693

replacement->

Assign

(edited_seq_desc);

707

vector<SeqdescEntryPair> obj_list =

711  for

(

auto

& it : obj_list) {

712  const CSeqdesc

* descriptor =

dynamic_cast<const CSeqdesc

*

>

(it.first.GetPointer());

713  if

(descriptor && descriptor->

Equals

(*original)) {

715

replacement->

Assign

(edited_seq_desc);

729  while

(&*desc_it != original) {

738

*

out

<< edited_seq_desc;

755

*

out

<< edited_seq_desc;

766  const CSeqdesc

* seqdesc(

nullptr

);

773

bioseq = b_iter->GetCompleteBioseq();

780  edit

->ChangeSeqdesc(*seqdesc);

787

new_bioseq->

Assign

(*bioseq);

803  CSeqdesc

& edited_seq_desc =

dynamic_cast<CSeqdesc

&

>

(*m_EditedDescriptor);

809  else if

(desc_type.first !=

ePub

) {

823  string label

= desc_type.second;

836  if

(

label

==

"StructuredComment"

)

842  int

choice = wxMessageBox(

_

(

"A "

) +

text

+

_

(

" already exists at or above the selected target. Would you like to edit the existing "

) +

text

+

_

(

" instead?"

),

843  wxT

(

"Warning"

), wxYES_NO | wxICON_ERROR, gui_widget);

848

gui_widget->SetFocus();

850  if

(choice == wxYES) {

851  edit

->ChangeSeqdesc(*di);

859  if

(

m_SEH

.IsSeq()) {

865

new_bioseq->

Assign

(*bioseq);

936  switch

(desc.

Which

()) {

973  if

((*it)->IsSetLabel()

974

&& (*it)->GetLabel().IsStr()

975

&&

NStr::Equal

((*it)->GetLabel().GetStr(),

"StructuredCommentPrefix"

)

976

&& (*it)->IsSetData()

977

&& (*it)->GetData().IsStr()) {

978

sval = (*it)->GetData().GetStr();

1008  return

make_pair(rval,sval);

CSeq_entry_Handle GetSeqEntryForSeqdesc(CRef< CScope > scope, const CSeqdesc &seq_desc)

void SetUser_object(CRef< objects::CUser_object > user)

void SetBioseq(CConstRef< objects::CBioseq > seq)

void SetUser_object(CRef< objects::CUser_object > user)

void AddCommand(IEditCommand &command)

virtual bool TransferDataToWindow()

void PopulateLocationChoices(objects::CSeq_entry_Handle seh)

void SetNotify(IDescEditorNotify *notify)

objects::CSeq_entry_Handle GetLocationChoice()

objects::CSeq_entry_Handle m_SEH

virtual void LocationChange(objects::CSeq_entry_Handle seh, wxTopLevelWindow *gui_widget)

CRef< CSerialObject > m_EditedBioseq

CRef< objects::CScope > m_Scope

void MolInfoLocationChange(objects::CSeq_entry_Handle seh, IDescEditorPanel *edit, CMolInfoPanel *molPanel)

virtual IEditCommand * GetEditCommand()

After placing the window in the Edit Object Dialog ShowModal() method of the dialog is called.

static objects::CSeqdesc::E_Choice GetDescChoiceForType(EDescriptorType desc_type)

CDescPlacementPanel * m_Placement

CConstRef< CObject > m_Object

CRef< CSerialObject > m_EditedDescriptor

CIRef< IEditCommand > m_EditAction

static pair< EDescriptorType, string > GetDescriptorType(const objects::CSeqdesc &desc)

virtual wxWindow * CreateWindow(wxWindow *parent)

creates a child (not top level) windows that can contain whatever controls/subwindows etc.

wxCheckBox * m_ReplaceAll

CConstRef< CObject > m_Bioseq

void SetEditor(IDescEditorPanel *editor)

void ChangeBioseq(CConstRef< objects::CBioseq > bioseq)

void SetBioseqValues(CRef< objects::CBioseq > bioseq)

CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:

bool SameCitation(const CPub_equiv &other) const

void SetUser_object(CRef< objects::CUser_object > user)

CBioseq_Handle GetBioseq_Handle() const

void GetLabel(string *const label, ELabelType label_type) const

Base class for all serializable objects.

void SetUser_object(CRef< objects::CUser_object > user)

void SetUser_object(CRef< objects::CUser_object > user)

@ eObjectType_StructuredComment

EObjectType GetObjectType() const

Interface (functor) for object editing.

virtual void SetHelpUrl(const wxString &url)=0

static bool s_IsTpa(const CUser_object &user)

CRef< CCmdComposite > AddDescToSeqEntry(const CSeqdesc &desc, CSeq_entry_Handle seh, bool propagate)

static CRef< CCmdComposite > s_ReplaceAllMolinfo(CSeq_entry_Handle seh, const CSeqdesc &orig_desc, const CSeqdesc &edited_desc, const CBioseq &orig_bseq, const CBioseq &edited_bseq)

CRef< CCmdComposite > CreateMolInfoDesc(CSeq_entry_Handle seh, CRef< CSerialObject > obj, CMolInfoPanel *molPanel)

std::ofstream out("events_result.xml")

main entry point for tests

static DLIST_TYPE *DLIST_NAME() prev(DLIST_LIST_TYPE *list, DLIST_TYPE *item)

#define ITERATE(Type, Var, Cont)

ITERATE macro to sequence through container elements.

#define LOG_POST(message)

This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...

void Error(CExceptionArgs_Base &args)

#define NCBI_THROW(exception_class, err_code, message)

Generic macro to throw an exception, given the exception class, error code and message string.

const string & GetMsg(void) const

Get message string.

CConstRef< objects::CBioseq > GetBioseqForSeqdesc(CRef< objects::CScope > scope, const objects::CSeqdesc &seq_desc)

virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)

Set object to copy of another one.

virtual bool Equals(const CSerialObject &object, ESerialRecursionMode how=eRecursive) const

Check if both objects contain the same values.

@ eSerial_AsnText

ASN.1 text.

static CObjectOStream * Open(ESerialDataFormat format, CNcbiOstream &outStream, bool deleteOutStream)

Create serial object writer and attach it to an output stream.

bool IsSetInst_Strand(void) const

bool IsSetInst_Mol(void) const

CConstRef< CBioseq > GetCompleteBioseq(void) const

Get the complete bioseq.

TClass GetClass(void) const

TInst_Mol GetInst_Mol(void) const

CBioseq_set_Handle GetParentBioseq_set(void) const

Return a handle for the parent Bioseq-set, or null handle.

TInst_Strand GetInst_Strand(void) const

TInst_Topology GetInst_Topology(void) const

CSeq_entry_Handle GetTopLevelEntry(void) const

Get top level Seq-entry handle.

CSeq_entry_Handle GetParentEntry(void) const

Return a handle for the parent seq-entry of the bioseq.

bool IsSetClass(void) const

CScope & GetScope(void) const

Get scope this handle belongs to.

bool IsSetInst_Topology(void) const

CSeq_entry_Handle GetSeq_entry_Handle(void) const

@ fIncludeGivenEntry

Include the top (given) entry.

@ fRecursive

Iterate recursively.

TObjectType * GetPointer(void) const THROWS_NONE

Get pointer,.

CConstRef< C > ConstRef(const C *object)

Template function for conversion of const object pointer to CConstRef.

TObjectType * GetPointer(void) THROWS_NONE

Get pointer,.

void Reset(void)

Reset reference object.

void Reset(void)

Reset reference object.

TObjectType * GetPointerOrNull(void) const THROWS_NONE

Get pointer value.

bool IsNull(void) const THROWS_NONE

Check if pointer is null – same effect as Empty().

TObjectType & GetObject(void)

Get object.

TObjectType * GetPointerOrNull(void) THROWS_NONE

Get pointer value.

TObjectType * GetNonNullPointer(void) const

Get pointer value and throw a null pointer exception if pointer is null.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

static void TrimSuffixInPlace(string &str, const CTempString suffix, ECase use_case=eCase)

Trim suffix from a string (in-place)

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 void TrimPrefixInPlace(string &str, const CTempString prefix, ECase use_case=eCase)

Trim prefix from a string (in-place)

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[]

bool IsSetData(void) const

the object itself Check if a value has been assigned to Data data member.

bool IsStr(void) const

Check if variant Str is selected.

bool IsSetType(void) const

type of object within class Check if a value has been assigned to Type data member.

const TStr & GetStr(void) const

Get the variant data.

const TData & GetData(void) const

Get the Data member data.

const TType & GetType(void) const

Get the Type member data.

vector< CRef< CUser_field > > TData

@ eClass_nuc_prot

nuc acid and coded proteins

const TUser & GetUser(void) const

Get the variant data.

bool IsMolinfo(void) const

Check if variant Molinfo is selected.

TStrand GetStrand(void) const

Get the Strand member data.

const TInst & GetInst(void) const

Get the Inst member data.

TPub & SetPub(void)

Select the variant.

TTopology GetTopology(void) const

Get the Topology member data.

bool IsSetMol(void) const

Check if a value has been assigned to Mol data member.

const TTitle & GetTitle(void) const

Get the variant data.

const TPub & GetPub(void) const

Get the variant data.

bool IsSetStrand(void) const

Check if a value has been assigned to Strand data member.

bool IsSetInst(void) const

the sequence data Check if a value has been assigned to Inst data member.

TMol GetMol(void) const

Get the Mol member data.

void SetInst(TInst &value)

Assign a value to Inst data member.

E_Choice

Choice variants.

bool IsPub(void) const

Check if variant Pub is selected.

TUser & SetUser(void)

Select the variant.

E_Choice Which(void) const

Which variant is currently selected.

const TPub & GetPub(void) const

Get the Pub member data.

TMolinfo & SetMolinfo(void)

Select the variant.

bool IsSetTopology(void) const

Check if a value has been assigned to Topology data member.

bool IsUser(void) const

Check if variant User is selected.

@ e_User

user defined object

@ e_Pub

a reference to the publication

@ e_Comment

a more extensive comment

@ e_Region

overall region (globin locus)

@ e_Molinfo

info on the molecule and techniques

@ e_Title

a title for this sequence

@ e_not_set

No variant selected.

@ e_Name

a name for this sequence

@ e_Source

source of materials, includes Org-ref

@ eMol_na

just a nucleic acid

static void text(MDB_val *v)

constexpr auto sort(_Init &&init)

void TestForNonAsciiText(wxWindow *win)

string GetTextObjectDescription(const CSeq_feat &sf, CScope &scope)


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