38 #include <wx/button.h>
39 #include <wx/textctrl.h>
40 #include <wx/msgdlg.h>
42 #include <wx/stattext.h>
43 #include <wx/radiobox.h>
90 wxMessageDialog msgdlg(
NULL, message,
_(
"Debug") );
154 m_pParentWindow =
NULL;
161 wxWindowID
id,
const wxPoint& pos,
const wxSize&
size,
long style )
162 : m_TopSeqEntry(seh),
163 m_CmdProcessor(cmdProcessor),
164 m_pParentWindow(parent)
176 wxWindowID
id,
const wxPoint& pos,
const wxSize&
size,
long style )
179 wxPanel::Create( parent,
id, pos,
size, style );
185 GetSizer()->SetSizeHints(
this);
225 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
226 itemPanel1->SetSizer(itemBoxSizer2);
231 wxBoxSizer* sizerLabels =
new wxBoxSizer(wxHORIZONTAL);
232 wxStaticText* matches =
233 new wxStaticText(
this,
wxID_ANY,
_(
"Sequences with Vector Match" ),
234 wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE_VERTICAL );
235 wxStaticText* locations =
236 new wxStaticText(
this,
wxID_ANY,
_(
"Location of Vector Match" ),
237 wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE_VERTICAL );
238 sizerLabels->Add(matches, 1, wxEXPAND|wxALL, 5);
239 sizerLabels->Add(locations, 1, wxEXPAND|wxALL, 5);
240 itemBoxSizer2->Add(sizerLabels, 0, wxEXPAND|wxALL, 5);
245 wxLC_REPORT | wxLC_SINGLE_SEL );
251 dwStyle |= LVS_EX_FULLROWSELECT;
252 ::SendMessage((
HWND)
m_listMatches->GetHandle(), LVM_SETEXTENDEDLISTVIEWSTYLE, 0, dwStyle);
265 wxLC_REPORT | wxLC_SINGLE_SEL );
277 wxBoxSizer* sizerSearchVector =
new wxBoxSizer(wxHORIZONTAL);
283 itemBoxSizer2->Add(sizerSearchVector, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
286 wxBoxSizer* sizerFindText =
new wxBoxSizer(wxHORIZONTAL);
287 wxStaticText* findtext =
288 new wxStaticText(
this,
wxID_ANY,
_(
"Find Text" ), wxDefaultPosition, wxDefaultSize, wxALIGN_CENTRE_HORIZONTAL );
289 sizerFindText->Add(findtext, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
291 sizerFindText->Add(
m_textFind, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
296 itemBoxSizer2->Add(sizerFindText, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
299 wxArrayString buttons;
300 buttons.Add(
_(
"Internal, 5', 3'"));
301 buttons.Add(
_(
"Strength"));
302 buttons.Add(
_(
"Marked"));
303 buttons.Add(
_(
"Accession"));
305 buttons, 0, wxRA_SPECIFY_COLS );
306 itemBoxSizer2->Add(
m_radioBoxSort, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
309 wxArrayString buttons2;
310 buttons2.Add(
_(
"Trim to closest end"));
311 buttons2.Add(
_(
"Trim to 5' end"));
312 buttons2.Add(
_(
"Trim to 3' end"));
314 _(
"Internal Trim Options"),
315 wxDefaultPosition, wxDefaultSize,
316 buttons2, 0, wxRA_SPECIFY_COLS );
320 wxBoxSizer* sizerSelectResults =
new wxBoxSizer(wxHORIZONTAL);
331 itemBoxSizer2->Add(sizerSelectResults, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
333 m_CitSub =
new wxCheckBox(
this,
wxID_ANY,
_(
"Add CitSub Update to trimmed sequences"), wxDefaultPosition, wxDefaultSize, 0 );
335 itemBoxSizer2->Add(
m_CitSub, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
338 wxBoxSizer* sizerTrimSelected =
new wxBoxSizer(wxHORIZONTAL);
345 sizerTrimSelected->Add(
m_buttonDismiss, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
346 itemBoxSizer2->Add(sizerTrimSelected, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
352 if (!wxPanel::TransferDataToWindow())
362 if (!wxPanel::TransferDataFromWindow())
473 vecscreenReport->Show();
554 const TCuts& sorted_cuts)
570 for (
const auto& cut : sorted_cuts) {
571 if (cut.m_range.GetTo() == right_pos) {
572 right_pos = cut.m_range.GetFrom() - 1;
575 if (cut.m_range.GetFrom() == left_pos) {
576 left_pos = cut.m_range.GetTo() + 1;
584 1 + (right_pos - left_pos));
585 for (; seqmap_ci; ++seqmap_ci) {
596 if (pOriginalGapSeqLiteral) {
597 pNewGapLiteral->Assign(*pOriginalGapSeqLiteral);
599 if (!bIsLengthKnown) {
602 pNewGapLiteral->SetLength(uGapLength);
603 pDeltaSeq->SetLiteral(*pNewGapLiteral);
618 pDeltaSeq->SetLiteral().SetLength(seqmap_ci.
GetLength());
619 pDeltaSeq->SetLiteral().SetSeq_data(*pSeqData);
633 inst->
SetLength(1 + (right_pos - left_pos));
634 if (pDeltaExt->
Set().size() == 1) {
638 CSeq_data & seq_data = pDeltaSeq->SetLiteral().SetSeq_data();
643 inst->
SetExt().SetDelta(*pDeltaExt);
665 TSeqPos cut_size = cut_to - cut_from + 1;
668 if (feat_to < cut_from)
675 if (feat_from >= cut_from && feat_to <= cut_to)
683 if (feat_from > cut_to)
686 feat_from -= cut_size;
689 interval->
SetTo(feat_to);
704 if (feat_to > cut_to) {
710 feat_to = cut_from - 1;
714 if (feat_from >= cut_from) {
715 feat_from = cut_to + 1;
716 feat_from -= cut_size;
720 interval->
SetTo(feat_to);
741 bCompleteCut, bTrimmed);
751 if (intervals->CanGet()) {
753 CPacked_seqint::Tdata::iterator it;
754 for (it = intervals->Set().begin();
755 it != intervals->Set().end(); )
761 if (it == intervals->Set().begin()) {
765 bool bDeleted =
false;
771 it = intervals->Set().erase(it);
775 bCompleteCut =
false;
789 mix->Assign(loc->
GetMix());
792 CSeq_loc_mix::Tdata::iterator it;
793 for (it = mix->Set().begin();
794 it != mix->Set().end(); )
800 if (it == mix->Set().begin()) {
804 bool bDeleted =
false;
809 it = mix->Set().erase(it);
813 bCompleteCut =
false;
833 const TCuts& sorted_cuts,
835 bool& bFeatureDeleted,
836 bool& bFeatureTrimmed,
840 for (
int ii = 0; ii < sorted_cuts.size(); ++ii)
852 bFeatureDeleted, bFeatureTrimmed);
857 if (bFeatureDeleted) {
867 x_SeqLocDelete(new_product, from, to, seqid, bProdDeleted, bProdTrimmed);
879 for (
int ii = 0; ii < cuts.size(); ++ii)
886 if (from != 0 && to != seq_length-1) {
889 if (from - 0 < seq_length-1 - to) {
916 for (it = sorted_cuts.begin(); it != sorted_cuts.end(); )
923 if ( it+1 != sorted_cuts.end() ) {
928 if ( next_from <= (to + 1) ) {
932 sorted_cuts.erase(it+1);
989 if ( !new_protein_bioseq ) {
1000 CFeat_CI prot_feat_ci(prot_bsh, sel);
1001 for ( ; prot_feat_ci; ++prot_feat_ci ) {
1014 command->AddCommand(*chgFeat);
1026 for (seg = 0; seg < denseg.
GetNumseg(); ++seg) {
1030 if (pos >= start && pos < start +
len) {
1060 if (pos == seg_start) {
1107 TSeqPos first_len, second_len;
1111 first_len = pos - seg_start;
1112 second_len = denseg.
GetLens()[foundseg] - first_len;
1115 second_len = pos - seg_start;
1116 first_len = denseg.
GetLens()[foundseg] - second_len;
1137 new_denseg->
SetLens().push_back(first_len);
1155 new_denseg->
SetLens().push_back(second_len);
1181 align->
SetSegs().SetDenseg(*new_denseg);
1187 const TCuts& sorted_cuts)
1189 for (
int ii = 0; ii < sorted_cuts.size(); ++ii)
1195 TSeqPos cut_len = cut_to - cut_from + 1;
1196 if (cut_to < cut_from) {
1197 cut_len = cut_from - cut_to + 1;
1213 if (seg_start < 0) {
1216 else if (seg_start < cut_from) {
1219 else if (seg_start >= cut_from &&
1220 seg_start + denseg.
GetLens()[curseg] <= cut_from + cut_len) {
1222 align->
SetSegs().SetDenseg().SetStarts()[index] = -1;
1226 align->
SetSegs().SetDenseg().SetStarts()[index] -= cut_len;
1234 const auto num_cuts = sorted_cuts.size();
1235 _ASSERT(num_cuts == 1 || num_cuts == 2);
1238 const auto& first_cut = sorted_cuts[0].m_range;
1239 if (num_cuts == 1) {
1240 if (first_cut.GetFrom() == 0) {
1241 range.SetFrom(first_cut.GetTo() + 1);
1242 range.SetTo(seqLength - 1);
1246 range.SetTo(first_cut.GetFrom() - 1);
1252 _ASSERT(first_cut.GetFrom() > 0);
1253 range.SetTo(first_cut.GetFrom() - 1);
1254 range.SetFrom(sorted_cuts[1].m_range.GetTo() + 1);
1287 command->AddCommand(*chgInst);
1299 CFeat_CI feat_ci(scope, *search_loc, feat_sel);
1300 for (; feat_ci; ++feat_ci)
1307 bool bFeatureDeleted =
false;
1310 bool bFeatureTrimmed =
false;
1312 bool bProdDeleted =
false;
1313 bool bProdTrimmed =
false;
1317 bFeatureDeleted, bFeatureTrimmed,
1318 bProdDeleted, bProdTrimmed);
1320 if (bFeatureDeleted) {
1323 command->AddCommand(*delFeat);
1341 command->AddCommand(*delProt);
1346 if (bFeatureTrimmed) {
1355 auto new_frame = sequence::CFeatTrim::GetCdsFrame(feat_ci->
GetOriginalFeature(), retainedRange);
1356 new_feat->
SetData().SetCdregion().SetFrame(new_frame);
1378 command->AddCommand(*chgFeat);
1389 if (changedORadded_citsub) {
1390 if (changedSeqdesc && seh_for_desc) {
1392 command->AddCommand(*change_cmd);
1394 else if (!changedSeqdesc) {
1403 command->AddCommand(*cmdAddDesc);
1421 sort(sorted_cuts.begin(), sorted_cuts.end(), asc);
1437 sort(sorted_cuts.begin(), sorted_cuts.end(), descend);
1447 for (; align_ci; ++align_ci)
1469 for (cit = trimOnly.
begin(); cit != trimOnly.
end(); ++cit)
1471 const CSeq_id* seqid = cit->first;
1477 for (
int ii = 0; ii < ids.size(); ++ii) {
1478 if ( ids[ii]->Match(*seqid) ) {
1496 command->AddCommand(*chgAlign);
1503 command->AddCommand(*delAlign);
1510 const TCuts& sorted_cuts,
1513 for (
int ii = 0; ii < sorted_cuts.size(); ++ii)
1522 new_loc->Assign(new_graph->
GetLoc());
1523 bool bDeleted =
false;
1524 bool bTrimmed =
false;
1526 new_graph->
SetLoc(*new_loc);
1546 for (
int ii = 0; ii < sorted_cuts.size(); ++ii)
1554 if ( trim_start <= to ) {
1555 trim_start = to + 1;
1561 if ( trim_stop >= from ) {
1562 trim_stop = from - 1;
1571 const TCuts& sorted_cuts,
1584 TSeqPos copy_start = graph_start;
1585 if (trim_start > graph_start) {
1586 copy_start = trim_start;
1588 TSeqPos copy_stop = graph_stop;
1589 if (trim_stop < graph_stop) {
1590 copy_stop = trim_stop;
1598 switch ( src_data.
Which() ) {
1607 copy_start -= graph_start;
1608 copy_stop -= graph_start;
1618 new_graph->
SetNumval(copy_stop - copy_start + 1);
1634 for (; graph_ci; ++graph_ci)
1650 for (cit = trimOnly.
begin(); cit != trimOnly.
end(); ++cit)
1652 const CSeq_id* seqid = cit->first;
1656 if ( graph.
GetLoc().GetId()->Match(*seqid) ) {
1666 command->AddCommand(*chgGraph);
1682 if (sorted_cuts.empty()) {
1688 if (sorted_cuts.size() == 1) {
1692 if (from == 0 && to == seq_length - 1) {
1704 for (
int ii = 0; ii < sorted_cuts.size(); ++ii)
1717 if (from > max_to + 1) {
1722 min_from =
min(min_from, from);
1723 max_to =
max(max_to, to);
1727 if (min_from == 0 && max_to == seq_length - 1) {
1745 for (cit = seqidSummary.
begin(); cit != seqidSummary.
end(); ++cit)
1747 const CSeq_id* seqid = cit->first;
1761 sort(sorted_cuts.begin(), sorted_cuts.end(), asc);
1827 if ( !completeDeletions.
empty() ) {
1831 header <<
"The following " << completeDeletions.
size()
1832 <<
" sequences are 100% matches to vector and \n"
1833 <<
"will be deleted from your submission:";
1838 for (cit = completeDeletions.
begin(); cit != completeDeletions.
end(); ++cit)
1840 const CSeq_id* seqid = cit->first;
1848 footer <<
"Do you want to continue?";
1851 if ( listReport->ShowModal() == wxID_CANCEL ) {
1863 for (cit = completeDeletions.
begin(); cit != completeDeletions.
end(); ++cit)
1865 const CSeq_id* seqid = cit->first;
1872 for (cit = trimOnly.
begin(); cit != trimOnly.
end(); ++cit)
1874 const CSeq_id* seqid = cit->first;
1891 if (!report.IsEmpty()) {
1897 _(
"Trimmed Location(s)"),
1902 vecscreenReport->Show();
1938 const wxWindowID
id,
1972 InsertColumn( 0,
_(
"Select"), wxLIST_FORMAT_LEFT);
1973 InsertColumn( 1,
_(
"Location"), wxLIST_FORMAT_LEFT);
1974 InsertColumn( 2,
_(
"Seqid"), wxLIST_FORMAT_LEFT );
1975 InsertColumn( 3,
_(
"Match"), wxLIST_FORMAT_LEFT );
2003 return _(
"5' End" );
2007 return _(
"Internal" );
2013 ss <<
_(
"Internal: " ) << start <<
_(
" from 5' end, " )
2014 << hitloc.
m_SeqLen - stop <<
_(
" from 3' end" );
2015 return _( ss.str() );
2018 return _(
"3' End" );
2020 return _(
"Unknown" );
2034 stringstream ssMatchType;
2035 for (
int ii = 0; ii < hitloc.
m_matches.size(); ++ii)
2039 ssMatchType <<
"; ";
2041 ssMatchType << hitloc.
m_matches[ii].m_match_type;
2043 return _( ssMatchType.str() );
2079 SetItem(
row, col,
_(
"No vector contamination found"));
2083 GetColumn(col, objcol);
2084 objcol.SetWidth(450);
2085 SetColumn(col, objcol);
2093 GetColumn(col, objcol);
2094 objcol.SetWidth(50);
2095 SetColumn(col, objcol);
2111 seqidSummaryBySeqid.
clear();
2112 TVecscreenSummaryByLocation::const_iterator cit;
2113 for (cit = seqidSummaryByLocation.begin(); cit != seqidSummaryByLocation.end(); ++cit) {
2122 pair<TVecscreenSummaryBySeqid::iterator, bool> ins_res =
2126 if (!ins_res.second) {
2137 const vector<SRangeMatch>& sorted_matches,
2141 if (sorted_matches.empty()) {
2147 static const TSeqPos kTerminalLenFromEnd = 50;
2149 const TSeqPos loc_start = sorted_matches[0].m_range.GetFrom();
2150 const TSeqPos loc_stop = sorted_matches[sorted_matches.size()-1].m_range.GetTo();
2151 if (loc_start < kTerminalLenFromEnd) {
2155 if (vecres.
m_SeqLen - loc_stop < kTerminalLenFromEnd) {
2164 bool selected =
true;
2171 seqidSummaryByLocation.push_back(hits);
2184 seqidSummaryByLocation.clear();
2186 for (cit = vecscreen_summary.
begin(); cit != vecscreen_summary.
end(); ++cit) {
2187 const CSeq_id* seqid = cit->first;
2196 int previous_to = -99;
2197 vector<SRangeMatch> previous_matches;
2201 if (
match.m_range.GetFrom() <= previous_to+1) {
2204 previous_matches.push_back(
match);
2208 vector<SRangeMatch> current_matches;
2209 current_matches.push_back(
match);
2212 x_InsertMatches(seqidSummaryByLocation, previous_matches, seqid, vecres);
2215 previous_matches.swap(current_matches);
2218 previous_to =
match.m_range.GetTo();
2222 x_InsertMatches(seqidSummaryByLocation, previous_matches, seqid, vecres);
2230 report <<
_(
"No vector contamination found");
2235 TVecscreenSummaryByLocation::const_iterator cit;
2253 sort(seqidSummaryByLocation.begin(), seqidSummaryByLocation.end(),
cmp);
2255 TVecscreenSummaryByLocation::const_iterator cit;
2256 for (cit = seqidSummaryByLocation.begin(); cit != seqidSummaryByLocation.end(); ++cit)
2258 if (cit->m_Selected && !cit->m_matches.empty()) {
2260 report << cit->m_FastaSeqid <<
_(
":");
2262 const SRangeMatch& firstrange = cit->m_matches[0];
2263 const SRangeMatch& lastrange = cit->m_matches[cit->m_matches.size()-1];
2273 TSeqPos seq_length = cit->m_SeqLen;
2274 if (from != 0 && to != seq_length-1) {
2280 if (from - 0 < seq_length-1 - to) {
2300 report << from + 1 <<
"-" << to + 1 <<
_(
"\n");
2317 if (searchstr.empty()) {
2323 if (s.Find(searchstr) != wxNOT_FOUND) {
2329 if (s.Find(searchstr) != wxNOT_FOUND) {
2335 if (s.Find(searchstr) != wxNOT_FOUND) {
2353 SetItemState(
row, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
2358 wxMessageDialog
msg(
NULL,
_(
"Text not found!"),
_(
"Info") );
2366 bool bFound =
false;
2375 auto initialSearchRow =
row;
2378 bFound =
x_Find(hitloc, searchstr);
2387 initialSearchRow =
row;
2400 bool bFound =
false;
2409 auto initialSearchRow =
row;
2412 bFound =
x_Find(hitloc, searchstr);
2421 initialSearchRow =
row;
2434 TVecscreenSummaryByLocation::const_iterator cit;
2437 if (!cit->m_Selected) {
2457 for (
int ii = 0; ii < matches.size(); ++ii) {
2458 string matchstr = matches[ii].m_match_type;
2462 if (matchstr ==
"strong") {
2466 if (matchstr ==
"moderate") {
2470 if (matchstr ==
"weak") {
2474 if (matchstr ==
"suspect") {
2479 if (current < matchtype) {
2480 matchtype = current;
2487 const vector<SRangeMatch>& y)
const
2490 x_FindStrongestMatchType(x, xMatchType);
2493 x_FindStrongestMatchType(y, yMatchType);
2495 return xMatchType - yMatchType;
2557 TVecscreenSummaryByLocation::const_iterator cit;
2570 SetItem(
row, 0, wxEmptyString );
2583 SetColumnWidth(0, wxLIST_AUTOSIZE_USEHEADER);
2584 SetColumnWidth(1, wxLIST_AUTOSIZE_USEHEADER);
2585 SetColumnWidth(2, wxLIST_AUTOSIZE);
2586 SetColumnWidth(3, wxLIST_AUTOSIZE);
2592 TVecscreenSummaryByLocation::iterator it;
2607 TVecscreenSummaryByLocation::iterator it;
2614 for (
int ii = 0; ii < hitloc.
m_matches.size(); ++ii)
2632 TVecscreenSummaryByLocation::iterator it;
2647 TVecscreenSummaryByLocation::iterator it;
2667 int col =
event.GetColumn();
2702 if ( GetWindowStyle() & wxLC_REPORT )
2704 auto selected_row =
event.GetIndex();
2706 TVecscreenSummaryByLocation::const_iterator cit;
2710 if (
count == selected_row)
2728 auto selected_row =
event.GetIndex();
2749 const wxWindowID
id,
2769 wxListCtrl::Create(parent,
id, pos,
size, style);
2779 col0.SetText(
_(
"Seqid") );
2781 InsertColumn( 0, col0 );
2785 col1.SetText(
_(
"Range") );
2787 InsertColumn( 1,
col1 );
2794 const vector<SRangeMatch>& matches)
2800 for (
int ii = 0; ii < matches.size(); ++ii)
2810 SetItem( ii, 0,
_( fastaseqid ) );
2813 stringstream ssRange;
2816 SetItem( ii, 1,
_( ssRange.str() ) );
2825 if ( GetWindowStyle() & wxLC_REPORT )
2828 info.m_itemId =
event.GetIndex();
2849 Create(parent,
id, caption, pos,
size, style);
2855 SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
2856 wxDialog::Create( parent,
id, caption, pos,
size, style );
2861 GetSizer()->SetSizeHints(
this);
2880 wxBoxSizer* dialogSizer =
new wxBoxSizer(wxVERTICAL);
2881 this->SetSizer(dialogSizer);
2885 m_textHeader =
new wxStaticText(
this,
2891 dialogSizer->Add(m_textHeader, 0, wxEXPAND|wxALL, 5);
2895 m_textList =
new wxTextCtrl(
this,
2900 wxTE_MULTILINE|wxTE_READONLY );
2901 dialogSizer->Add(m_textList, 1, wxEXPAND|wxALL, 5);
2905 m_textFooter =
new wxStaticText(
this,
2911 dialogSizer->Add(m_textFooter, 0, wxEXPAND|wxALL, 5);
2915 wxBoxSizer* buttonSizer =
new wxBoxSizer(wxHORIZONTAL);
2916 wxButton* okButton =
new wxButton(
this, wxID_OK,
_(
"Ok" ), wxDefaultPosition, wxDefaultSize, 0 );
2917 wxButton* cancelButton =
new wxButton(
this, wxID_CANCEL,
_(
"Cancel" ), wxDefaultPosition, wxDefaultSize, 0 );
2918 buttonSizer->Add(okButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
2919 buttonSizer->Add(cancelButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
2920 dialogSizer->Add(buttonSizer, 0, wxEXPAND|wxALL, 5);
2926 m_textHeader->SetLabel(header);
2932 m_textList->SetValue(list);
2938 m_textFooter->SetLabel(footer);
2963 wxPanel::Create( parent,
id, pos,
size, style );
2968 GetSizer()->SetSizeHints(
this);
2987 wxBoxSizer* panelSizer =
new wxBoxSizer(wxVERTICAL);
2988 this->SetSizer(panelSizer);
2992 m_textReport =
new wxTextCtrl(
this,
2998 panelSizer->Add(m_textReport, 1, wxEXPAND|wxALL, 5);
3004 m_textReport->SetValue(report);
3023 Create(parent,
id, caption, pos,
size, style);
3029 wxDialog::Create( parent,
id, caption, pos,
size, style );
3034 GetSizer()->SetSizeHints(
this);
3053 wxBoxSizer* dialogSizer =
new wxBoxSizer(wxVERTICAL);
3054 this->SetSizer(dialogSizer);
3057 dialogSizer->Add(m_panel, 1, wxEXPAND|wxALL, 5);
3063 m_panel->SetReport(report);
User-defined methods of the data storage class.
User-defined methods of the data storage class.
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.
void Set(T *object)
Initialize with an existing object.
TSeqPos GetLength(void) const
static CRef< objects::CSeqdesc > s_GetCitSubForTrimmedSequence(const objects::CBioseq_Handle &bsh, string &message, CConstRef< objects::CSeqdesc > &changedSeqdesc, objects::CSeq_entry_Handle &seh)
void SetHeader(const wxString &header)
~CListReportDlg()
Destructor.
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("Report Dialog"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
CListReportDlg()
Constructors.
void CreateControls()
Creates the controls and sizers.
void Init()
Initialises member variables.
void SetList(const wxString &list)
void SetFooter(const wxString &footer)
bool Create(wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxLC_ICON)
void OnSelected(wxListEvent &event)
bool UpdateData(const string &fastaseqid, const vector< SRangeMatch > &matches)
int x_Compare(const CUVHitLoc &x, const CUVHitLoc &y) const
void x_FindStrongestMatchType(const vector< SRangeMatch > &matches, SRangeMatch::EMatchType &matchtype) const
int x_CompareMatches(const vector< SRangeMatch > &x, const vector< SRangeMatch > &y) const
bool operator()(const CUVHitLoc &x, const CUVHitLoc &y) const
vector< SRangeMatch > m_matches
@ eSortInternal5Prime3Prime
bool x_Find(const CUVHitLoc &hitloc, const wxString &searchstr)
void x_DisplaySearchResult(bool bFound, long row)
void x_InsertMatches(TVecscreenSummaryByLocation &seqidSummaryByLocation, const vector< SRangeMatch > &sorted_matches, const CSeq_id *seqid, const SVecscreenResult &vecres) const
vector< CUVHitLoc > TVecscreenSummaryByLocation
bool UpdateData(const TVecscreenSummaryBySeqid &vecscreen_summary)
TVecscreenSummaryBySeqid m_seqidSummaryBySeqid
void Sort(ESortOption eSortOption, bool bAscending)
const TVecscreenSummaryBySeqid & GetSelectedVecscreenSummaryBySeqid()
void x_ConvertSelectedToBySeqid(const TVecscreenSummaryByLocation &seqidSummaryByLocation, TVecscreenSummaryBySeqid &seqidSummaryBySeqid) const
bool Create(wxWindow *parent, wxWindowID id, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxLC_ICON)
void OnSelected(wxListEvent &event)
void SetAlignGraphicView(wxHtmlWindow *view)
void OnColClick(wxListEvent &event)
void SetRangeView(CLocationsListCtrl *view)
CLocationsListCtrl * m_RangeView
wxString x_GetSeqid(const CUVHitLoc &hitloc)
void OnChecked(wxListEvent &event)
void GetSelectedLocations(wxString &report, CVectorTrimPanel::EInternalTrimType eInternalTrimType)
wxListItemAttr m_listItemAttr
void SelectStrongModerate()
wxString x_GetHitLocation(const CUVHitLoc &hitloc)
wxHtmlWindow * m_AlignView
bool x_GetSelected(const CUVHitLoc &hitloc)
void FindReverse(wxString searchstr)
TVecscreenSummaryByLocation m_seqidSummaryByLocation
void GetReport(wxString &report)
bool x_IsValidRow(long row)
wxString x_GetMatchType(const CUVHitLoc &hitloc)
void x_ConvertAllToByLocation(const TVecscreenSummaryBySeqid &vecscreen_summary, TVecscreenSummaryByLocation &seqidSummaryByLocation) const
void FindForward(wxString searchstr)
Helper functor to compare cuts during sorting.
bool operator()(const SRangeMatch &a1, const SRangeMatch &a2)
CRangeCmp(ESortOrder sortorder=eAscending)
namespace ncbi::objects::
static TSeqPos Pack(CSeq_data *in_seq, TSeqPos uLength=ncbi::numeric_limits< TSeqPos >::max())
void SetReport(const wxString &report)
void Init()
Initialises member variables.
void CreateControls()
Creates the controls and sizers.
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxBORDER_SIMPLE)
Creation.
~CVecscreenReportPanel()
Destructor.
CVecscreenReportPanel()
Constructors.
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("VecScreen Report"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
Creation.
void CreateControls()
Creates the controls and sizers.
void SetReport(const wxString &report)
void Init()
Initialises member variables.
~CVecscreenReport()
Destructor.
CVecscreenReport()
Constructors.
void Run(objects::CSeq_entry_Handle seh, wxGauge &progress)
static bool IsDbAvailable()
const TVecscreenSummaryBySeqid & GetVecscreenSummaryBySeqid() const
void OnTrimSelected(wxCommandEvent &event)
bool Create(wxWindow *parent, wxWindowID id=ID_CVECTORTRIMPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
Creation.
void OnDismiss(wxCommandEvent &event)
CLocationsListCtrl * m_listLocations
wxButton * m_buttonSelectStrongModerate
void x_RetranslateCDS(CScope &scope, CRef< CCmdComposite > command, CRef< CSeq_feat > cds)
wxHtmlWindow * m_viewAlignGraphic
void x_SeqLocDelete(CRef< CSeq_loc > loc, TSeqPos from, TSeqPos to, const CSeq_id *seqid, bool &bCompleteCut, bool &bTrimmed)
void OnUnselectInternal(wxCommandEvent &event)
objects::CSeq_entry_Handle m_TopSeqEntry
void OnFindReverse(wxCommandEvent &event)
CRange< TSeqPos > x_GetRetainedRange(const TCuts &sorted_cuts, TSeqPos seqLength)
void x_TrimSeqGraphs(CRef< CCmdComposite > command, const TVecscreenSummaryBySeqid &trimOnly)
void OnSort(wxCommandEvent &event)
void Init()
Initialises member variables.
bool x_FindSegment(const CDense_seg &denseg, CDense_seg::TDim row, TSeqPos pos, CDense_seg::TNumseg &seg, TSeqPos &seg_start) const
wxGauge * m_gaugeProgressBar
void x_TrimSeqGraphData(CRef< CSeq_graph > new_graph, const CMappedGraph &orig_graph, const TCuts &sorted_cuts, const CSeq_id *seqid)
void x_TrimFeatureLocations(CRef< CSeq_feat > feat, const TCuts &sorted_cuts, const CSeq_id *seqid, bool &bFeatureDeleted, bool &bFeatureTrimmed, bool &bProdDeleted, bool &bProdTrimmed)
~CVectorTrimPanel()
Destructor.
void x_CutDensegSegment(CRef< CSeq_align > align, CDense_seg::TDim row, TSeqPos pos)
void x_AdjustDensegAlignment(CRef< CSeq_align > align, CDense_seg::TDim row, const TCuts &sorted_cuts)
wxButton * m_buttonUnselectInternal
wxButton * m_buttonUnselectAll
void x_GetSortedCuts(TCuts &sorted_cuts, const CSeq_id *seqid)
wxButton * m_buttonMakeReport
void CreateControls()
Creates the controls and sizers.
wxButton * m_buttonFindForward
static bool ShowToolTips()
Should we show tooltips?
wxRadioBox * m_radioBoxInternalTrimOptions
void OnSelectStrongModerate(wxCommandEvent &event)
void x_AdjustInternalCutLocations(TCuts &cuts, TSeqPos seq_length)
void OnUnselectAll(wxCommandEvent &event)
wxButton * m_buttonSelectAll
void x_MergeCuts(TCuts &sorted_cuts)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void DisplaySummaryBySeqid(const TVecscreenSummaryBySeqid &vecscreen_summary)
wxButton * m_buttonDismiss
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void x_FindCompleteDeletions(const TVecscreenSummaryBySeqid &seqidSummary, TVecscreenSummaryBySeqid &completeDeletions, TVecscreenSummaryBySeqid &trimOnly)
CVectorScreen m_vectorscreen
void OnSelectAll(wxCommandEvent &event)
void x_SetSeqData(const CBioseq_Handle &bsh, CRef< objects::CSeq_inst > inst, const TCuts &sorted_cuts)
void x_DeleteSelected(CRef< CCmdComposite > command, const CSeq_id *seqid)
void OnFindForward(wxCommandEvent &event)
void x_TrimAlignments(CRef< CCmdComposite > command, const TVecscreenSummaryBySeqid &trimOnly)
wxButton * m_buttonRunVecscreen
void OnRunVecscreen(wxCommandEvent &event)
void x_SeqIntervalDelete(CRef< CSeq_interval > interval, TSeqPos cut_from, TSeqPos cut_to, const CSeq_id *seqid, bool &bCompleteCut, bool &bTrimmed)
ICommandProccessor * m_CmdProcessor
void x_UpdateSeqGraphLoc(CRef< CSeq_graph > new_graph, const TCuts &sorted_cuts, const CSeq_id *seqid)
void OnMakeReport(wxCommandEvent &event)
bool x_IsCompleteCut(const TCuts &sorted_cuts, TSeqPos seq_length)
vector< SRangeMatch > TCuts
wxWindow * m_pParentWindow
CMatchesListCtrl * m_listMatches
void x_GetTrimCoordinates(const TCuts &sorted_cuts, const CSeq_id *seqid, TSeqPos &trim_start, TSeqPos &trim_stop)
wxRadioBox * m_radioBoxSort
CVectorTrimPanel()
Constructors.
virtual bool TransferDataToWindow()
wxButton * m_buttonTrimSelected
virtual bool TransferDataFromWindow()
wxBoxSizer * m_sizerVectorResults
wxButton * m_buttonFindReverse
Undo/Redo interface for editing operations.
virtual void Execute(IEditCommand *command, wxWindow *window=0)=0
container_type::const_iterator const_iterator
const_iterator begin() const
const_iterator end() const
iterator_bool insert(const value_type &val)
container_type::value_type value_type
bool Create(wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxLC_REPORT, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxListCtrlNameStr)
bool IsChecked(long item) const
void SetChecked(long item, bool checked)
static const char si[8][64]
static const char location[]
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
int TSignedSeqPos
Type for signed sequence position.
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
const TPrim & Get(void) const
const string AsFastaString(void) const
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Optimized implementation of CSerialObject::Assign, which is not so efficient.
void SetPacked_int(TPacked_int &v)
TSeqPos GetStart(ESeqLocExtremes ext) const
Return start and stop positions of the seq-loc.
TSeqPos GetStop(ESeqLocExtremes ext) const
static CRef< CBioseq > TranslateToProtein(const CSeq_feat &cds, CScope &scope)
CBioseq_Handle AddBioseq(CBioseq &bioseq, TPriority pri=kPriority_Default, EExist action=eExist_Throw)
Add bioseq, return bioseq handle.
void RemoveBioseq(const CBioseq_Handle &seq)
Revoke Bioseq previously added using AddBioseq().
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
bool IsNucleotide(void) const
CConstRef< CBioseq > GetCompleteBioseq(void) const
Get the complete bioseq.
TClass GetClass(void) const
CBioseq_set_Handle GetParentBioseq_set(void) const
Return a handle for the parent Bioseq-set, or null handle.
bool CanGetClass(void) const
const CSeqFeatData & GetData(void) const
TSeqPos GetBioseqLength(void) const
CSeq_entry_Handle GetSeq_entry_Handle(void) const
Get parent Seq-entry handle.
bool IsSetProduct(void) const
void SetInst(TInst &v) const
bool IsProtein(void) const
CBioseq_EditHandle GetEditHandle(void) const
Get 'edit' version of handle.
CSeq_entry_Handle GetParentEntry(void) const
Return a handle for the parent seq-entry of the bioseq.
CScope & GetScope(void) const
Get scope this handle belongs to.
CScope & GetScope(void) const
Get scope this handle belongs to.
const CSeqMap & GetSeqMap(void) const
Get sequence map.
CSeq_entry_Handle GetTopLevelEntry(void) const
Get top level Seq-entry handle.
bool IsSetData(void) const
const TInst & GetInst(void) const
@ eCoding_Iupac
Set coding to printable coding (Iupacna or Iupacaa)
TSeqPos GetEndPosition(void) const
return end position of current segment in sequence (exclusive)
const string & GetTitle(void) const
bool IsSetTitle(void) const
const CSeq_align & GetOriginalSeq_align(void) const
Get original alignment.
const CSeq_feat & GetOriginalFeature(void) const
Get original feature with unmapped location/product.
const CSeq_loc & GetProduct(void) const
CSeqMap::ESegmentType GetType(void) const
bool IsUnknownLength(void) const
return true if current segment is a gap of unknown length
const CSeq_graph & GetOriginalGraph(void) const
Get original graph with unmapped location/product.
const CSeq_loc & GetLoc(void) const
CSeq_align_Handle GetSeq_align_Handle(void) const
Get original alignment handle.
TSeqPos GetPosition(void) const
return position of current segment in sequence
TSeqPos GetLength(void) const
return length of current segment
CConstRef< CSeq_literal > GetRefGapLiteral(void) const
return CSeq_literal with gap data, or null if either the segment is not a gap, or an unspecified gap
const CSeq_graph::C_Graph & GetGraph(void) const
CSeq_graph_Handle GetSeq_graph_Handle(void) const
Get original graph handle.
void GetSeqData(TSeqPos start, TSeqPos stop, string &buffer) const
Fill the buffer string with the sequence data for the interval [start, stop).
CSeqMap_CI ResolvedRangeIterator(CScope *scope, TSeqPos from, TSeqPos length, ENa_strand strand=eNa_strand_plus, size_t maxResolve=size_t(-1), TFlags flags=fDefaultFlags) const
Iterate segments in the range with specified strand coordinates.
@ eSeqData
real sequence data
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
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.
static string & ToLower(string &str)
Convert string to lower case – string& version.
void SetFrom(TFrom value)
Assign a value to From data member.
TTo GetTo(void) const
Get the To member data.
TFrom GetFrom(void) const
Get the From member data.
void SetTo(TTo value)
Assign a value to To data member.
bool CanGetDim(void) const
Check if it is safe to call GetDim method.
const TDenseg & GetDenseg(void) const
Get the variant data.
TLens & SetLens(void)
Assign a value to Lens data member.
E_Choice Which(void) const
Which variant is currently selected.
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.
bool CanGetNumseg(void) const
Check if it is safe to call GetNumseg method.
void SetDim(TDim value)
Assign a value to Dim data member.
bool CanGetIds(void) const
Check if it is safe to call GetIds method.
vector< CRef< CSeq_id > > TIds
bool CanGetSegs(void) const
Check if it is safe to call GetSegs method.
TDim GetDim(void) const
Get the Dim member data.
TStarts & SetStarts(void)
Assign a value to Starts data member.
TStrands & SetStrands(void)
Assign a value to Strands data member.
void SetNumseg(TNumseg value)
Assign a value to Numseg data member.
const TIds & GetIds(void) const
Get the Ids member data.
bool CanGetStarts(void) const
Check if it is safe to call GetStarts method.
TNumseg GetNumseg(void) const
Get the Numseg member data.
TIds & SetIds(void)
Assign a value to Ids data member.
const TStrands & GetStrands(void) const
Get the Strands member data.
const TSegs & GetSegs(void) const
Get the Segs member data.
bool CanGetLens(void) const
Check if it is safe to call GetLens method.
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
E_Choice Which(void) const
Which variant is currently selected.
void SetLocation(TLocation &value)
Assign a value to Location data member.
void SetProduct(TProduct &value)
Assign a value to Product data member.
const TLocation & GetLocation(void) const
Get the Location member data.
const TData & GetData(void) const
Get the Data member data.
void SetData(TData &value)
Assign a value to Data data member.
bool CanGetLocation(void) const
Check if it is safe to call GetLocation method.
const TProduct & GetProduct(void) const
Get the Product member data.
bool CanGetProduct(void) const
Check if it is safe to call GetProduct method.
bool IsSetProduct(void) const
product of process Check if a value has been assigned to Product data member.
void SetTo(TTo value)
Assign a value to To data member.
TFrom GetFrom(void) const
Get the From member data.
bool CanGetTo(void) const
Check if it is safe to call GetTo method.
E_Choice Which(void) const
Which variant is currently selected.
void SetFrom(TFrom value)
Assign a value to From data member.
TTo GetTo(void) const
Get the To member data.
bool IsInt(void) const
Check if variant Int is selected.
const TInt & GetInt(void) const
Get the variant data.
const TMix & GetMix(void) const
Get the variant data.
const TPacked_int & GetPacked_int(void) const
Get the variant data.
bool CanGetFrom(void) const
Check if it is safe to call GetFrom method.
void SetMin(TMin value)
Assign a value to Min data member.
TByte & SetByte(void)
Select the variant.
void SetNumval(TNumval value)
Assign a value to Numval data member.
TAxis GetAxis(void) const
Get the Axis member data.
TValues & SetValues(void)
Assign a value to Values data member.
TMax GetMax(void) const
Get the Max member data.
const TByte & GetByte(void) const
Get the variant data.
void SetGraph(TGraph &value)
Assign a value to Graph data member.
bool CanGetLoc(void) const
Check if it is safe to call GetLoc method.
void SetMax(TMax value)
Assign a value to Max data member.
TMin GetMin(void) const
Get the Min member data.
const TValues & GetValues(void) const
Get the Values member data.
E_Choice Which(void) const
Which variant is currently selected.
void SetLoc(TLoc &value)
Assign a value to Loc data member.
const TLoc & GetLoc(void) const
Get the Loc member data.
void SetAxis(TAxis value)
Assign a value to Axis data member.
void Reset(void)
Reset the whole object.
@ eClass_nuc_prot
nuc acid and coded proteins
const TIupacaa & GetIupacaa(void) const
Get the variant data.
bool IsSetSeq_data(void) const
the sequence Check if a value has been assigned to Seq_data data member.
bool IsNcbieaa(void) const
Check if variant Ncbieaa is selected.
const TInst & GetInst(void) const
Get the Inst member data.
bool IsIupacaa(void) const
Check if variant Iupacaa is selected.
void SetExt(TExt &value)
Assign a value to Ext data member.
TIupacna & SetIupacna(void)
Select the variant.
TLength GetLength(void) const
Get the Length member data.
const TNcbieaa & GetNcbieaa(void) const
Get the variant data.
void SetRepr(TRepr value)
Assign a value to Repr data member.
void SetLength(TLength value)
Assign a value to Length data member.
void SetSeq_data(TSeq_data &value)
Assign a value to Seq_data data member.
void ResetExt(void)
Reset Ext data member.
const TSeq_data & GetSeq_data(void) const
Get the Seq_data member data.
void ResetSeq_data(void)
Reset Seq_data data member.
@ eRepr_raw
continuous sequence
range(_Ty, _Ty) -> range< _Ty >
constexpr auto sort(_Init &&init)
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)
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
#define row(bind, expected)
CRange< TSeqPos > m_range
vector< SRangeMatch > m_arrRangeMatch
@ MYID_BUTTON_RUN_VECSCREEN
@ MYID_CHECKBOX_VIEWGRAPHIC
@ MYID_BUTTON_SELECT_STRONG_MODERATE
@ MYID_BUTTON_FIND_REVERSE
@ MYID_RADIOBOX_INTERNAL_TRIM_OPTIONS
@ MYID_BUTTON_UNSELECT_INTERNAL
@ MYID_BUTTON_UNSELECT_ALL
@ MYID_BUTTON_MAKE_REPORT
@ MYID_BUTTON_TRIM_SELECTED
@ MYID_BUTTON_FIND_FORWARD
@ MYID_LISTCTRL_LOCATIONS
void ShowDebugMessage(const wxString &message)