91 #include <wx/tokenzr.h>
107 InitData(&emptyAlignmentList, blankDisplay);
150 AlignmentList::const_iterator
a, ae = newAlignments.end();
151 for (
a=newAlignments.begin();
a!=ae; ++
a) {
152 if ((*a)->NRows() != 2) {
153 ERRORMSG(
"UpdateViewer::AddAlignments() - got alignment with " << (*a)->NRows() <<
" rows");
158 alignments.push_back(*
a);
164 for (
unsigned int row=0; row<2; ++row)
168 if (alignments.size() > 0)
169 display->
SetStartingColumn(alignments.front()->GetFirstAlignedBlockPosition() - 5);
190 keepAlignments.push_back((*a)->Clone());
207 if ((*a)->NRows() != 2) {
208 ERRORMSG(
"CreateSeqAlignFromUpdate() - can only save pairwise updates");
212 (*a)->GetUngappedAlignedBlocks(&
blocks);
214 if (!newSeqAlign)
continue;
217 CUpdate_align *updateAlign = (*a)->updateOrigin.GetPointer();
224 ERRORMSG(
"UpdateViewer::SaveAlignments() - confused by Update-align format");
234 updateAlign->
SetType((*a)->GetSequenceOfRow(1)->molecule ?
239 comment->
SetComment(
"Created by demotion or import in Cn3D");
245 seqAnnotRef->
SetData().SetAlign();
250 if (!updateAlign || !(seqAlignList = &(updateAlign->
SetSeqannot().SetData().SetAlign()))) {
251 ERRORMSG(
"UpdateViewer::SaveAlignments() - can't find Update-align and/or Seq-align list");
257 if (usedUpdateAligns.
find(updateAlign) == usedUpdateAligns.
end()) {
258 seqAlignList->clear();
259 updates.resize(updates.size() + 1);
260 updates.back().Reset(updateAlign);
261 usedUpdateAligns[updateAlign] =
true;
265 seqAlignList->resize(seqAlignList->size() + 1);
266 seqAlignList->back().Reset(newSeqAlign);
288 vector < const Sequence * > chains;
290 if (chains.size() == 1) {
293 wxString *titles =
new wxString[chains.size()];
295 for (choice=0; choice<(
int)chains.size(); ++choice)
296 titles[choice] = chains[choice]->identifier->ToString().c_str();
297 choice = wxGetSingleChoiceIndex(
"Align to which protein chain?",
298 "Select Chain", chains.size(), titles);
300 master = chains[choice];
307 ERRORMSG(
"UpdateViewer::GetMasterSequence() - no master sequence defined");
314 wxGetTextFromUser(
"Enter a list of protein GIs or Accessions:",
316 if (ids.size() == 0)
return;
318 wxStringTokenizer tkz(ids,
" ,;\t\r\n", wxTOKEN_STRTOK);
319 while (tkz.HasMoreTokens()) {
320 wxString
id = tkz.GetNextToken();
327 newSequences->push_back(sequence);
329 ERRORMSG(
"The sequence must be a protein");
336 newSequences->clear();
338 wxString fastaFile = wxFileSelector(
"Choose a FASTA file from which to import",
339 "",
"",
"",
"*.*", wxFD_OPEN | wxFD_FILE_MUST_EXIST, *
viewerWindow);
340 if (fastaFile.size() > 0) {
345 ERRORMSG(
"Unable to open file " << fastaFile.c_str());
358 newSequences->push_back(sequence);
362 if (!(*b)->IsSeq()) {
363 WARNINGMSG(
"CFastaReader returned nested Bioseq-set");
367 newSequences->push_back(sequence);
371 WARNINGMSG(
"CFastaReader returned unknown format or no Bioseqs");
380 (*seqs)[1] = dependent;
384 ERRORMSG(
"MakeEmptyAlignment() - error finalizing alignment");
394 newAlignments->clear();
395 SequenceList::const_iterator s, se = newSequences.end();
396 for (s=newSequences.begin(); s!=se; ++s) {
398 if (newAlignment) newAlignments->push_back(newAlignment);
405 static const wxString choiceStrings[] = {
"Network via GI/Accession",
"From a FASTA File" };
406 enum choiceValues { FROM_GI=0, FROM_FASTA, N_CHOICES };
407 int importFrom = wxGetSingleChoiceIndex(
"From what source would you like to import sequences?",
408 "Select Import Source", N_CHOICES, choiceStrings, *
viewerWindow);
409 if (importFrom < 0)
return;
412 if (importFrom == FROM_GI)
416 else if (importFrom == FROM_FASTA)
429 if (newSequences.size() == 0) {
430 WARNINGMSG(
"UpdateViewer::ImportSequence() - no sequences were imported");
439 if (newAlignments.size() > 0)
442 ERRORMSG(
"UpdateViewer::ImportSequence() - no new alignments were created");
448 unsigned int masterFrom,
unsigned int masterTo)
const
451 WARNINGMSG(
"UpdateViewer::GetVASTAlignments() - "
456 SequenceList::const_iterator s, se = newSequences.end();
457 for (s=newSequences.begin(); s!=se; ++s) {
458 if ((*s)->identifier->pdbID.size() == 0) {
459 WARNINGMSG(
"UpdateViewer::GetVASTAlignments() - "
460 "can't be called with non-MMDB dependent " << (*s)->identifier->ToString());
462 if (newAlignment) newAlignments->push_back(newAlignment);
468 host =
"www.ncbi.nlm.nih.gov",
469 path =
"/Structure/VA/vastalign.cgi", err;
472 <<
"&neighbor=" << (*s)->identifier->ToString();
473 if (masterFrom <= masterTo && masterFrom < master->Length() && masterTo < master->Length())
474 argstr <<
"&from=" << (masterFrom+1) <<
"&to=" << (masterTo+1);
479 INFOMSG(
"trying to load VAST alignment data from " << host << path <<
'?' << args);
482 ERRORMSG(
"Error calling vastalign.cgi: " << err);
484 if (newAlignment) newAlignments->push_back(newAlignment);
487 INFOMSG(
"successfully loaded data from vastalign.cgi");
489 WriteASNToFile(
"vastalign.dat.txt", structureAlignment,
false, &err);
500 if (structureAlignment.
IsSetId() && structureAlignment.
GetId().front()->IsMmdb_id() &&
501 structureAlignment.
GetId().front()->GetMmdb_id().Get() == 0)
503 WARNINGMSG(
"VAST found no alignment for these chains");
508 if (!structureAlignment.
IsSetId() || !structureAlignment.
GetId().front()->IsMmdb_id() ||
510 structureAlignment.
GetFeatures().front()->GetFeatures().size() != 1 ||
511 !structureAlignment.
GetFeatures().front()->GetFeatures().front()->IsSetLocation() ||
512 !structureAlignment.
GetFeatures().front()->GetFeatures().front()->GetLocation().IsAlignment())
514 throw "VAST data does not contain exactly one alignment of recognized format - "
515 "possibly a problem with vastalign.cgi";
519 throw "Master structure MMDB ID mismatch - check to see if this structure been updated";
523 structureAlignment.
GetFeatures().front()->GetFeatures().front()->GetLocation().GetAlignment();
529 alignment.
GetBiostruc_ids().back()->GetMmdb_id().Get() != (*s)->identifier->mmdbID ||
531 !alignment.
GetAlignment().front()->GetResidues().IsInterval() ||
533 !alignment.
GetAlignment().back()->GetResidues().IsInterval() ||
534 alignment.
GetAlignment().front()->GetResidues().GetInterval().size() !=
535 alignment.
GetAlignment().back()->GetResidues().GetInterval().size())
537 throw "Unrecognized VAST data format";
541 CResidue_pntrs::TInterval::const_iterator
i, j,
542 ie = alignment.
GetAlignment().front()->GetResidues().GetInterval().end();
543 for (
i=alignment.
GetAlignment().front()->GetResidues().GetInterval().begin(),
544 j=alignment.
GetAlignment().back()->GetResidues().GetInterval().begin();
i!=ie; ++
i, ++j)
547 (*j)->GetMolecule_id().Get() != (*s)->identifier->moleculeID)
549 throw "Mismatch in molecule ids in alignment interval block";
552 newBlock->
SetRangeOfRow(0, (*i)->GetFrom().Get() - 1, (*i)->GetTo().Get() - 1);
553 newBlock->
SetRangeOfRow(1, (*j)->GetFrom().Get() - 1, (*j)->GetTo().Get() - 1);
554 newBlock->
width = (*i)->GetTo().Get() - (*i)->GetFrom().Get() + 1;
561 structureAlignments->resize(structureAlignments->size() + 1);
562 structureAlignments->back().structureAlignment =
563 structureAlignment.
SetFeatures().front()->SetFeatures().front();
564 structureAlignments->back().masterDomainID =
565 structureAlignment.
GetFeatures().front()->GetId().Get();
566 structureAlignments->back().dependentDomainID =
567 structureAlignment.
GetFeatures().front()->GetFeatures().front()->GetId().Get();
569 throw "No structure alignment in VAST data blob";
571 }
catch (
const char *err) {
572 ERRORMSG(
"Failed to import VAST alignment: " << err);
577 ERRORMSG(
"MakeEmptyAlignment() - error finalizing alignment");
581 newAlignments->push_back(newAlignment);
591 ERRORMSG(
"Can't import another structure when current structure has multiple models");
596 static const wxString choiceStrings[] = {
"Via Network",
"From a File" };
597 enum choiceValues { FROM_NETWORK=0, FROM_FILE, N_CHOICES };
598 int importFrom = wxGetSingleChoiceIndex(
599 "From what source would you like to import the structure?",
"Select Import Source",
601 if (importFrom < 0)
return;
606 if (importFrom == FROM_NETWORK) {
607 wxString
id = wxGetTextFromUser(
"Enter a PDB or MMDB ID:",
"Input Identifier",
"", *
viewerWindow);
612 biostruc, &bioseqs)) {
613 ERRORMSG(
"Failed to load structure " <<
id.c_str());
618 else if (importFrom == FROM_FILE) {
619 string filename =
WX_TO_STD(wxFileSelector(
"Choose a single-structure file:",
621 if (filename.size() == 0)
return;
624 TRACEMSG(
"trying to read file '" << filename <<
"' as binary mime");
631 TRACEMSG(
"trying to read file '" << filename <<
"' as ascii mime");
639 ERRORMSG(
"Couldn't read structure from " << filename);
647 if (biostruc->
GetId().size() == 0 || !biostruc->
GetId().front()->IsMmdb_id()) {
648 ERRORMSG(
"Can't get MMDB ID from loaded structure");
651 mmdbID = biostruc->
GetId().front()->GetMmdb_id().Get();
655 if (biostruc->
GetModel().size() != 1 ||
660 ERRORMSG(
"Biostruc does not match current data - should be "
667 vector < pair < const CSeq_id * , string > > chains;
669 CBiostruc_graph::TDescr::const_iterator d, de;
670 CBiostruc_graph::TMolecule_graphs::const_iterator
673 bool isProtein =
false;
676 string full_name =
"";
679 de = (*m)->GetDescr().end();
680 for (d=(*m)->GetDescr().begin(); d!=de; ++d) {
681 if ((*d)->IsName()) {
682 full_name = (*d)->GetName();
683 name = (*d)->GetName()[0];
685 else if ((*d)->IsMolecule_type() &&
688 if (isProtein && (full_name !=
""))
break;
692 if ((*m)->IsSetSeq_id())
693 sid = &((*m)->GetSeq_id());
696 if (isProtein && (full_name !=
"" ) && sid !=
NULL) {
697 moleculeIDs[sid] = (*m)->GetId().Get();
698 chains.push_back(make_pair(sid, full_name));
701 if (chains.size() == 0) {
702 ERRORMSG(
"No protein chains found in this structure!");
708 CBiostruc::TDescr::const_iterator
n,
ne = biostruc->
GetDescr().end();
710 if ((*n)->IsName()) {
711 pdbID = (*n)->GetName();
717 vector < const CSeq_id * > sids;
718 vector < string > sids_chain_ids;
719 if (chains.size() == 1) {
720 sids.push_back(chains[0].
first);
721 sids_chain_ids.push_back(chains[0].second);
723 wxString *choices =
new wxString[chains.size()];
725 for (choice=0; choice<(
int)chains.size(); ++choice)
726 choices[choice].Printf(
"%s_%s %s",
727 pdbID.c_str(), chains[choice].second, chains[choice].first->GetSeqIdString().c_str());
728 wxArrayInt selections;
730 int nsel = wxGetSelectedChoices(selections,
"Which chain(s) do you want to align?",
732 if (nsel == 0)
return;
733 for (choice = 0; choice < nsel; ++choice) {
734 sids.push_back(chains[selections[choice]].
first);
735 sids_chain_ids.push_back(chains[selections[choice]].second);
742 for (
unsigned int j=0; j<sids.size(); ++j) {
746 if ((*s)->identifier->MatchesSeqId(*(sids[j]))) {
748 newSequences.push_back(*s);
749 seq2id[*s] = sids[j];
756 BioseqRefList::iterator
b, be = bioseqs.end();
757 for (
b=bioseqs.begin();
b!=be; ++
b) {
758 CBioseq::TId::const_iterator
i, ie = (*b)->GetId().end();
759 for (
i=(*b)->GetId().begin();
i!=ie; ++
i) {
760 if ((*i)->Match(*(sids[j])))
811 newSequences.push_back(sequence);
812 seq2id[sequence] = sids[j];
824 SequenceList::const_iterator w, we = newSequences.end();
825 for (w=newSequences.begin(); w!=we; ++w) {
828 (*w)->AddMMDBAnnotTag(mmdbID);
834 if ((*w)->identifier->mmdbID != mmdbID)
835 ERRORMSG(
"MMDB ID mismatch in sequence " << (*w)->identifier->ToString()
836 <<
"; " << (*w)->identifier->mmdbID <<
" vs " << mmdbID);
838 if (moleculeIDs.
find(seq2id[*w]) != moleculeIDs.
end()) {
841 moleculeIDs[seq2id[*w]];
843 if ((*w)->identifier->moleculeID != moleculeIDs[seq2id[*w]])
844 ERRORMSG(
"Molecule ID mismatch in sequence " << (*w)->identifier->ToString());
847 ERRORMSG(
"No matching id for MMDB sequence " << (*w)->identifier->ToString());
853 int masterFrom = -1, masterTo = -1;
858 if (aBlocks.size() > 0) {
859 masterFrom = aBlocks.front()->GetRangeOfRow(0)->from;
860 masterTo = aBlocks.back()->GetRangeOfRow(0)->to;
866 SequenceList::const_iterator s, se = newSequences.end();
867 for (s=newSequences.begin(); s!=se; ++s) {
876 ERRORMSG(
"ImportStructure() - error finalizing alignment");
880 newAlignments.push_back(newAlignment);
885 if (newAlignments.size() == newSequences.size())
888 ERRORMSG(
"UpdateViewer::ImportStructure() - no new alignments were created");
896 wxMessageBox(
"The structure has been successfully imported! However, it will not appear until you\n"
897 "save this data to a file and then re-load it in a new session. And depending on the type\n"
898 "of data, it still might not appear unless the corresponding new pairwise alignment has\n"
899 "been merged into the multiple alignment.",
900 "Structure Added", wxOK | wxICON_INFORMATION, *
viewerWindow);
903 wxMessageBox(
"The selected sequence from this structure has been imported! However, the structure\n"
904 "itself can not appear in the structure window until the sequence has been merged into the\n"
905 "multiple alignment and the alignment has been remastered to a structured sequence.",
906 "Sequence Added", wxOK | wxICON_INFORMATION, *
viewerWindow);
912 TRACEMSG(
"saving pending imported structures and structure alignments");
920 ERRORMSG(
"UpdateViewer::SavePendingStructures() - error saving Biostruc");
936 if (usePSSMFromMultiple && !multipleForPSSM) {
937 ERRORMSG(
"Can't do BLAST/PSSM when no multiple alignment is present");
944 if (*
a != alignment)
continue;
948 toRealign.push_back(alignment);
951 multipleForPSSM, toRealign, &newAlignments, usePSSMFromMultiple);
952 if (newAlignments.size() != 1) {
953 ERRORMSG(
"UpdateViewer::BlastUpdate() - CreateNewPairwiseAlignmentsByBlast() failed");
956 if (newAlignments.front()->NAlignedBlocks() == 0) {
958 delete newAlignments.front();
963 TRACEMSG(
"BLAST succeeded - replacing alignment");
965 *
a = newAlignments.front();
978 int dependentRow, vector < int > *dependent2master)
980 dependent2master->clear();
984 BlockMultipleAlignment::UngappedAlignedBlockList::const_iterator
b, be = uaBlocks.end();
985 for (
b=uaBlocks.begin();
b!=be; ++
b) {
987 *masterRange = (*b)->GetRangeOfRow(0),
988 *dependentRange = (*b)->GetRangeOfRow(dependentRow);
989 for (
unsigned int i=0;
i<(*b)->width; ++
i)
990 (*dependent2master)[dependentRange->from +
i] = masterRange->
from +
i;
998 if (rowAlignments.size() != multiple->
NRows()) {
999 ERRORMSG(
"GetAlignmentByBestNeighbor: wrong # alignments");
1005 unsigned int b, bestRow = 0;
1006 BLASTer::AlignmentList::const_iterator p, pe = rowAlignments.end();
1007 for (
b=0, p=rowAlignments.begin(); p!=pe; ++
b, ++p) {
1009 bestMatchFromMultiple = *p;
1013 if (!bestMatchFromMultiple || bestMatchFromMultiple->
GetRowDouble(0) > 0.000001) {
1014 WARNINGMSG(
"GetAlignmentByBestNeighbor: no significant hit found");
1017 INFOMSG(
"Closest neighbor from multiple: sequence "
1019 <<
", E-value: " << bestMatchFromMultiple->
GetRowDouble(0));
1025 if (bestRow == 0)
return bestMatchFromMultiple->
Clone();
1028 vector < int > import2dependent, dependent2master;
1035 (*seqs)[1] = importSeq;
1040 int masterStart=-1, importStart, importLoc, dependentLoc, masterLoc,
len=0;
1041 for (importStart=-1, importLoc=0; importLoc<=(
int)importSeq->
Length(); ++importLoc) {
1044 dependentLoc = (importLoc < (
int)importSeq->
Length()) ? import2dependent[importLoc] : -1;
1045 masterLoc = (dependentLoc >= 0) ? dependent2master[dependentLoc] : -1;
1048 if (importStart >= 0) {
1051 if (masterLoc >= 0 && masterLoc-masterStart == importLoc-importStart) {
1067 if (importStart < 0) {
1068 if (masterLoc >= 0) {
1069 masterStart = masterLoc;
1070 importStart = importLoc;
1078 ERRORMSG(
"error finalizing alignment");
1079 delete newAlignment;
1083 return newAlignment;
1090 ERRORMSG(
"Can't do BLAST Neighbor when no multiple alignment is present");
1095 if (uaBlocks.size() == 0) {
1096 ERRORMSG(
"Can't do BLAST Neighbor with null multiple alignment");
1104 if (*
a == update)
break;
1109 for (
unsigned int row=0; row<multiple->
NRows(); ++row) {
1113 (*seqs)[1] = updateSeq;
1120 WARNINGMSG(
"Can't get footprint excess residues from registry");
1121 newAlignment->
alignMasterFrom = uaBlocks.front()->GetRangeOfRow(row)->from - excess;
1124 newAlignment->
alignMasterTo = uaBlocks.back()->GetRangeOfRow(row)->to + excess;
1125 if (newAlignment->
alignMasterTo >= ((
int)((*seqs)[0]->Length())))
1129 toRealign.push_back(newAlignment);
1131 ERRORMSG(
"error finalizing alignment");
1132 delete newAlignment;
1139 if (
result.size() != 1) {
1140 ERRORMSG(
"UpdateViewer::BlastUpdate() - CreateNewPairwiseAlignmentsByBlast() failed");
1143 newAlignments.push_back(
result.front());
1149 if (!alignmentByNeighbor) {
1153 TRACEMSG(
"BLAST Neighbor succeeded - replacing alignment");
1155 *
a = alignmentByNeighbor;
1171 a->GetSequenceOfRow(1)->identifier,
1172 b->GetSequenceOfRow(1)->identifier);
1178 return (
a->GetRowDouble(0) >
b->GetRowDouble(0));
1185 TRACEMSG(
"sorting updates by identifier");
1192 TRACEMSG(
"sorting updates by PSSM");
1196 ERRORMSG(
"Can't do sort by PSSM when no multiple alignment is present");
1204 const Sequence *updateSeq = (*a)->GetSequenceOfRow(1);
1206 (*a)->GetUngappedAlignedBlocks(&uaBlocks);
1207 BlockMultipleAlignment::UngappedAlignedBlockList::const_iterator
b, be = uaBlocks.end();
1211 for (
b=uaBlocks.begin();
b!=be; ++
b) {
1212 const Block::Range *m = (*b)->GetRangeOfRow(0), *u = (*b)->GetRangeOfRow(1);
1213 for (
unsigned int i=0;
i<(*b)->width; ++
i)
1214 score += multiple->
GetPSSM().GetPSSMScore(
1220 (*a)->SetRowStatusLine(0,
string(
"Score vs. PSSM: ") +
NStr::IntToString(score));
1221 (*a)->SetRowStatusLine(1, (*a)->GetRowStatusLine(0));
1222 (*a)->SetRowDouble(0, score);
1223 (*a)->SetRowDouble(1, score);
1233 ERRORMSG(
"UpdateViewer::SortUpdates() - must first set comparison function");
1254 for (
i=0;
i<sortedVector.size(); ++
i) sortedList.push_back(sortedVector[
i]);
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.
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.
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.
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.
User-defined methods of the data storage class.
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)
bool GetStructureProteins(std::vector< const Sequence * > *chains) const
const BlockMultipleAlignment * GetCurrentMultipleAlignment(void) const
void ReplaceUpdatesInASN(ncbi::objects::CCdd::TPending &newUpdates) const
std::list< BlockMultipleAlignment * > AlignmentList
void CreateNewPairwiseAlignmentsByBlast(const BlockMultipleAlignment *multiple, const AlignmentList &toRealign, AlignmentList *newAlignments, bool usePSSM)
BlockMultipleAlignment * Clone(void) const
std::vector< const Sequence * > SequenceList
const BLAST_Matrix * GetPSSM(void) const
const Sequence * GetMaster(void) const
std::vector< const UngappedAlignedBlock * > UngappedAlignedBlockList
const Sequence * GetSequenceOfRow(unsigned int row) const
void GetUngappedAlignedBlocks(UngappedAlignedBlockList *blocks) const
unsigned int NRows(void) const
double GetRowDouble(unsigned int row) const
bool UpdateBlockMapAndColors(bool clearRowInfo=true)
bool AddUnalignedBlocks(void)
bool AddAlignedBlockAtEnd(UngappedAlignedBlock *newBlock)
void SetRangeOfRow(unsigned int row, int from, int to)
Base class for reading FASTA sequences.
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
Simple implementation of ILineReader for i(o)streams.
void PostRedrawSequenceViewer(ViewerBase *viewer)
bool RemoveAllHighlights(bool postRedraws)
void UnPostRedrawSequenceViewer(ViewerBase *viewer)
void AddHighlights(const Sequence *sequence, unsigned int seqIndexFrom, unsigned int seqIndexTo)
static bool CompareIdentifiers(const MoleculeIdentifier *a, const MoleculeIdentifier *b)
static const int VALUE_NOT_SET
std::string ToString(void) const
void AddRowFromAlignment(unsigned int row, BlockMultipleAlignment *fromAlignment)
unsigned int NRows(void) const
void AddRowFromString(const std::string &anyString)
unsigned int GetStartingColumn(void) const
void AddBlockBoundaryRow(BlockMultipleAlignment *forAlignment)
void SetStartingColumn(unsigned int column)
const Molecule * molecule
const MoleculeIdentifier * identifier
unsigned int Length(void) const
bool AddBiostrucToASN(ncbi::objects::CBiostruc *biostruc)
const Sequence * FindOrCreateSequence(ncbi::objects::CBioseq &bioseq)
const SequenceSet * sequenceSet
void AddStructureAlignment(ncbi::objects::CBiostruc_feature *feature, int masterDomainID, int dependentDomainID)
AlignmentManager * alignmentManager
bool SaveDialog(bool prompt, bool canCancel)
void BlastUpdate(BlockMultipleAlignment *alignment, bool usePSSMFromMultiple)
void FetchSequencesViaHTTP(SequenceList *newSequences, StructureSet *sSet) const
void GetVASTAlignments(const SequenceList &newSequences, const Sequence *master, AlignmentList *newAlignments, PendingStructureAlignments *structureAlignments, unsigned int masterFrom=kMax_UInt, unsigned int masterTo=kMax_UInt) const
void SavePendingStructures(void)
void FetchSequences(StructureSet *sSet, SequenceList *newSequences) const
void ReplaceAlignments(const AlignmentList &alignmentList)
void AddAlignments(const AlignmentList &alignmentList)
void ImportStructure(void)
const Sequence * GetMasterSequence(void) const
void SaveDialog(bool prompt)
void SaveAlignments(void)
std::list< BlockMultipleAlignment * > AlignmentList
UpdateViewerWindow * updateWindow
void DeleteAlignment(BlockMultipleAlignment *toDelete)
void ReadSequencesFromFile(SequenceList *newSequences, StructureSet *sSet) const
PendingStructureAlignments pendingStructureAlignments
std::list< StructureAlignmentInfo > PendingStructureAlignments
void CreateUpdateWindow(void)
void MakeEmptyAlignments(const SequenceList &newSequences, const Sequence *master, AlignmentList *newAlignments) const
void ImportSequences(void)
friend class UpdateViewerWindow
void BlastNeighbor(BlockMultipleAlignment *update)
BiostrucList pendingStructures
std::list< const Sequence * > SequenceList
void SetInitialState(void)
void SortByIdentifier(void)
AlignmentList currentAlignments
AlignmentManager * alignmentManager
SequenceDisplay * GetCurrentDisplay(void)
ViewerWindowBase **const viewerWindow
const AlignmentList & GetCurrentAlignments(void) const
void NewDisplay(SequenceDisplay *display, bool enableSelectByColumn)
void ScrollToColumn(int column)
void UpdateDisplay(SequenceDisplay *display)
bool GeometryViolationsShown(void) const
const_iterator end() const
const_iterator find(const key_type &key) const
bool ExtractBiostrucAndBioseqs(CNcbi_mime_asn1 &mime, CRef< CBiostruc > &biostruc, BioseqRefList *sequences)
CNcbi_mime_asn1 * LoadStructureViaCache(const std::string &uid, ncbi::objects::EModel_type modelType, int assemblyId)
std::list< ncbi::CRef< ncbi::objects::CBioseq > > BioseqRefList
string GetSeqIdString(const CSeq_id &id)
Include a standard set of the NCBI C++ Toolkit most basic headers.
static bool ReadASNFromFile(const char *filename, ASNClass *ASNobject, bool isBinary, std::string *err)
static bool WriteASNToFile(const char *filename, const ASNClass &ASNobject, bool isBinary, std::string *err, ncbi::EFixNonPrint fixNonPrint=ncbi::eFNP_Default)
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
Operators to edit gaps in sequences.
EDiagSev SetDiagPostLevel(EDiagSev post_sev=eDiag_Error)
Set the threshold severity for posting the messages.
@ eDiag_Info
Informational message.
@ eDiag_Error
Error message.
@ eDiag_Fatal
Fatal error – guarantees exit(or abort)
CRef< CSeq_entry > ReadSet(int max_seqs=kMax_Int, ILineErrorListener *pMessageListener=nullptr)
Read multiple sequences (by default, as many as are available.)
@ fAssumeProt
Assume prots unless accns indicate otherwise.
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
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.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
const TMolecule_graphs & GetMolecule_graphs(void) const
Get the Molecule_graphs member data.
TDimension GetDimension(void) const
Get the Dimension member data.
const TTransform & GetTransform(void) const
Get the Transform member data.
const TBiostruc_ids & GetBiostruc_ids(void) const
Get the Biostruc_ids member data.
const TAlignment & GetAlignment(void) const
Get the Alignment member data.
@ eModel_type_ncbi_all_atom
@ eModel_type_ncbi_backbone
TFeatures & SetFeatures(void)
Assign a value to Features data member.
const TFeatures & GetFeatures(void) const
Get the Features member data.
const TId & GetId(void) const
Get the Id member data.
const TModel & GetModel(void) const
Get the Model member data.
bool IsSetId(void) const
Check if a value has been assigned to Id data member.
const TId & GetId(void) const
Get the Id member data.
const TChemical_graph & GetChemical_graph(void) const
Get the Chemical_graph member data.
const TDescr & GetDescr(void) const
Get the Descr member data.
const TDescription & GetDescription(void) const
Get the Description member data.
list< CRef< CUpdate_align > > TPending
TComment & SetComment(void)
Select the variant.
bool IsSetSeqannot(void) const
contains the SeqAlign Check if a value has been assigned to Seqannot data member.
const TSeqannot & GetSeqannot(void) const
Get the Seqannot member data.
void SetType(TType value)
Assign a value to Type data member.
void SetSeqannot(TSeqannot &value)
Assign a value to Seqannot data member.
TDescription & SetDescription(void)
Assign a value to Description data member.
TSet & SetSet(void)
Select the variant.
const TSet & GetSet(void) const
Get the variant data.
bool IsSeq(void) const
Check if variant Seq is selected.
bool IsSet(void) const
Check if variant Set is selected.
const TSeq_set & GetSeq_set(void) const
Get the Seq_set member data.
TSeq & SetSeq(void)
Select the variant.
TSeq_set & SetSeq_set(void)
Assign a value to Seq_set data member.
bool IsAlign(void) const
Check if variant Align is selected.
void SetData(TData &value)
Assign a value to Data data member.
list< CRef< CSeq_align > > TAlign
const TData & GetData(void) const
Get the Data member data.
unsigned int
A callback function used to compare two keys in a database.
Lightweight interface for getting lines of data with minimal memory copying.
Messenger * GlobalMessenger(void)
const struct ncbi::grid::netcache::search::fields::SIZE size
The NCBI C++/STL use hints.
bool ne(T x_, T y_, T round_)
std::istream & in(std::istream &in_, double &x_)
void copy(Njn::Matrix< S > *matrix_, const Njn::Matrix< T > &matrix0_)
static DP_BlockInfo * blocks
ncbi::objects::CSeq_align * CreatePairwiseSeqAlignFromMultipleRow(const BlockMultipleAlignment *multiple, const BlockMultipleAlignment::UngappedAlignedBlockList &blocks, unsigned int slaveRow)
#define DELETE_ALL_AND_CLEAR(container, ContainerType)
unsigned char LookupNCBIStdaaNumberFromCharacter(char r)
static bool CompareUpdatesByIdentifier(BlockMultipleAlignment *a, BlockMultipleAlignment *b)
static BlockMultipleAlignment * MakeEmptyAlignment(const Sequence *master, const Sequence *dependent)
static CompareUpdates updateComparisonFunction
static bool CompareUpdatesByScore(BlockMultipleAlignment *a, BlockMultipleAlignment *b)
bool(* CompareUpdates)(BlockMultipleAlignment *a, BlockMultipleAlignment *b)
static BlockMultipleAlignment * GetAlignmentByBestNeighbor(const BlockMultipleAlignment *multiple, const BLASTer::AlignmentList rowAlignments)
static void MapDependentToMaster(const BlockMultipleAlignment *alignment, int dependentRow, vector< int > *dependent2master)