(parent,
id, caption, pos,
size, style);
111 bool CFarPointerSeq::Create( wxWindow* parent, wxWindowID
id,
constwxString& caption,
constwxPoint& pos,
constwxSize&
size,
longstyle )
114SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
115wxDialog::Create( parent,
id, caption, pos,
size, style );
120GetSizer()->SetSizeHints(
this);
162wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxVERTICAL);
163itemDialog1->SetSizer(itemBoxSizer2);
167vector<bool> checked;
168wxArrayString choices;
172 for(
auto row= 0;
row< num_rows;
row++)
174 const CSeq_id&
id= align_it->GetSeq_id(
row);
177 bool check(
false);
178 booldisable(
false);
180 if(!disable && !
msg.empty())
182checked.push_back(
check);
185msgs.push_back(
msg);
186 if(
label.size() > label_max.size())
191wxGraphicsContext *gc = wxGraphicsContext::Create();
192gc->SetFont(GetFont(), *wxBLACK);
197choices.Add(wxString(
label+ msgs[
i]));
201 if(choices.IsEmpty())
206 for(
size_t i= 0;
i< checked.size();
i++)
210wxBoxSizer* itemBoxSizer10 =
newwxBoxSizer(wxHORIZONTAL);
211itemBoxSizer2->Add(itemBoxSizer10, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
213wxButton* itemButton11 =
newwxButton( itemDialog1, wxID_OK,
_(
"Replace Selected Sequences"), wxDefaultPosition, wxDefaultSize, 0 );
214itemBoxSizer10->Add(itemButton11, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
216wxButton* itemButton12 =
newwxButton( itemDialog1, wxID_CANCEL,
_(
"Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
217itemBoxSizer10->Add(itemButton12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
219wxButton* itemButton13 =
newwxButton( itemDialog1,
ID_FARPOINTERSEQ_EXPORT,
_(
"Export FarPointer Error Messages"), wxDefaultPosition, wxDefaultSize, 0 );
220itemBoxSizer10->Add(itemButton13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
230wxDouble externalLeading;
231gc->GetTextExtent(wxString(
str), &width, &height, &descent, &externalLeading);
232wxDouble space_width;
233gc->GetTextExtent(
_(
" "), &space_width, &height, &descent, &externalLeading);
235gc->GetTextExtent(wxString(label_max), &max_width, &height, &descent, &externalLeading);
236 if(max_width >= width)
238 intadd_spaces =
int((max_width - width) / space_width) + 1;
246 int i=
event.GetInt();
260 msg+=
i->first +
"\t"+
i->second +
"\n";
265report->SetTitle(
wxT(
"FarPointer Errors"));
279 if(!align_it->IsSetSegs() || !align_it->GetSegs().IsDenseg() ||
280!align_it->GetSegs().GetDenseg().IsSetIds())
284new_align->
Assign(align_it.GetOriginalSeq_align());
286 boolmodified(
false);
288 for(
size_tj = 0; j < checked.GetCount(); j++)
290 int i= checked.Item(j);
297 for(
auto row= 0;
row< num_rows;
row++)
299 const CSeq_id&
id= align_it->GetSeq_id(
row);
315new_align->
SetSegs().SetDenseg().SetIds()[
row]->Assign(*new_id);
323new_align->
SetSegs().SetDenseg().RemovePureGapSegs();
325new_align->
SetSegs().SetDenseg().Compact();
327 cmd->AddCommand(*chgAlign);
331 for(
size_tj = 0; j < checked.GetCount(); j++)
333 int i= checked.Item(j);
415 return "Not a far pointer";
417 stringorig_label(
label);
427 catch(
const CException&) {}
catch(
constexception&) {}
444 catch(
const CException&) {}
catch(
constexception&) {}
454 if(query_seqloc.
IsNull() || subject_seqloc.
IsNull())
460blast::SSeqLoc query_sl(*query_seqloc, scope);
461blast::SSeqLoc subject_sl(*subject_seqloc, scope);
463blast::CBlastNucleotideOptionsHandle& opts =
dynamic_cast<blast::CBlastNucleotideOptionsHandle&
>(bl2seq.SetOptionsHandle());
464opts.SetTraditionalMegablastDefaults();
466opts.SetMaskAtHash(
true);
467opts.SetDustFiltering(
true);
469opts.SetMismatchPenalty(-3);
472vector< CRef<objects::CSeq_align_set> > res = bl2seq.Run();
475 if(align && align->
IsSet() && !align->
Get().empty())
476 return(align->
Get().front());
484 return(
"No alignment found!");
490 intnum_rows = align->CheckNumRows();
500 boolflip_strand = (align->GetSeqStrand(0) != align->GetSeqStrand(1));
503 if(align->GetSeq_id(0).Match(*bsh1.
GetSeqId()))
505start1 = align->GetSeqStart(0);
506stop1 = align->GetSeqStop(0);
507start2 = align->GetSeqStart(1);
508stop2 = align->GetSeqStop(1);
510 else if(align->GetSeq_id(1).Match(*bsh1.
GetSeqId()))
512start1 = align->GetSeqStart(1);
513stop1 = align->GetSeqStop(1);
514start2 = align->GetSeqStart(0);
515stop2 = align->GetSeqStop(0);
528assem_len = stop1 - start1 + 1;
530assem_len = start1 - stop1 + 1;
536 for(
size_t i= 0;
i< seq1.size();
i++)
538 if(seq1[
i] ==
'N')
544 for(
int i= length - 1;
i>= 0;
i--)
546 if(seq1[
i] ==
'N')
552 for(
size_t i= 0;
i< seq1.size();
i++)
554 if(seq1[
i] ==
'N')
560 if(!align->IsSetSegs() || !align->GetSegs().IsDenseg() ||
561!align->GetSegs().GetDenseg().IsSetStarts() || !align->GetSegs().GetDenseg().IsSetLens())
568vector< TSignedSeqPos > starts(align->GetSegs().GetDenseg().GetStarts());
569vector< TSeqPos > lens(align->GetSegs().GetDenseg().GetLens());
570 size_tnum_segs = lens.size();
576 for(
size_tseg = 0; seg < num_segs; ++seg)
582 if(seg_start1 < 0 || seg_start2 < 0)
587 for(
size_t i= 0;
i<
len;
i++)
589 char a= seq1[
i+ seg_start1];
590 char b= seq2[
i+ seg_start2];
593 if(
a!=
'N'&&
b!=
'N')
602 tmp[
i+ seg_start1] =
'+';
606 intuncovered_non_n = 0;
607 for(
size_t i= 0;
i<
tmp.size();
i++)
609 if(
tmp[
i] ==
'+')
611 if(
tmp[
i] ==
'N')
617 if(gaps>0 || mismatches>0 ||
n> 0)
619 if(beg > 0 || end > 0)
621errors +=
"The local sequence has "+
NStr::ULongToString(beg + end) +
" terminal N"+ (beg+end > 1 ?
"s. ":
". ");
625errors +=
"The local sequence has "+
NStr::ULongToString(nctr) +
" internal N"+ (nctr > 1 ?
"s. ":
". ");
630 if(!errors.empty() && assem_len == length && gaps == 0 && mismatches == 0)
632errors +=
"There are no other differences between the local and database sequences.";
636 if((
TSeqPos)assem_len < length)
638errors +=
"The alignment to the database sequence does not cover all of the local sequence. ";
640 if(uncovered_n != 0 && uncovered_non_n == 0)
642errors +=
"The unaligned sequence consists only of Ns. ";
644 if(uncovered_non_n != 0)
646errors +=
"There are non-N residues in the unaligned sequence. ";
650 if(gaps > 0 || mismatches > 0 ||
n> 0)
652errors +=
"The alignment to the database sequence has "+
NStr::ULongToString(gaps) +
" gap"+ (gaps != 1 ?
"s, ":
", ")
Declares the CBl2Seq (BLAST 2 Sequences) class.
Declares the CBlastNucleotideOptionsHandle class.
Definitions of special type used in BLAST.
@ eMegablast
Nucl-Nucl (traditional megablast)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void AddSpaces(string &str, const string &label_max, wxGraphicsContext *gc)
map< CBioseq_Handle, int > m_offset
map< string, CBioseq_Handle > m_label_to_bsh1
void ReverseRow(CDense_seg &dense_seg, int offset, size_t row, CSeq_align::TDim num_rows)
string ValidateAlignment(CRef< objects::CSeq_align > align, CBioseq_Handle bsh1, CBioseq_Handle bsh2, bool &check)
string GetMessageForId(const CSeq_id &id, string label, bool &check, bool &disable)
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("Far Pointer Sequences"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
CRef< objects::CSeq_align > RunBlast(const CBioseq_Handle &sh, const CBioseq_Handle &qh)
vector< string > m_labels
map< CBioseq_Handle, bool > m_flip_strand
void OnCheck(wxCommandEvent &event)
CFarPointerSeq()
Constructors.
void OnExport(wxCommandEvent &event)
~CFarPointerSeq()
Destructor.
map< string, string > m_errors
map< string, CBioseq_Handle > m_label_to_bsh2
CRef< CCmdComposite > GetCommand()
static bool ShowToolTips()
Should we show tooltips?
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void CreateControls()
Creates the controls and sizers.
void Init()
Initialises member variables.
CSeq_entry_Handle m_TopSeqEntry
wxCheckListBox * m_CheckListBox
vector< bool > m_disabled
void SetText(const wxString &text)
void OffsetRow(TDim row, TSignedSeqPos offset)
Offset row's coords.
const_iterator begin() const
const_iterator end() const
#define ID_FARPOINTERSEQ_EXPORT
#define ID_FARPOINTERSEQ_CHECKLISTBOX
static const char * str(char *buf, int n)
unsigned int TSeqPos
Type for sequence locations and lengths.
int TSignedSeqPos
Type for signed sequence position.
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
CConstRef< CSeq_id > GetSeqId(void) const
@ fParse_Default
By default in ParseIDs and IsValid, allow raw parsable non-numeric accessions and plausible local acc...
@ 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
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
TClass GetClass(void) const
CBioseq_set_Handle GetParentBioseq_set(void) const
Return a handle for the parent Bioseq-set, or null handle.
TSeqPos GetBioseqLength(void) const
CConstRef< CSeq_id > GetSeqId(void) const
Get id which can be used to access this bioseq handle Throws an exception if none is available.
bool IsSetClass(void) const
CScope & GetScope(void) const
Get scope this handle belongs to.
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,...
bool IsNull(void) const THROWS_NONE
Check if pointer is null â same effect as Empty().
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static string ULongToString(unsigned long value, TNumToStringFlags flags=0, int base=10)
Convert unsigned long to string.
static void TrimPrefixInPlace(string &str, const CTempString prefix, ECase use_case=eCase)
Trim prefix from a string (in-place)
static const char label[]
bool IsSetStrands(void) const
Check if a value has been assigned to Strands data member.
const TStarts & GetStarts(void) const
Get the Starts member data.
void SetSegs(TSegs &value)
Assign a value to Segs data member.
const TLens & GetLens(void) const
Get the Lens member data.
TStarts & SetStarts(void)
Assign a value to Starts data member.
TStrands & SetStrands(void)
Assign a value to Strands data member.
bool IsSet(void) const
Check if a value has been assigned to data member.
const TStrands & GetStrands(void) const
Get the Strands member data.
const Tdata & Get(void) const
Get the member data.
@ eClass_nuc_prot
nuc acid and coded proteins
unsigned int
A callback function used to compare two keys in a database.
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)
Definition of SSeqLoc structure.
#define row(bind, expected)
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