56 #include <wx/stattext.h>
57 #include <wx/msgdlg.h>
109 SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
115 GetSizer()->SetSizeHints(
this);
149 opt->SetBool()->SetVal(
true);
164 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
165 itemCBulkCmdDlg1->SetSizer(itemBoxSizer2);
167 m_RadioButton =
new wxRadioButton( itemCBulkCmdDlg1,
wxID_ANY,
_(
"Convert only when internal gap covers 50% or more of the coding region"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP );
171 wxRadioButton* itemRadioButton9 =
new wxRadioButton( itemCBulkCmdDlg1,
wxID_ANY,
_(
"Convert all coding regions with gaps (both terminal and internal)"));
172 itemRadioButton9->SetValue(
false);
173 itemBoxSizer2->Add(itemRadioButton9, 0, wxALIGN_LEFT|wxALL, 5);
175 wxStaticText* itemStaticText1 =
new wxStaticText( itemCBulkCmdDlg1, wxID_STATIC,
_(
"Where feature text"), wxDefaultPosition, wxDefaultSize, 0 );
176 itemBoxSizer2->Add(itemStaticText1, 0, wxALIGN_LEFT|wxALL, 5);
182 itemBoxSizer2->Add(
m_OkCancel, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
231 bool any_change =
false;
232 bool any_present =
false;
236 objects::CSeq_feat_Handle fh = feat_it->GetSeq_feat_Handle();
237 const objects::CSeq_loc& feat_loc = feat_it->GetLocation();
242 objects::CSeqMap_CI seq_map_ci = seq_map->ResolvedRangeIterator(&
m_TopSeqEntry.GetScope(),
245 feat_loc.GetStrand(),
247 objects::CSeqMap::fFindGap);
250 bool gap_present(
false);
251 for (; seq_map_ci; ++seq_map_ci)
253 if (seq_map_ci.GetType() == objects::CSeqMap::eSeqGap)
260 bool match_constraint(
true);
261 if (string_constraint)
266 match_constraint = string_constraint->DoesTextMatch(
str);
269 bool too_many_x(
true);
275 if (gap_present && match_constraint && too_many_x)
280 cmd->AddCommand(*subcmd);
291 else if (!any_change)
311 CScope &scope = seh.GetScope();
320 opt->SetBool()->SetVal(
true);
322 for (objects::CFeat_CI feat_it(seh); feat_it; ++feat_it)
324 objects::CSeq_feat_Handle fh = feat_it->GetSeq_feat_Handle();
328 const CSeq_feat &feat = *fh.GetOriginalSeq_feat();
337 if (cds_validation ||
346 cmd->AddCommand(*subcmd);
358 if (disc_short_rrna || disc_rna_cds_overlap)
377 if (modified == 0 || modified * 2 > total)
380 if (modified * 2 > total)
381 wxMessageBox(
_(
"More than 50% of coding regions and RNA features are bad"),
wxT(
"Info"), wxOK | wxICON_INFORMATION);
386 report->SetTitle(
wxT(
"Feature Conversions"));
409 if ((*it)->IsLiteral()) {
410 offset += (*it)->GetLiteral().GetLength();
411 if (!(*it)->GetLiteral().IsSetSeq_data()) {
413 }
else if ((*it)->GetLiteral().GetSeq_data().IsGap()) {
416 }
else if ((*it)->IsLoc()) {
423 if (left - last_gap_stop < 3) {
425 extend_len = left - last_gap_stop;
437 extend_len = seq.
GetLength() - right - 1;
445 if ((*it)->IsLiteral()) {
446 if (!(*it)->GetLiteral().IsSetSeq_data()) {
448 }
else if ((*it)->GetLiteral().GetSeq_data().IsGap()) {
451 offset += (*it)->GetLiteral().GetLength();
452 }
else if ((*it)->IsLoc()) {
459 if (next_gap_start > right && next_gap_start - right < 3) {
461 extend_len = next_gap_start - right;
500 const CBioSource &biosource = source_ci->GetSource();
524 {
"16S", { 1000,
false } },
525 {
"18S", { 1000,
false } },
526 {
"23S", { 2000,
false } },
527 {
"25S", { 1000,
false } },
528 {
"26S", { 1000,
false } },
529 {
"28S", { 1000,
false } },
530 {
"28S", { 3300,
false } },
531 {
"small", { 1000,
false } },
532 {
"large", { 1000,
false } },
533 {
"5.8S", { 130,
true } },
534 {
"5S", { 90,
true } }
548 string rrna_name =
f.GetData().GetRna().GetRnaProductName();
552 len < it->second.first &&
553 (!it->second.second || (
f.IsSetPartial() &&
f.GetPartial())) ) {
575 bool is_eukaryotic =
false;
578 const CBioSource &biosource = source_ci->GetSource();
585 is_eukaryotic =
true;;
591 objects::CSeq_feat_Handle fh = feat_it->GetSeq_feat_Handle();
593 const CSeq_loc& loc_i = fh.GetLocation();
610 string rrna_name = fh.GetData().GetRna().GetRnaProductName();
614 if (
NStr::FindNoCase(rrna_name, it->first) != string::npos && len < it->second.first && (!it->second.second || (fh.IsSetPartial() && fh.GetPartial())) )
689 bool is_eukaryotic =
false;
692 const CBioSource &biosource = source_ci->GetSource();
699 is_eukaryotic =
true;;
721 string rrna_name =
rna.GetData().GetRna().GetRnaProductName();
725 if (
NStr::FindNoCase(rrna_name, it->first) != string::npos && len < it->second.first && (!it->second.second || (
rna.IsSetPartial() &&
rna.GetPartial())) )
740 objects::CSeq_feat_Handle fh = feat_it->GetSeq_feat_Handle();
742 const CSeq_loc& loc_j = fh.GetLocation();
User-defined methods of the data storage class.
User-defined methods of the data storage class.
@ eExtreme_Positional
numerical value
User-defined methods of the data storage class.
const string & GetLineage(void) const
bool IsSetLineage(void) const
TSeqPos GetLength(void) 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)
static bool IsExtendableRight(TSeqPos right, const CBioseq &seq, CScope *scope, TSeqPos &extend_len)
static bool IsNonExtendable(const CSeq_loc &loc, const CBioseq &seq, CScope *scope)
static bool getRnaOverlap(const CSeq_feat &rna, CBioseq_Handle bsh)
static bool IsShortrRNA(const CSeq_feat &f, CScope *scope)
static CRef< CCmdComposite > apply(wxWindow *parent, objects::CSeq_entry_Handle seh)
static bool getBacterialPartialNonextendable(const CSeq_feat &feat, CBioseq_Handle bsh)
static bool getShortRRNA(const CSeq_feat &feat, CScope &scope)
static bool getCdsRnaOverlap(const CSeq_feat &feat, CBioseq_Handle bsh)
static bool getCdsOverlap(const CSeq_feat &cds, CBioseq_Handle bsh)
static bool IsExtendableLeft(TSeqPos left, const CBioseq &seq, CScope *scope, TSeqPos &extend_len)
virtual CRef< CCmdComposite > Convert(const objects::CSeq_feat &orig, bool keep_orig, objects::CScope &scope)
~CConvertCdsWithGapsToMiscFeat()
Destructor.
CStringConstraintPanel * m_StringConstraintPanel
COkCancelPanel * m_OkCancel
static bool ShowToolTips()
Should we show tooltips?
void Init()
Initialises member variables.
CRef< CConvertCDSToMiscFeat > m_Converter
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
wxRadioButton * m_RadioButton
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("Convert Coding Regions With Gaps to Misc Features"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
void CreateControls()
Creates the controls and sizers.
virtual string GetErrorMessage()
CConvertCdsWithGapsToMiscFeat()
Constructors.
virtual CRef< CCmdComposite > GetCommand()
CRef< CConversionOption > FindRemoveTranscriptId()
CFlatFileConfig & SetNeverTranslateCDS(bool val=true)
static string GetSeqFeatText(const CMappedFeat &feat, CScope &scope, const CFlatFileConfig &cfg, CRef< feature::CFeatTree > ftree=null)
void SetText(const wxString &text)
namespace ncbi::objects::
static bool TooManyXs(objects::CSeq_feat_Handle fh)
CRef< edit::CStringConstraint > GetStringConstraint()
IWorkbench is the central interface in the application framework.
map< const char *, TRNALength > TRNALengthMap
static const TRNALengthMap kTrnaLengthMap
pair< size_t, bool > TRNALength
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
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.
TRange GetTotalRange(void) const
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
bool IsPartialStop(ESeqLocExtremes ext) const
TSeqPos GetStop(ESeqLocExtremes ext) const
CMappedFeat GetBestGeneForCds(const CMappedFeat &cds_feat, CFeatTree *feat_tree=0, const SAnnotSelector *base_sel=0, CFeatTree::EBestGeneType lookup_type=CFeatTree::eBestGene_TreeOnly)
TSeqPos GetLength(const CSeq_id &id, CScope *scope)
Get sequence length if scope not null, else return max possible TSeqPos.
sequence::ECompare Compare(const CSeq_loc &loc1, const CSeq_loc &loc2, CScope *scope)
Returns the sequence::ECompare containment relationship between CSeq_locs.
CRef< CSeq_loc > Seq_loc_Merge(const CSeq_loc &loc, CSeq_loc::TOpFlags flags, CScope *scope)
Merge ranges in the seq-loc.
@ fCompareOverlapping
Check if seq-locs are overlapping.
@ eContains
First CSeq_loc contains second.
@ eSame
CSeq_locs contain each other.
@ eContained
First CSeq_loc contained by second.
@ eNoOverlap
CSeq_locs do not overlap or abut.
CConstRef< CSeq_feat > GetOverlappingGene(const CSeq_loc &loc, CScope &scope, ETransSplicing eTransSplicing=eTransSplicing_Auto)
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)
TBioseqCore GetBioseqCore(void) const
Get bioseq core structure.
CScope & GetScope(void) const
Get scope this handle belongs to.
const CSeq_feat_Handle & GetSeq_feat_Handle(void) const
Get original feature handle.
void Reset(void)
Reset reference object.
position_type GetToOpen(void) const
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static SIZE_TYPE FindNoCase(const CTempString str, const CTempString pattern, SIZE_TYPE start, SIZE_TYPE end, EOccurrence which=eFirst)
Find the pattern in the specified range of a string using a case insensitive search.
TGenome GetGenome(void) const
Get the Genome member data.
EGenome
biological context
TFrom GetFrom(void) const
Get the From member data.
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
bool IsCdregion(void) const
Check if variant Cdregion is selected.
bool IsSetPartial(void) const
incomplete in some way? Check if a value has been assigned to Partial data member.
const TLocation & GetLocation(void) const
Get the Location member data.
const TData & GetData(void) const
Get the Data member data.
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.
bool IsRna(void) const
Check if variant Rna is selected.
ENa_strand
strand of nucleic acid
TRepr GetRepr(void) const
Get the Repr member data.
const TInst & GetInst(void) const
Get the Inst member data.
bool IsSetRepr(void) const
Check if a value has been assigned to Repr data member.
bool IsSetExt(void) const
extensions for special types Check if a value has been assigned to Ext data member.
bool IsSetInst(void) const
the sequence data Check if a value has been assigned to Inst data member.
bool IsDelta(void) const
Check if variant Delta is selected.
const TExt & GetExt(void) const
Get the Ext member data.
const TDelta & GetDelta(void) const
Get the variant data.
const Tdata & Get(void) const
Get the member data.
list< CRef< CDelta_seq > > Tdata
@ eRepr_delta
sequence made by changes (delta) to others
@ e_Source
source of materials, includes Org-ref
const struct ncbi::grid::netcache::search::fields::SIZE size
double f(double x_, const double &y_)
static const char * str(char *buf, int n)
string GetTextObjectDescription(const CSeq_feat &sf, CScope &scope)