(parent,
id, caption, pos,
size, style);
100SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
106GetSizer()->SetSizeHints(
this);
152wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxVERTICAL);
153itemCBulkCmdDlg1->SetSizer(itemBoxSizer2);
155 m_MatchInterval=
newwxCheckBox( itemCBulkCmdDlg1,
ID_CHECKBOX10,
_(
"Set gene interval to match"), wxDefaultPosition, wxDefaultSize, 0 );
157itemBoxSizer2->Add(
m_MatchInterval, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
159 m_MatchStrand=
newwxCheckBox( itemCBulkCmdDlg1,
ID_CHECKBOX11,
_(
"Set gene strand to match"), wxDefaultPosition, wxDefaultSize, 0 );
161itemBoxSizer2->Add(
m_MatchStrand, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
163 m_Log=
newwxCheckBox( itemCBulkCmdDlg1,
ID_CHECKBOX12,
_(
"Log gene changes"), wxDefaultPosition, wxDefaultSize, 0 );
164 m_Log->SetValue(
false);
165itemBoxSizer2->Add(
m_Log, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
167wxArrayString m_FeatureChoiceStrings;
168m_FeatureChoiceStrings.Add(
_(
"&CDS"));
169m_FeatureChoiceStrings.Add(
_(
"&mRNA"));
170m_FeatureChoiceStrings.Add(
_(
"&ncRNA"));
171m_FeatureChoiceStrings.Add(
_(
"&rRNA"));
172m_FeatureChoiceStrings.Add(
_(
"&tRNA"));
173 m_FeatureChoice=
newwxRadioBox( itemCBulkCmdDlg1,
ID_RADIOBOX3, wxEmptyString, wxDefaultPosition, wxDefaultSize, m_FeatureChoiceStrings, 1, wxRA_SPECIFY_ROWS );
175itemBoxSizer2->Add(
m_FeatureChoice, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
177 m_OnlySelected=
newwxCheckBox( itemCBulkCmdDlg1,
ID_CHECKBOX13,
_(
"Correct only selected feature-gene pair"), wxDefaultPosition, wxDefaultSize, 0 );
179itemBoxSizer2->Add(
m_OnlySelected, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
183itemBoxSizer2->Add(
m_Constraint, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
186itemBoxSizer2->Add(
m_OkCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
236 stringreport_msg =
"";
245new_gene->
Assign(*list[0]);
253 if(
m_Log->GetValue()) {
254report_msg = this_msg;
261vector<CSeq_feat_Handle> feats;
281vector<CSeq_feat_Handle> &genes = feat_to_genes[fh];
282 for(
size_tii = 0; ii < genes.size(); ii++)
285new_gene->
Assign(*(genes[ii].GetOriginalSeq_feat()));
294 if(
m_Log->GetValue()) {
295report_msg += this_msg;
302report_msg +=
"No gene found for "+ cds_label +
"\n";
309report->SetTitle(
wxT(
"Gene Change Log"));
311report->Show(
true);
326 boolchanged =
false;
335 id->Assign(*cds.
GetId());
336interval->
SetInt().SetId(*
id);
361 boolchanged =
false;
386log_msg =
"Sequence "+ seq_label +
": "+gene_label+
" is a trans-spliced gene\n";
394log_msg =
"Sequence "+ seq_label +
":"+ gene_label +
" reset to ";
400log_msg +=
" interval ("+ cds_label +
")\n";
405log_msg +=
"Sequence "+ seq_label +
":"+ gene_label +
" strand set to match ";
411log_msg +=
" ("+ cds_label +
")\n";
421vector<CConstRef<CSeq_feat> > list;
426 m_Error=
"Can't find selection service!";
429sel_srv->GetActiveObjects(
objects);
435 m_Error=
"No objects selected!";
443 if(
f->GetData().IsGene()) {
445 m_Error=
"More than one gene feature is selected!";
452 m_Error=
"More than one non-gene feature is selected!";
460 if(!gene || !other) {
461 m_Error=
"Must select one gene and one other feature!";
464list.push_back(gene);
465list.push_back(other);
472vector<CConstRef<CSeq_feat> > constrained;
477 stringconstraint_field;
479 if(constraint_field_panel)
480constraint_field = constraint_field_panel->
GetFieldName();
483constraint_field = constraint_field_type;
486constraint_field =
"RNA "+ constraint_field;
506 if(
f&&
f->IsSetData() &&
f->GetData().GetSubtype() ==
match) {
508constrained.push_back(ref);
549 for(
const auto&feat : feats)
551 const CSeq_loc&loc = feat.GetLocation();
560 if(used_genes.
find(*gene) != used_genes.
end())
568feat_to_genes[feat].push_back(*gene);
569used_genes.
insert(*gene);
580 for(
const auto&feat : feats)
582 if(feat_to_genes.find(feat) != feat_to_genes.end())
584 const CSeq_loc&loc = feat.GetLocation();
593 if(used_genes.
find(*gene) != used_genes.
end())
603dist_to_feat_to_genes[diff][feat].push_back(*gene);
607 for(
const auto&it : dist_to_feat_to_genes)
609 for(
const auto&f_to_g : it.second)
612 if(feat_to_genes.find(feat) != feat_to_genes.end())
614 for(
const auto&gene : f_to_g.second)
616 if(used_genes.
find(gene) != used_genes.
end())
618feat_to_genes[feat].push_back(gene);
619used_genes.
insert(gene);
@ eExtreme_Positional
numerical value
@ eExtreme_Biological
5' and 3'
void GetLabel(string *label, ELabelType type, bool worst=false) const
objects::CSeq_entry_Handle m_TopSeqEntry
bool Create(wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_FRAME_STYLE, const wxString &name=wxFrameNameStr)
bool GetTopLevelSeqEntryAndProcessor()
void SetSelection(int page)
string GetFieldType(void) const
CFieldNamePanel * GetFieldNamePanel(void)
CRef< edit::CStringConstraint > GetStringConstraint(void)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxCheckBox * m_MatchStrand
void Init()
Initialises member variables.
bool Create(wxWindow *parent, wxWindowID id=10416, const wxString &caption=_("Correct Genes"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
CCorrectGenesDialog()
Constructors.
CConstraintPanel * m_Constraint
bool x_TestGeneForFeature(const CSeq_loc &gene_loc, const CSeq_loc &feat_loc, CScope &scope, bool same_strand, bool &exact, TSeqPos &diff)
vector< CConstRef< CSeq_feat > > x_GetConstrainedList()
string x_CorrectOnePair(const CSeq_feat &cds, CSeq_feat &gene, const string &seq_label, CScope &scope)
wxCheckBox * m_MatchInterval
bool x_CorrectPairStrand(const CSeq_loc &cds, CSeq_loc &gene)
wxCheckBox * m_OnlySelected
void x_FindNonExactMatches(const vector< CSeq_feat_Handle > &feats, CScope &scope, bool same_strand, map< CSeq_feat_Handle, vector< CSeq_feat_Handle > > &feat_to_genes, set< CSeq_feat_Handle > &used_genes)
static bool ShowToolTips()
Should we show tooltips?
void CreateControls()
Creates the controls and sizers.
bool x_CorrectPairInterval(const CSeq_loc &cds, CSeq_feat &gene, CScope *scope)
virtual CRef< CCmdComposite > GetCommand()
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
vector< CConstRef< CSeq_feat > > x_GetSelectedPair()
COkCancelPanel * m_OkCancel
~CCorrectGenesDialog()
Destructor.
virtual string GetErrorMessage()
void x_FindExactMatches(const vector< CSeq_feat_Handle > &feats, CScope &scope, bool same_strand, map< CSeq_feat_Handle, vector< CSeq_feat_Handle > > &feat_to_genes, set< CSeq_feat_Handle > &used_genes)
wxRadioBox * m_FeatureChoice
virtual string GetFieldName(const bool subfield=false)=0
Returns the name of the field as selected in the panel.
void SetText(const wxString &text)
void SetConstraint(string field, CRef< objects::edit::CStringConstraint > string_constraint)
vector< CConstRef< CObject > > GetObjects(objects::CBioseq_Handle bsh)
namespace ncbi::objects::
IWorkbench is the central interface in the application framework.
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
USING_SCOPE(ncbi::objects)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
CIRef< T > GetServiceByType()
retrieves a typed reference to a service, the name of C++ type is used as the name of the service.
vector< SConstScopedObject > TConstScopedObjects
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
bool IsPartialStart(ESeqLocExtremes ext) const
check start or stop of location for e_Lim fuzz
ENa_strand GetStrand(void) const
Get the location's strand.
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
const CSeq_id * GetId(void) const
Get the id of the location return NULL if has multiple ids or no id at all.
void ResetStrand(void)
Reset the strand on this location.
void SetPartialStart(bool val, ESeqLocExtremes ext)
set / remove e_Lim fuzz on start or stop (lt/gt - indicating partial interval)
void SetStrand(ENa_strand strand)
Set the strand for all of the location's ranges.
void SetPartialStop(bool val, ESeqLocExtremes ext)
bool IsPartialStop(ESeqLocExtremes ext) const
TSeqPos GetStop(ESeqLocExtremes ext) const
sequence::ECompare Compare(const CSeq_loc &loc1, const CSeq_loc &loc2, CScope *scope)
Returns the sequence::ECompare containment relationship between CSeq_locs.
TSeqPos GetCoverage(const CSeq_loc &loc, CScope *scope)
Get number of unique bases in the location.
CRef< CSeq_loc > Seq_loc_Subtract(const CSeq_loc &loc1, const CSeq_loc &loc2, CSeq_loc::TOpFlags flags, CScope *scope)
Subtract the second seq-loc from the first one.
CRef< CSeq_loc > Seq_loc_Add(const CSeq_loc &loc1, const CSeq_loc &loc2, CSeq_loc::TOpFlags flags, CScope *scope)
Add two seq-locs.
@ eContains
First CSeq_loc contains second.
@ eOverlap
CSeq_locs overlap.
@ eSame
CSeq_locs contain each other.
@ eContained
First CSeq_loc contained by second.
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)
CConstRef< CBioseq > GetCompleteBioseq(void) const
Get the complete bioseq.
void Reset(void)
Reset reference object.
#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 SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)
Find the pattern in the string.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
void ResetPartial(void)
Reset Partial data member.
void SetLocation(TLocation &value)
Assign a value to Location data member.
bool IsCdregion(void) const
Check if variant Cdregion is selected.
void SetPartial(TPartial value)
Assign a value to Partial data member.
const TLocation & GetLocation(void) const
Get the Location member data.
const TData & GetData(void) const
Get the Data member data.
bool IsSetExcept(void) const
something funny about this? Check if a value has been assigned to Except data member.
const TExcept_text & GetExcept_text(void) const
Get the Except_text member data.
bool IsSetExcept_text(void) const
explain if except=TRUE Check if a value has been assigned to Except_text data member.
TExcept GetExcept(void) const
Get the Except member data.
ENa_strand
strand of nucleic acid
void GetViewObjects(IWorkbench *workbench, TConstScopedObjects &objects)
const struct ncbi::grid::netcache::search::fields::SIZE size
static int match(PCRE2_SPTR start_eptr, PCRE2_SPTR start_ecode, uint16_t top_bracket, PCRE2_SIZE frame_size, pcre2_match_data *match_data, match_block *mb)
string GetTextObjectDescription(const CSeq_feat &sf, CScope &scope)
wxString ToWxString(const string &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