);
122wxTopLevelWindow* gui_widget =
dynamic_cast<wxTopLevelWindow*
>(parent);
137 if(
m_SEH.IsSeq()) {
138orig_bioseq =
m_SEH.GetSeq().GetCompleteBioseq();
145new_bioseq->
Assign(*bioseq);
150 CSeqdesc& edited_seq_desc =
dynamic_cast<CSeqdesc&
>(*m_EditedDescriptor);
156wxBoxSizer* holder_sizer = 0;
161holder_sizer =
newwxBoxSizer(wxHORIZONTAL);
162holder->SetSizer(holder_sizer);
165holder_sizer->Add(
m_Placement, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
172holder_sizer =
newwxBoxSizer(wxVERTICAL);
173parent->SetSizer(holder_sizer);
175 boolreplace_all =
false;
177 switch(desc_type.first) {
182gui_widget->SetTitle(
_(
"Comment"));
190gui_widget->SetTitle(
_(
"Title"));
197gui_widget->SetTitle(
_(
"Name"));
204gui_widget->SetTitle(
_(
"Region"));
212gui_widget->SetTitle(
_(
"Publication"));
214help_client->
SetHelpUrl(
_(
"https://www.ncbi.nlm.nih.gov/tools/gbench/manual13/"));
223 CBioseq& edited_bioseq =
dynamic_cast<CBioseq&
>(*m_EditedBioseq);
224bioseq = &(edited_bioseq);
228gui_widget->SetTitle(
_(
"MolInfo"));
240gui_widget->SetTitle(
_(
"TPA"));
245 if(desc_type.second ==
"##Assembly-Data-START##")
250gui_widget->SetTitle(
_(
"Sequencing Technology"));
257gui_widget->SetTitle(
_(
"Structured Comment"));
262 if(desc_type.second ==
"##Genome-Assembly-Data-START##")
263help_client->
SetHelpUrl(
_(
"https://www.ncbi.nlm.nih.gov/tools/gbench/manual12/#assembly-comment"));
273gui_widget->SetTitle(
_(
"RefGene"));
282gui_widget->SetTitle(
_(
"DBLink"));
292gui_widget->SetTitle(
_(
"Unverified"));
301gui_widget->SetTitle(
_(
"Unreviewed"));
310gui_widget->SetTitle(
_(
"Authorized access"));
319parent->SetMinSize(wxSize(810, 650));
321gui_widget->SetTitle(
_(
"BioSource"));
331 edit->ChangeSeqdesc(edited_seq_desc);
338holder_sizer->Add(
m_Window, 1, wxGROW|wxALL, 5);
342 m_ReplaceAll=
newwxCheckBox( parent,
wxID_ANY,
_(
"Replace All"), wxDefaultPosition, wxDefaultSize, 0 );
344holder_sizer->Add(
m_ReplaceAll, 0, wxALIGN_BOTTOM|wxALL, 0);
348holder_sizer->Add(
m_Window, 1, wxGROW|wxALL, 0);
355 m_ReplaceAll=
newwxCheckBox( parent,
wxID_ANY,
_(
"Replace All"), wxDefaultPosition, wxDefaultSize, 0 );
357holder_sizer->Add(
m_ReplaceAll, 0, wxALIGN_RIGHT|wxALL, 0);
366 voidConsolidateObjectList(vector<SeqdescEntryPair>& obj_list)
368 if(obj_list.size() < 2) {
371vector<SeqdescEntryPair>::iterator it = obj_list.begin();
372vector<SeqdescEntryPair>::iterator
prev= it;
374 while(
prev!= obj_list.end()) {
377 while(it != obj_list.end()) {
378 if(it->first.GetPointer() ==
prev->first.GetPointer()) {
379it = obj_list.erase(it);
391vector<SeqdescEntryPair>
objects;
393 for(
CSeqdesc_CIdesc_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(), [](
constSeqdescEntryPair&
a,
constSeqdescEntryPair&
b) { return a.first < b.first; });
399ConsolidateObjectList(
objects);
409 if(seh.
IsSet() && propagate) {
420 cmd->AddCommand(*subcmd);
426 cmd->AddCommand(*subcmd);
454 cmd->AddCommand(*chgd_cmd);
462 cmd->AddCommand(*subcmd);
469new_bioseq->
Assign(*bioseq);
472 cmd->AddCommand(*chgInst);
479 if(!entry_it->IsSet())
485 cmd->AddCommand(*cmdDelDesc);
489 if(num_nuc > 1 && num_desc != 0)
492prompt <<
"There are "<< num_desc <<
" molinfo descriptors on "<< num_nuc <<
" bioseqs.\n They will be overwritten.\n Procced?";
493 intchoice = wxMessageBox(prompt,
_(
"Warning"), wxYES_NO | wxICON_WARNING,
NULL);
511 const auto& orig_inst = orig_bseq.
GetInst();
512 for(
CBioseq_CIb_iter(seh); b_iter; ++b_iter) {
523 boolsame_inst = same_mol && same_strand && same_topology;
527 boolupdated =
false;
529 if(desc_it->Equals(orig_desc)) {
531replacement->
Assign(edited_desc);
533 cmd->AddCommand(*chgd_cmd);
541new_bioseq->
Assign(*bioseq);
547new_bioseq->
SetInst().ResetTopology();
553new_bioseq->
SetInst().ResetStrand();
559new_bioseq->
SetInst().ResetMol();
563 cmd->AddCommand(*chgInst);
577 m_Window->TransferDataFromWindow();
590 if(specific && specific.
IsSeq()) {
596new_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 boolpropagate =
false;
673 intchoice = 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) {
693replacement->
Assign(edited_seq_desc);
707vector<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)) {
715replacement->
Assign(edited_seq_desc);
729 while(&*desc_it != original) {
738*
out<< edited_seq_desc;
755*
out<< edited_seq_desc;
766 const CSeqdesc* seqdesc(
nullptr);
773bioseq = b_iter->GetCompleteBioseq();
780 edit->ChangeSeqdesc(*seqdesc);
787new_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 intchoice = 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);
848gui_widget->SetFocus();
850 if(choice == wxYES) {
851 edit->ChangeSeqdesc(*di);
859 if(
m_SEH.IsSeq()) {
865new_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()) {
978sval = (*it)->GetData().GetStr();
1008 returnmake_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