m_queryMolecule =
NULL;
118m_querySequence = querySequence;
119 if(m_querySequence) m_queryMolecule = m_querySequence->identifier;
162 INFOMSG(
"type "<< integer <<
" is not a valid Ibis interaction type");
167 if(
result&& ibisType) {
176 string result=
"Unknown";
233 INFOMSG(
"IBIS interaction type "<< ibisType <<
" not mapped to a Cdd interaction type");
262 INFOMSG(
"Cdd interaction type "<< cddType <<
" not mapped to an IBIS interaction type");
295 boolinRange =
true;
299from =
location.SetInt().SetFrom();
306}
else if(
location.IsPacked_int()) {
307CPacked_seqint::Tdata::iterator s, se =
location.SetPacked_int().Set().end();
308 for(s =
location.SetPacked_int().Set().begin(); s!=se; ++s) {
309from = (**s).SetFrom();
317 ERRORMSG(
"interaction '"<<
m_desc<<
"' has unexpected location type");
321 ERRORMSG(
"interaction '"<<
m_desc<<
"' has out-of-range positions");
344 intintType =
m_seqfeat.GetExt().GetType().GetId();
369 WARNINGMSG(
"IBIS feature data with unexpected type "<< intType);
374CSeq_feat::TExt::TData::const_iterator uoCit = userObjectData.begin();
375CSeq_feat::TExt::TData::const_iterator uoEnd = userObjectData.end();
376 for(; uoCit != uoEnd; ++uoCit) {
378 if((*uoCit)->GetLabel().IsStr()) {
379 label= (*uoCit)->GetLabel().GetStr();
381 ERRORMSG(
"IBIS feature data with non-string label is skipped");
385 if((*uoCit)->GetData().IsInt()) {
386intValue = (*uoCit)->GetData().GetInt();
388 ERRORMSG(
"IBIS feature data with non-integral type and label '"<<
label<<
"' is skipped");
392 if(
label==
"mmdbId") {
394}
else if(
label==
"sdiId") {
396}
else if(
label==
"nMembers") {
398}
else if(
label==
"nInterfaceRes") {
400}
else if(
label==
"nUniqueChemicals") {
402}
else if(
label==
"nUniqueIons") {
404}
else if(
label==
"comb_scr") {
406}
else if(
label==
"avgIdent") {
407 m_pid= (double) intValue/1000000.0;
408}
else if(
label==
"isObserverd") {
411 ERRORMSG(
"IBIS feature data with unexpected label '"<<
label<<
"' is skipped");
419 boolisLocOK =
false;
423annot->SetDescription(
m_desc);
426 constncbi::objects::CSeq_loc& loc =
GetLocation(isLocOK);
429packedInt->Assign(loc.GetPacked_int());
430annot->SetLocation().SetPacked_int(*packedInt);
444boilerplateEvidence->SetComment(commentEvid);
445evidence.push_back(boilerplateEvidence);
458 ERRORMSG(
"error converting interaction '"<<
m_desc<<
"' to an annotation!");
469 if(!
m_seqfeat.GetLocation().IsPacked_int()) {
471 ERRORMSG(
"IBIS feature has unexpected location type");
474 ERRORMSG(
"could not extract IBIS feature location");
488from =
location.GetInt().GetFrom();
490 for(pos = from; pos <= to; ++pos) {
493}
else if(isOK &&
location.IsPacked_int()) {
494CPacked_seqint::Tdata::const_iterator s, se =
location.GetPacked_int().Get().end();
495 for(s =
location.GetPacked_int().Get().begin(); s!=se; ++s) {
496from = (**s).GetFrom();
498 for(pos = from; pos <= to; ++pos) {
516 if(intervals.size() > 0) {
517from = (
int) intervals.front()->GetFrom();
518to = (
int) intervals.back()->GetTo();
521 ERRORMSG(
"IBIS feature has no defined intervals");
535CPacked_seqint::Tdata::const_iterator it = intervals.begin(), itEnd = intervals.end();
538 const CSeq_id& firstId = (*it)->GetId();
543 for(; idsMatch && it != itEnd; ++it) {
544idsMatch = firstId.
Match((*it)->GetId());
548 if(firstId.
IsGi()) {
549gi = firstId.
GetGi();
552 ERRORMSG(
"unexpected sequence identifier used for IBIS feature location (expected a GI)");
556 ERRORMSG(
"inconsistent sequence ids used to give IBIS feature location");
560 ERRORMSG(
"IBIS feature has no defined intervals");
570 #define DECLARE_AND_FIND_WINDOW_RETURN_ON_ERR(var, id, type) \ 572 var = wxDynamicCast(FindWindow(id), type); \ 574 ERRORMSG("Can't find window with id "<< id); \
578 #define DECLARE_AND_FIND_WINDOW_RETURN_FALSE_ON_ERR(var, id, type) \ 580 var = wxDynamicCast(FindWindow(id), type); \ 582 ERRORMSG("Can't find window with id "<< id); \
595wxDialog(parent, -1, "IBIS Annotations", wxPoint(400, 100), wxDefaultSize, wxDEFAULT_DIALOG_STYLE),
596dialogHandle(handle), structureSet(
set), annotSet(
set->GetCDDAnnotSet()), m_images(
NULL)
598 if(annotSet.Empty()) {
604PopulateInteractionData();
613 if(sbs) sbs->GetStaticBox()->SetLabel(
buf);
620topSizer->Fit(
this);
621topSizer->SetSizeHints(
this);
622SetClientSize(topSizer->GetMinSize());
629 if(vecIbisInteractions.size() > 0) {
631choiceId = intTypeFilter->FindString(
wxT(
"Protein-Protein"));
632 if(choiceId != wxNOT_FOUND) {
633intTypeFilter->Delete(choiceId);
639choiceId = intTypeFilter->FindString(
wxT(
"Protein-NucAcid"));
640 if(choiceId != wxNOT_FOUND) {
641intTypeFilter->Delete(choiceId);
645choiceId = intTypeFilter->FindString(
wxT(
"Protein-Chemical"));
646 if(choiceId != wxNOT_FOUND) {
647intTypeFilter->Delete(choiceId);
651choiceId = intTypeFilter->FindString(
wxT(
"Protein-Peptide"));
652 if(choiceId != wxNOT_FOUND) {
653intTypeFilter->Delete(choiceId);
657choiceId = intTypeFilter->FindString(
wxT(
"Protein-Ion"));
658 if(choiceId != wxNOT_FOUND) {
659intTypeFilter->Delete(choiceId);
664intTypeFilter->SetSelection(0);
669wxIcon infoIcon = wxArtProvider::GetIcon(wxART_INFORMATION);
670wxIcon warnIcon = wxArtProvider::GetIcon(wxART_WARNING);
671wxIcon questionIcon = wxArtProvider::GetIcon(wxART_QUESTION);
672wxIcon bookmarkIcon = wxArtProvider::GetIcon(wxART_ADD_BOOKMARK);
673wxIcon tickMarkIcon = wxArtProvider::GetIcon(wxART_TICK_MARK);
674 if(tickMarkIcon.Ok()) {
675m_images =
newwxImageList(16, 16,
true);
676m_images->Add(infoIcon);
677m_images->Add(warnIcon);
678m_images->Add(questionIcon);
679m_images->Add(bookmarkIcon);
680m_images->Add(tickMarkIcon);
681interactions->SetImageList(m_images, wxIMAGE_LIST_SMALL);
685 if(interactions->GetWindowStyleFlag() & wxLC_REPORT) {
687itemCol.SetText(
wxT(
"Annot Overlap?"));
688itemCol.SetAlign(wxLIST_FORMAT_LEFT);
689interactions->InsertColumn(0, itemCol);
691itemCol.SetText(
wxT(
"Type"));
692itemCol.SetAlign(wxLIST_FORMAT_LEFT);
693interactions->InsertColumn(1, itemCol);
695itemCol.SetText(
wxT(
"Observed?"));
696itemCol.SetAlign(wxLIST_FORMAT_RIGHT);
697interactions->InsertColumn(2, itemCol);
699itemCol.SetText(
wxT(
"Filtered on Web?"));
700itemCol.SetAlign(wxLIST_FORMAT_RIGHT);
701interactions->InsertColumn(3, itemCol);
703itemCol.SetText(
wxT(
"Description"));
704itemCol.SetAlign(wxLIST_FORMAT_LEFT);
705interactions->InsertColumn(4, itemCol);
707itemCol.SetText(
wxT(
"# Res. on Query"));
708itemCol.SetAlign(wxLIST_FORMAT_CENTER);
709interactions->InsertColumn(5, itemCol);
711itemCol.SetText(
wxT(
"Clust. Size"));
712itemCol.SetAlign(wxLIST_FORMAT_CENTER);
713interactions->InsertColumn(6, itemCol);
715itemCol.SetText(
wxT(
"Avg. Clust. %Id"));
716itemCol.SetAlign(wxLIST_FORMAT_CENTER);
717interactions->InsertColumn(7, itemCol);
719itemCol.SetText(
wxT(
"IBIS Score"));
720itemCol.SetAlign(wxLIST_FORMAT_CENTER);
721interactions->InsertColumn(8, itemCol);
726SetupGUIControls(-1, -1);
739 TRACEMSG(
"destroyed IBISAnnotateDialog");
752 returnlistCtrl.GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
759 longitem = listCtrl.GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
762 while( item != -1 ) {
764item = listCtrl.GetNextItem(item, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
801 ERRORMSG(
"Error calling ibis.cgi: from ("<<
query.from <<
") > to ("<<
query.to <<
").");
804 ERRORMSG(
"Error calling ibis.cgi: mmdbId not set.");
807 ERRORMSG(
"Error calling ibis.cgi: molId not set..");
813host =
"www.ncbi.nlm.nih.gov",
814path =
"/Structure/ibis/ibis.cgi";
816argstr <<
"sqat&range="<< (
query.from+1) <<
','<< (
query.to+1) <<
"&mmdbid="<<
query.mmdbId
817<<
"&molid="<<
query.molId
828 INFOMSG(
"try to load IBIS alignment data by mmdb-id from "<< host << path <<
'?'<< args);
831 ERRORMSG(
"Error getting interaction data from ibis.cgi:\n"<< err);
834ibisSeqAnnot.
Reset();
835 if(
query.pdb.length() > 0) {
838argstrPdb <<
"sqat&range="<< (
query.from+1) <<
','<< (
query.to+1) <<
"&search="<<
query.pdb
842 INFOMSG(
"try to load IBIS alignment data by pdb accession from "<< host << path <<
'?'<< args);
846 ERRORMSG(
"Error getting interaction data by pdb accession from ibis.cgi:\n"<< err);
849ibisSeqAnnot.
Reset();
850 INFOMSG(
" ibis.cgi has no interaction data for MMDB-ID "<<
query.mmdbId <<
", molecule "<<
query.molId <<
" or PDB accession "<<
query.pdb);
852 INFOMSG(
" successfully loaded interaction data from ibis.cgi for PDB accession "<<
query.pdb);
856 INFOMSG(
" ibis.cgi has no interaction data for MMDB-ID "<<
query.mmdbId <<
", molecule "<<
query.molId <<
" (no known PDB accession)");
859 INFOMSG(
" successfully loaded interaction data from ibis.cgi for MMDB-ID "<<
query.mmdbId);
882ncbi::CRef< ncbi::objects::CSeq_annot > ibisInteractions(
new CSeq_annot);
883 if(ibisInteractions.NotEmpty()) {
911ibisInteractions.Reset();
912}
else if(ibisInteractions.NotEmpty()&& ibisInteractions->GetData().IsFtable() && (ibisInteractions->GetData().GetFtable().size() > 0)) {
915CSeq_annot::TData::TFtable::const_iterator fit = seqfeats.begin(), fend = seqfeats.end();
916 for(; fit != fend; ++fit) {
917 if(fit->NotEmpty()) {
925 ERRORMSG(
"Error: allocation failure before trying to contact ibis.cgi.");
940 for(
unsigned i= 0;
i< num && !
result; ++
i) {
951 if(positions.size() == 0)
return0;
954SeqPosSet::const_iterator pcit = positions.begin(), pend = positions.end();
958 while(pcit != pend) {
961 if(pcit != pend && (*pcit ==
last+ 1)) {
969intervals.push_back(interval);
977 returnpositions.size();
983 inteventId =
event.GetId();
1028wxString eventText =
event.GetText();
1047 if(ibisInt.
Empty())
return;
1051 buf.Printf(
wxT(
"(%d) %s [%d in cluster (%4.1f %%id); %d residues]"), (
int) ibisInt->GetType(),
1052ibisInt->GetDesc().c_str(), ibisInt->GetNumMembers(), ibisInt->GetAverageIdentity(), ibisInt->GetNumInterfaceResidues());
1053itemIndex = listCtrl.InsertItem(vecIndex,
buf, -1);
1054 if(itemIndex >= 0) {
1055listCtrl.SetItemData(itemIndex, vecIndex);
1061 if(ibisInt.
Empty())
return;
1068 longitemIndex = listCtrl.InsertItem(vecIndex,
"", -1);
1069 if(itemIndex >= 0) {
1070listCtrl.SetItemData(itemIndex, vecIndex);
1072listCtrl.SetItem(itemIndex, 1,
buf, -1);
1074 if(ibisInt->IsObserved()) {
1075listCtrl.SetItem(itemIndex, 2,
"", 3);
1077 if(ibisInt->IsFiltered()) {
1078listCtrl.SetItem(itemIndex, 3,
"", 2);
1081 buf.Printf(
wxT(
"%s"), ibisInt->GetDesc().c_str());
1082listCtrl.SetItem(itemIndex, 4,
buf);
1090 buf.Printf(
wxT(
"%d"), (
int) ibisInt->GetPositions().size());
1091listCtrl.SetItem(itemIndex, 5,
buf);
1093 buf.Printf(
wxT(
"%d"), ibisInt->GetNumMembers());
1094listCtrl.SetItem(itemIndex, 6,
buf);
1095 buf.Printf(
wxT(
"%4.1f"), ibisInt->GetAverageIdentity());
1096listCtrl.SetItem(itemIndex, 7,
buf);
1098 buf.Printf(
wxT(
"%4.1f"), (
double) ibisInt->GetScore()/10000.0);
1102listCtrl.SetItem(itemIndex, 8,
buf);
1109 if(choiceStr ==
wxT(
"All")) {
1112}
else if(choiceStr.Contains(
wxT(
"Protein-Protein"))) {
1114}
else if(choiceStr.Contains(
wxT(
"Protein-NucAcid"))) {
1118}
else if(choiceStr.Contains(
wxT(
"Protein-Chemical"))) {
1120}
else if(choiceStr.Contains(
wxT(
"Protein-Peptide"))) {
1122}
else if(choiceStr.Contains(
wxT(
"Protein-Ion"))) {
1134CPacked_seqint::Tdata::const_iterator s, se;
1136 offset= (zeroBased) ? 0 : 1;
1138 if(annotSeqLoc.
IsInt()) {
1141 for(pos = from; pos <= to; ++pos) {
1142positions.insert(pos);
1147from = (**s).GetFrom() +
offset;
1148to = (**s).GetTo() +
offset;
1149 for(pos = from; pos <= to; ++pos) {
1150positions.insert(pos);
1159intersection.clear();
1160 if(set1.empty() || set2.empty())
return0;
1162set_intersection(set1.begin(), set1.end(),
1163set2.begin(), set2.end(),
1164inserter(intersection, intersection.begin()));
1166 returnintersection.size();
1173 if(nInteractions == 0)
return;
1175 SeqPosSetannotPositions, overlapPositions;
1177vector< SeqPosSet >& overlaps = annotInfo.
overlaps;
1178CAlign_annot_set::Tdata::const_iterator
a, ae =
annotSet->Get().end();
1181overlaps.resize(nInteractions);
1182 for(
a=
annotSet->Get().begin();
a!=ae; ++
a) {
1184annotInfo.
ptr= (
void*)
a->GetPointer();
1186annotPositions.clear();
1187 if(
a->NotEmpty()) {
1190annotInfo.
nRes= annotPositions.size();
1192 for(
i= 0;
i< nInteractions; ++
i) {
1195overlaps[
i] = overlapPositions;
1214 SeqPosSetannotPositions, annotPositionOverlaps;
1215SeqPosSet::iterator setIt, setEnd;
1218nonOverlaps.clear();
1224nonOverlaps.insert(annotPositions.begin(), annotPositions.end());
1226nonOverlaps.insert(interactionPositions.begin(), interactionPositions.end());
1229setEnd = annotPositionOverlaps.end();
1230 for(setIt = annotPositionOverlaps.begin(); setIt != setEnd; ++setIt) {
1231nonOverlaps.erase(*setIt);
1237 static const doubleoverlapThreshold = 99.0;
1254 boolreadOnly, isIbisAnnot, isFullInteractionAnnotated;
1255 doubleoverlapPercentage;
1256 unsigned int i, ibisIndex, nInteractions, nItems, nOverlaps, nRes, nResIntn;
1257 intselectedVecIndex = -1;
1261wxString annotDescStr, choiceSelectionStr;
1265AnnotIbisOverlapMap::iterator olapIt, olapEnd;
1268choiceSelectionStr = intTypeFilter->GetStringSelection();
1273olapEnd = overlapMap.end();
1274 for(olapIt = overlapMap.begin(); olapIt != olapEnd; ++olapIt) {
1276 if(olapIt->second.nRes == 0)
continue;
1278vector< SeqPosSet >& olaps = olapIt->second.overlaps;
1279 for(
i= 0;
i< olaps.size(); ++
i) {
1280 if(olaps[
i].
size() > 0) {
1281ibisIndexWithOverlap.
insert(
i);
1285ibisIndexEnd = ibisIndexWithOverlap.
end();
1289 if(selectInteraction >= 0) {
1290selectedVecIndex = interactions->GetItemData(selectInteraction);
1291 if(selectedVecIndex < 0 || selectedVecIndex >= (
int) nInteractions) {
1292selectedVecIndex = -1;
1293selectInteraction = -1;
1295selectedVecIndex = -1;
1296selectInteraction = -1;
1302selectInteraction = -1;
1310 if(selectedVecIndex < 0) {
1320interactions->Hide();
1323interactions->DeleteAllItems();
1324 if(interactions->GetWindowStyleFlag() & wxLC_LIST) {
1325 for(
i= 0;
i< nInteractions; ++
i) {
1330}
else if(interactions->GetWindowStyleFlag() & wxLC_REPORT) {
1332 for(
i= 0;
i< nInteractions; ++
i) {
1346 if(selectedVecIndex >= 0) {
1347this->SetEvtHandlerEnabled(
false);
1348nItems = interactions->GetItemCount();
1349 for(
i= 0;
i< nItems; ++
i) {
1350 if((
int) interactions->GetItemData(
i) == selectedVecIndex) {
1351selectInteraction =
i;
1352interactions->SetItemState(
i, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
1356this->SetEvtHandlerEnabled(
true);
1361nItems = interactions->GetItemCount();
1362 for(
i= 0;
i< nItems; ++
i) {
1363ibisIndex = (
unsigned int) interactions->GetItemData(
i);
1364 if(ibisIndexWithOverlap.
find(ibisIndex) != ibisIndexEnd) {
1365interactions->SetItemImage(
i, 4);
1369 for(
i= 0;
i< (
unsigned int) interactions->GetColumnCount(); ++
i) {
1371interactions->SetColumnWidth(
i, wxLIST_AUTOSIZE);
1373interactions->SetColumnWidth(
i, wxLIST_AUTOSIZE_USEHEADER);
1377interactions->Show();
1379 if(selectInteraction >= 0) {
1380interactions->EnsureVisible(selectInteraction);
1387isFullInteractionAnnotated =
false;
1391 if(selectedVecIndex >= 0 && (ibisIndexWithOverlap.
find(selectedVecIndex) != ibisIndexEnd)) {
1393 for(olapIt = overlapMap.begin(); olapIt != olapEnd; ++olapIt) {
1394nOverlaps = olapIt->second.overlaps[selectedVecIndex].size();
1395nRes = olapIt->second.nRes;
1396annotPtr =
reinterpret_cast<CAlign_annot*
>(olapIt->second.ptr);
1397 if(nOverlaps > 0 && annotPtr) {
1399overlapPercentage = (nRes > 0) ? (100.0*nOverlaps)/((double) nRes) : 0.0;
1400isFullInteractionAnnotated = (overlapPercentage >= overlapThreshold);
1404annotDescStr.Printf(
"%s (%d residues; %4.1f%% are overlapped)", annotPtr->
GetDescription().c_str(), nRes, overlapPercentage);
1406annotDescStr.Printf(
"<no description> (%d residues; %4.1f%% are overlapped)", nRes, overlapPercentage);
1408annots->Append(annotDescStr, olapIt->second.ptr);
1414 if(annots->GetCount() == 0) {
1420isIbisAnnot =
false;
1421 if(selectAnnot >= 0) {
1422annots->SetSelection(selectAnnot);
1423annotPtr =
reinterpret_cast<CAlign_annot*
>(annots->GetClientData(selectAnnot));
1426olapIt = overlapMap.find((
unsigned long) annotPtr);
1427 if(selectedVecIndex >= 0 && olapIt != olapEnd) {
1428nOverlaps = olapIt->second.overlaps[selectedVecIndex].size();
1429nRes = olapIt->second.nRes;
1433annots->SetSelection(wxNOT_FOUND);
1445bAddInt->Enable(selectInteraction >= 0 && !isFullInteractionAnnotated && !readOnly);
1446bLaunchInt->Enable(selectInteraction >= 0);
1447bHighlightInt->Enable(selectInteraction >= 0);
1449bDelAnnot->Enable(selectAnnot >= 0 && isIbisAnnot && !readOnly);
1450bHighlightAnnot->Enable(selectAnnot >= 0);
1451bHighlightOlap->Enable(selectAnnot >= 0 && nOverlaps > 0 && (nOverlaps < nRes));
1454bHighlightNoOlapA->Enable(selectAnnot >= 0 && nRes > 0 && (nOverlaps < nRes));
1455bHighlightNoOlapI->Enable(selectAnnot >= 0 && nResIntn > 0 && (nOverlaps < nResIntn));
1457interactions->SetFocus();
1464 boollaunchGeneralUrl =
false;
1466wxString url, pdbQuery;
1469 intindex = interactions->GetItemData(selectedItem);
1471 ERRORMSG(
"IBISAnnotateDialog::LaunchIbisWebPage() - error getting IBIS interaction with index "<< index);
1487launchGeneralUrl =
true;
1489launchGeneralUrl =
true;
1492 if(launchGeneralUrl) {
1499url.Printf(
"https://www.ncbi.nlm.nih.gov/Structure/ibis/ibis.cgi?search=%s", pdbQuery.c_str());
1502url.Printf(
"https://www.ncbi.nlm.nih.gov/Structure/ibis/ibis.cgi?id=%d&type=%d&rowid=%d", ibisInt->GetSdiId(), (
int) ibisInt->GetType(), ibisInt->GetRowId());
1506 if(url.length() > 0) {
1509 ERRORMSG(
"IBISAnnotateDialog::LaunchIbisWebPage() - problem building URL for IBIS interaction with index "<< index);
1517 boolokay =
true, isLocationOK =
false;
1523 if(interactions->GetItemCount() == 0) {
1525}
else if(selectedItem < 0) {
1531 intindex = interactions->GetItemData(selectedItem);
1533 ERRORMSG(
"IBISAnnotateDialog::HighlightAnnotation() - error getting IBIS interaction with index "<< index);
1547}
else if(
location.IsPacked_int()) {
1548CPacked_seqint::Tdata::const_iterator s,
1549se =
location.GetPacked_int().Get().end();
1550 for(s=
location.GetPacked_int().Get().begin(); s!=se; ++s) {
1558wxMessageBox(
"This interaction specifies master residues outside the aligned blocks;" 1559 " see the message log for details.",
"IBIS Annotation Warning",
1560wxOK | wxCENTRE | wxICON_WARNING,
this);
1583 if(itemId == -1)
return;
1587wxString defText = selectedInt->GetDesc().c_str();
1588wxString descr = wxGetTextFromUser(
1589 "Enter a description for the new annotation:",
"Description", defText);
1590 if(descr.size() == 0)
return;
1594annot = selectedInt->ToAlignAnnot();
1595annot->SetDescription(
WX_TO_STD(descr));
1620 if(annots->GetCount() == 0 || annots->GetSelection() < 0)
return;
1623 reinterpret_cast<CAlign_annot*
>(annots->GetClientData(annots->GetSelection()));
1624 if(!selectedAnnot) {
1625 ERRORMSG(
"IBISAnnotateDialog::DeleteAnnotation() - error getting annotation pointer");
1630 intconfirm = wxMessageBox(
"This will remove the selected (putatively IBIS-derived) annotation\n" 1631 "and all evidence associated with it.\nIs this correct?",
"Confirm", wxOK | wxCANCEL | wxCENTRE,
this);
1632 if(confirm != wxOK)
return;
1635CAlign_annot_set::Tdata::iterator
a, ae =
annotSet->Set().end();
1636 for(
a=
annotSet->Set().begin();
a!=ae; ++
a) {
1637 if(*
a== selectedAnnot) {
1658 boolhighlightResult;
1659 boolidMatchResult =
true;
1662 WARNINGMSG(
"interval Seq-id "<< interval.GetId().GetSeqIdString() <<
" does not match master Seq-id");
1663idMatchResult =
false;
1667 return(idMatchResult && highlightResult);
1676 if(annots->GetCount() == 0 || annots->GetSelection() < 0)
return;
1678 reinterpret_cast<CAlign_annot*
>(annots->GetClientData(annots->GetSelection()));
1679 if(!selectedAnnot) {
1680 ERRORMSG(
"IBISAnnotateDialog::HighlightAnnotation() - error getting annotation pointer");
1691CPacked_seqint::Tdata::iterator s,
1692se = selectedAnnot->
SetLocation().SetPacked_int().Set().end();
1693 for(s=selectedAnnot->
SetLocation().SetPacked_int().Set().begin(); s!=se; ++s) {
1704 intindex = interactions->GetItemData(selectedItem);
1706 if(selectedItem < 0) {
1709 ERRORMSG(
"IBISAnnotateDialog::HighlightAnnotation() - error getting IBIS interaction "<< index <<
" for overlap calculation");
1715IntervalList::iterator intIt, intEnd;
1722intEnd = intervals.end();
1723 for(intIt = intervals.begin(); intIt != intEnd; ++intIt) {
1728 ERRORMSG(
"IBISAnnotateDialog::HighlightAnnotation() - invalid event id "<< eventId);
1732wxMessageBox(
"WARNING: this annotation specifies master residues outside the aligned blocks;" 1733 " see the message log for details.",
"Annotation Error",
1734wxOK | wxCENTRE | wxICON_ERROR,
this);
1747wxBoxSizer *item0 =
newwxBoxSizer( wxVERTICAL );
1749wxFlexGridSizer *item1 =
newwxFlexGridSizer( 1, 0, 0, 0 );
1750item1->AddGrowableCol( 1 );
1752wxStaticBox *item3 =
newwxStaticBox( parent, -1,
wxT(
"IBIS Interactions") );
1753wxStaticBoxSizer *item2 =
newwxStaticBoxSizer( item3, wxVERTICAL );
1756wxFlexGridSizer *item4 =
newwxFlexGridSizer( 1, 0, 0, 0 );
1758wxStaticText *item5 =
newwxStaticText( parent,
ID_TEXT_INT,
wxT(
"Interaction Type Filter"), wxDefaultPosition, wxDefaultSize, 0 );
1759item4->Add( item5, 0, wxALIGN_CENTER|wxALL, 5 );
1764 wxT(
"Protein-Protein"),
1765 wxT(
"Protein-NucAcid"),
1766 wxT(
"Protein-Chemical"),
1767 wxT(
"Protein-Peptide"),
1768 wxT(
"Protein-Ion")
1770wxChoice *item6 =
newwxChoice( parent,
ID_C_TYPE, wxDefaultPosition, wxSize(100,-1), 6, strs6, 0 );
1771item4->Add( item6, 0, wxALIGN_CENTER|wxALL, 5 );
1773item2->Add( item4, 0, wxALIGN_CENTER|wxALL, 5 );
1775wxListCtrl *item7 =
newwxListCtrl( parent,
ID_LC_INT, wxDefaultPosition, wxSize(450,150), wxLC_REPORT|wxLC_SINGLE_SEL|wxSUNKEN_BORDER );
1776item2->Add( item7, 0, wxALIGN_CENTER|wxALL, 5 );
1778wxFlexGridSizer *item8 =
newwxFlexGridSizer( 3, 0, 0 );
1780wxButton *item9 =
newwxButton( parent,
ID_B_ADD_INT,
wxT(
"Make IBIS Annotation"), wxDefaultPosition, wxDefaultSize, 0 );
1781item8->Add( item9, 0, wxALIGN_CENTER|wxALL, 5 );
1783wxButton *item10 =
newwxButton( parent,
ID_B_LAUNCH_INT,
wxT(
"Launch"), wxDefaultPosition, wxDefaultSize, 0 );
1784item8->Add( item10, 0, wxALIGN_CENTER|wxALL, 5 );
1786wxButton *item11 =
newwxButton( parent,
ID_B_HIGHLIGHT_INT,
wxT(
"Highlight"), wxDefaultPosition, wxDefaultSize, 0 );
1787item8->Add( item11, 0, wxALIGN_CENTER|wxALL, 5 );
1789item2->Add( item8, 0, wxALIGN_CENTER|wxALL, 5 );
1791item1->Add( item2, 0, wxALIGN_CENTER|wxALL, 5 );
1793wxStaticBox *item13 =
newwxStaticBox( parent, -1,
wxT(
"Overlapping Annotations") );
1794wxStaticBoxSizer *item12 =
newwxStaticBoxSizer( item13, wxVERTICAL );
1796item12->Add( 20, 10, 0, wxALIGN_CENTER|wxALL, 5 );
1802wxListBox *item14 =
newwxListBox( parent,
ID_LB_ANNOT, wxDefaultPosition, wxSize(275,100), 1, strs14, wxLB_SINGLE );
1803item12->Add( item14, 0, wxALIGN_CENTER|wxALL, 5 );
1805wxFlexGridSizer *item15 =
newwxFlexGridSizer( 3, 0, 0 );
1809 wxT(
"IBIS Annotation"),
1810wxDefaultPosition, wxDefaultSize, 0 );
1811item15->Add( item16, 0, wxALIGN_CENTER|wxALL, 5 );
1814 wxT(
"Highlight\n")
1815 wxT(
"Annotation"),
1816wxDefaultPosition, wxDefaultSize, 0 );
1817item15->Add( item17, 0, wxALIGN_CENTER|wxALL, 5 );
1820 wxT(
"Highlight\n")
1822wxDefaultPosition, wxDefaultSize, 0 );
1823item15->Add( item18, 0, wxALIGN_CENTER|wxALL, 5 );
1825item12->Add( item15, 0, wxALIGN_CENTER|wxALL, 5 );
1827wxFlexGridSizer *item19 =
newwxFlexGridSizer( 2, 0, 0 );
1830 wxT(
"Highlight Non-Overlap\n")
1831 wxT(
"of Annotation"),
1832wxDefaultPosition, wxDefaultSize, 0 );
1833item19->Add( item20, 0, wxALIGN_CENTER|wxALL, 5 );
1836 wxT(
"Highlight Non-Overlap\n")
1837 wxT(
"of Interaction"),
1838wxDefaultPosition, wxDefaultSize, 0 );
1839item19->Add( item21, 0, wxALIGN_CENTER|wxALL, 5 );
1841item12->Add( item19, 0, wxALIGN_CENTER|wxALL, 5 );
1843item1->Add( item12, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
1845item0->Add( item1, 0, wxALIGN_CENTER|wxALL, 5 );
1849parent->SetSizer( item0 );
1851item0->SetSizeHints( parent );
User-defined methods of the data storage class.
User-defined methods of the data storage class.
bool GetAsnDataViaHTTPS(const std::string &host, const std::string &path, const std::string &args, ASNClass *asnObject, std::string *err, bool binaryData=true)
wxSizer * SetupIbisAnnotationDialog(wxWindow *parent, bool call_fit=TRUE, bool set_sizer=TRUE)
#define ID_B_HIGHLIGHT_NONOLAP_ANNOT
#define DECLARE_AND_FIND_WINDOW_RETURN_ON_ERR(var, id, type)
bool DoesInteractionMatchChoice(const wxString &choiceStr, IBISInteraction::eIbisInteractionType ibisIntType)
static const string IBIS_EVIDENCE_COMMENT
long GetFirstSelectedListCtrlItemId(const wxListCtrl &listCtrl)
static unsigned int GetSetIntersection(const SeqPosSet &set1, const SeqPosSet &set2, SeqPosSet &intersection)
void GetPositionsForAlignAnnot(const CAlign_annot &annot, SeqPosSet &positions, bool zeroBased)
#define ID_B_HIGHLIGHT_INT
#define ID_B_DELETE_ANNOT
void InsertItemInListView(int vecIndex, const CRef< IBISInteraction > &ibisInt, wxListCtrl &listCtrl)
wxSizer * ibisIntStaticBoxSizer
static bool GetInteractionDataFromIbis(CSeq_annot &ibisSeqAnnot, IbisQuery &query)
unsigned int GetAllSelectedListCtrlItemIds(const wxListCtrl &listCtrl, vector< long > &ids)
void InsertItemInReportView(int vecIndex, const CRef< IBISInteraction > &ibisInt, wxListCtrl &listCtrl)
#define ID_B_HIGHLIGHT_OLAP
#define ID_B_HIGHLIGHT_NONOLAP_INTN
#define ID_B_HIGHLIGHT_ANNOT
std::set< ncbi::TSeqPos > SeqPosSet
const BlockMultipleAlignment * GetCurrentMultipleAlignment(void) const
const Sequence * GetMaster(void) const
bool HighlightAlignedColumnsOfMasterRange(unsigned int from, unsigned int to) const
bool IsAligned(unsigned int row, unsigned int seqIndex) const
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
~IBISAnnotateDialog(void)
void DeleteAnnotation(void)
void HighlightAnnotation(int eventId)
void LaunchIbisWebPage(void)
void OnListCtrlSelection(wxListEvent &event)
void PopulateInteractionData(void)
void OnListBoxSelection(wxCommandEvent &event)
void GetAnnotIbisNonOverlaps(const IBISInteraction &interaction, const ncbi::objects::CAlign_annot &annot, SeqPosSet &nonOverlaps, bool onAnnotation) const
std::list< ncbi::CRef< ncbi::objects::CSeq_interval > > IntervalList
void MakeAnnotationFromInteraction(void)
void GetAnnotIbisOverlaps(AnnotIbisOverlapMap &aioMap) const
IBISAnnotateDialog ** dialogHandle
void HighlightInteraction(void)
void OnButton(wxCommandEvent &event)
std::vector< ncbi::CRef< IBISInteraction > > vecIbisInteractions
void SetupGUIControls(int selectInteraction, int selectAnnot, unsigned int updateFlags=eRemakeListCtrl|eRemakeListBox)
bool HighlightInterval(const ncbi::objects::CSeq_interval &interval)
bool HasInteractionData(void) const
std::map< unsigned long, AlignAnnotInfo > AnnotIbisOverlapMap
StructureSet * structureSet
unsigned int GetIntervalsForSet(const SeqPosSet &positions, IntervalList &intervals)
ncbi::CRef< ncbi::objects::CAlign_annot_set > annotSet
void OnChoice(wxCommandEvent &event)
void OnCloseWindow(wxCloseEvent &event)
static const MoleculeIdentifier * GetQueryMolecule()
IBISInteraction(const ncbi::objects::CSeq_feat &seqfeat)
eIbisInteractionType m_type
bool GetGi(TGi &gi) const
static std::string IbisIntTypeToString(eIbisInteractionType ibisType)
static bool QueryMoleculeHasChain()
static const Sequence * m_querySequence
static const MoleculeIdentifier * m_queryMolecule
static void SetQuerySequence(const Sequence *querySequence)
ncbi::objects::CSeq_feat m_seqfeat
const ncbi::objects::CSeq_loc & GetLocation(bool &isOK) const
static eIbisInteractionType CddIntTypeToIbisIntType(eCddInteractionType cddType)
static const int NOT_ASSIGNED
ncbi::CRef< ncbi::objects::CAlign_annot > ToAlignAnnot(void) const
static bool IsIbisIntType(int integer, eIbisInteractionType *ibisType=NULL)
@ eIbisProteinCombo_DNA_RNA
const SeqPosSet & GetPositions(void) const
bool GetFootprint(int &from, int &to) const
static const TGi GI_NOT_ASSIGNED
static eCddInteractionType IbisIntTypeToCddIntType(eIbisInteractionType ibisType)
bool RemoveAllHighlights(bool postRedraws)
bool MatchesSeqId(const ncbi::objects::CSeq_id &sid) const
static const int VALUE_NOT_SET
bool HasStructure(void) const
std::string ToString(void) const
void FillOutSeqId(ncbi::objects::CSeq_id *sid) const
const MoleculeIdentifier * identifier
unsigned int Length(void) const
static const unsigned int eUserAnnotationData
AlignmentManager * alignmentManager
void SetDataChanged(unsigned int what) const
iterator_bool insert(const value_type &val)
const_iterator find(const key_type &key) const
const_iterator end() const
Include a standard set of the NCBI C++ Toolkit most basic headers.
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)
static const char location[]
unsigned int TSeqPos
Type for sequence locations and lengths.
bool Match(const CSeq_id &sid2) const
Match() - TRUE if SeqIds are equivalent.
void Reset(void)
Reset reference object.
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty â pointing to an object and has a non-null value.
bool Empty(void) const THROWS_NONE
Check if CRef is empty â not pointing to any object, which means having a null value.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_SCOPE(ns)
Define a new scope.
string AsString(const CTimeFormat &format=kEmptyStr, TSeconds out_tz=eCurrentTimeZone) const
Transform time to string.
static CTimeFormat GetPredefined(EPredefined fmt, TFlags flags=fDefault)
Get predefined format.
@ eCurrent
Use current time. See also CCurrentTime.
@ eISO8601_DateTimeMin
Y-M-DTh:m (eg 1997-07-16T19:20)
static const char label[]
const TDescription & GetDescription(void) const
Get the Description member data.
list< CRef< CFeature_evidence > > TEvidence
bool IsSetType(void) const
for typing annotated features 0 .
void SetLocation(TLocation &value)
Assign a value to Location data member.
const TLocation & GetLocation(void) const
Get the Location member data.
bool IsSetDescription(void) const
to hold descriptions/names like "Heme binding site" or "catalytic triad" etc., something that should ...
vector< CRef< CUser_field > > TData
void SetTo(TTo value)
Assign a value to To data member.
list< CRef< CSeq_interval > > Tdata
const Tdata & Get(void) const
Get the member data.
void SetId(TId &value)
Assign a value to Id data member.
TFrom GetFrom(void) const
Get the From member data.
void SetFrom(TFrom value)
Assign a value to From data member.
TGi GetGi(void) const
Get the variant data.
bool IsPacked_int(void) const
Check if variant Packed_int is selected.
bool IsGi(void) const
Check if variant Gi is selected.
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 TPacked_int & GetPacked_int(void) const
Get the variant data.
virtual void Reset(void)
Reset the whole object.
const TFtable & GetFtable(void) const
Get the variant data.
list< CRef< CSeq_feat > > TFtable
bool IsFtable(void) const
Check if variant Ftable is selected.
const TData & GetData(void) const
Get the Data member data.
unsigned int
A callback function used to compare two keys in a database.
Messenger * GlobalMessenger(void)
double value_type
The numeric datatype used by the parser.
const struct ncbi::grid::netcache::search::fields::SIZE size
#define TRUE
bool replacment for C indicating true.
std::vector< SeqPosSet > overlaps
string ToString(const wxRect &rc)
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