(parent,
id, caption, pos,
size, style);
94 bool CMixedStrands::Create( wxWindow* parent, wxWindowID
id,
constwxString& caption,
constwxPoint& pos,
constwxSize&
size,
longstyle )
97SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
98wxDialog::Create( parent,
id, caption, pos,
size, style );
103GetSizer()->SetSizeHints(
this);
146wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxVERTICAL);
147itemDialog1->SetSizer(itemBoxSizer2);
149 m_Description=
newwxStaticText(itemDialog1, wxID_STATIC,
_(
"Checking for mixed strands within the set..."), wxDefaultPosition, wxDefaultSize, 0);
150itemBoxSizer2->Add(
m_Description, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5);
151 #if defined(__WXMSW__) 152 m_ColPane=
newwxGenericCollapsiblePane(itemDialog1,
ID_COLLAPSIBLEPANE,
_(
"Reverse them"), wxDefaultPosition, wxDefaultSize, wxCP_DEFAULT_STYLE);
154 m_ColPane=
newwxCollapsiblePane(itemDialog1,
ID_COLLAPSIBLEPANE,
_(
"Reverse them"), wxDefaultPosition, wxDefaultSize, wxCP_DEFAULT_STYLE);
156itemBoxSizer2->Add(
m_ColPane, 0, wxALIGN_LEFT | wxALL, 5);
159wxBoxSizer* itemBoxSizer5 =
newwxBoxSizer(wxVERTICAL);
160 m_ColPane->GetPane()->SetSizer(itemBoxSizer5);
162wxBoxSizer* itemBoxSizer6 =
newwxBoxSizer(wxHORIZONTAL);
163itemBoxSizer5->Add(itemBoxSizer6, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
165wxStaticText* itemStaticText7 =
newwxStaticText(
m_ColPane->GetPane(), wxID_STATIC,
_(
"Sequence with the correct strand"), wxDefaultPosition, wxDefaultSize, 0);
166itemBoxSizer6->Add(itemStaticText7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
168wxArrayString m_SequencesStrings;
170itemBoxSizer6->Add(
m_Sequences, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
176wxBoxSizer* itemBoxSizer10 =
newwxBoxSizer(wxHORIZONTAL);
177itemBoxSizer2->Add(itemBoxSizer10, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
179wxButton* itemButton11 =
newwxButton( itemDialog1, wxID_OK,
_(
"Accept"), wxDefaultPosition, wxDefaultSize, 0 );
180itemBoxSizer10->Add(itemButton11, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
181itemButton11->Enable(
false);
183wxButton* itemButton12 =
newwxButton( itemDialog1, wxID_CANCEL,
_(
"Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
184itemBoxSizer10->Add(itemButton12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
230 if(!seqaligns.empty()) {
232 if((*it)->IsSet()) {
258NucOptions->SetTraditionalMegablastDefaults();
259NucOptions->SetGapExtensionCost(5);
260NucOptions->SetGapOpeningCost(11);
261NucOptions->SetMismatchPenalty(-5);
262NucOptions->SetMatchReward(1);
263NucOptions->SetWordSize(12);
264NucOptions->SetWindowSize(150);
265NucOptions->SetDustFiltering(
true);
266NucOptions->SetEvalueThreshold(1e-6);
268blast::CBlastOptions& opts = Options->SetOptions();
269opts.SetBestHitOverhang(0.1);
270opts.SetBestHitScoreEdge(0.1);
271opts.SetHitlistSize(250);
272opts.SetMaskLevel(1);
279 if(align_vector.empty()) {
285 catch(
constblast::CBlastException& e) {
294 structSAlignJobInput
302 for(
auto&& it : align_vector) {
331 LOG_POST(
Info<<
"Start alignment construction... ");
333 boolmixed_strands =
false;
340 while(queryh && !mixed_strands) {
345mixed_strands = s_DoesAlignHaveMixedStrands(align_vector);
359 LOG_POST(
Info<<
"Finished generating pairwise alignments.");
361 const boolmixed_strands = jobResult->
GetData();
362 string msg(
"This set does not have sequences of mixed strands.");
364 msg.assign(
"This set has sequences of mixed strands.");
377 stringerr_msg =
"Failed: ";
378 if(!errMsg.empty()) {
382err_msg +=
"Unknown fatal error";
392SAlignJobInput
input;
396(
this,
input, s_FindMixedStrandAlignment,
"MixedStrandJob",
"Find mixed strand pairwise alignment within set"));
405 if(!
label.empty()) {
414 boolenable = (
m_Sequences->GetCurrentSelection() != -1) ?
true:
false;
415FindWindowById(wxID_OK)->Enable(enable);
422 intselected =
m_Sequences->GetCurrentSelection();
423 if(selected == -1 || selected >=
m_BshList.size()) {
431 unsigned intnum_reversed = 0,
count= 0;
433oss <<
"The following sequences were reversed:\n";
439 booltobe_reversed =
false;
441tobe_reversed = s_DoesAlignHaveMixedStrands(align_vector);
444new_inst->
Assign(b_iter->GetInst());
447 cmd->AddCommand(*cmd_inst);
453oss <<
label<<
"\n";
457 for(
CFeat_CIfeat_it(*b_iter); feat_it; ++feat_it) {
459new_feat->
Assign(*feat_it->GetOriginalSeq_feat());
462 cmd->AddCommand(*cmd_feat);
468 if(num_reversed > 0) {
469oss << num_reversed <<
" out of "<<
count<<
" sequences were reversed.";
482reportdlg->SetTitle(
"Reverse complement sequences log");
484reportdlg->Show(
true);
Declares the CBl2Seq (BLAST 2 Sequences) class.
Declares the CBlastNucleotideOptionsHandle class.
vector< CRef< objects::CSeq_align_set > > TSeqAlignVector
Vector of Seq-align-sets.
@ eBlastn
Nucl-Nucl (traditional blastn)
void SetText(const wxString &text)
void OnSequenceSelected(wxCommandEvent &event)
vector< objects::CBioseq_Handle > m_BshList
virtual void OnJobResult(CObject *result, CJobAdapter &adapter)
static TAlignVector s_Blast2NASeq(const objects::CBioseq_Handle &sh, const objects::CBioseq_Handle &qh)
Blasts two nucleotide sequences using the BLAST best hits algorithm.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
CMixedStrands()
Constructors.
wxStaticText * m_Description
static TAlignVector s_GetAlignVector(const blast::TSeqAlignVector &seqaligns)
bool Create(wxWindow *parent, wxWindowID id=ID_CMIXEDSTRANDS, const wxString &caption=_("Mixed Strands"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
virtual void OnJobFailed(const string &, CJobAdapter &adapter)
objects::CSeq_entry_Handle m_TopSeqEntry
vector< CConstRef< objects::CSeq_align > > TAlignVector
static bool ShowToolTips()
Should we show tooltips?
void Init()
Initialises member variables.
wxCheckBox * m_RevFeatChkbox
~CMixedStrands()
Destructor.
CRef< CCmdComposite > GetCommand()
void CreateControls()
Creates the controls and sizers.
CRef< CJobAdapter > m_JobAdapter
wxCollapsiblePane * m_ColPane
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
TDim CheckNumRows(void) const
Validatiors.
ENa_strand GetSeqStrand(TDim row) const
Get strand (the first one if segments have different strands).
namespace ncbi::objects::
Interface for testing cancellation request in a long lasting operation.
static SQLCHAR output[256]
void ReverseComplement(const BidirectionalIterator &first, const BidirectionalIterator &last)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
#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)
void Info(CExceptionArgs_Base &args)
void NcbiErrorBox(const string &message, const string &title="Error")
specialized Message Box function for reporting critical errors
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
void GetLabel(string *label, ELabelType type=eDefault, TLabelFlags flags=fLabel_Default) const
Append a label for this Seq-id to the supplied string.
CConstRef< CSeq_id > GetSeqId(void) const
@ eContent
Untagged human-readable accession or the like.
const CSeq_id & GetId(const CSeq_loc &loc, CScope *scope)
If all CSeq_ids embedded in CSeq_loc refer to the same CBioseq, returns the first CSeq_id found,...
@ eGetId_Best
return the "best" gi (uses FindBestScore(), with CSeq_id::CalculateScore() as the score function
CScope & GetScope(void) const
Get scope this handle belongs to.
CRef< CSeq_loc > GetRangeSeq_loc(TSeqPos start, TSeqPos stop, ENa_strand strand=eNa_strand_unknown) const
Return CSeq_loc referencing the given range and strand on the bioseq If start == 0,...
void Reset(void)
Reset reference object.
TObjectType * GetPointerOrNull(void) THROWS_NONE
Get pointer value.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
virtual bool IsCanceled(void) const =0
static const char label[]
list< CRef< CSeq_align > > Tdata
@ eMol_na
just a nucleic acid
void ReverseComplementFeature(CSeq_feat &feat, CScope &scope)
const struct ncbi::grid::netcache::search::fields::SIZE size
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
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