NCBI C++ ToolKit
update_viewer.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: update_viewer.hpp 33815 2007-05-04 17:18:18Z kazimird $
2 * ===========================================================================
3 *
4 * PUBLIC DOMAIN NOTICE
5 * National Center for Biotechnology Information
6 *
7 * This software/database is a "United States Government Work" under the
8 * terms of the United States Copyright Act. It was written as part of
9 * the author's official duties as a United States Government employee and
10 * thus cannot be copyrighted. This software/database is freely available
11 * to the public for use. The National Library of Medicine and the U.S.
12 * Government have not placed any restriction on its use or reproduction.
13 *
14 * Although all reasonable efforts have been taken to ensure the accuracy
15 * and reliability of the software and data, the NLM and the U.S.
16 * Government do not and cannot warrant the performance or results that
17 * may be obtained by using this software or data. The NLM and the U.S.
18 * Government disclaim all warranties, express or implied, including
19 * warranties of performance, merchantability or fitness for any particular
20 * purpose.
21 *
22 * Please cite the author in any work or product based on this material.
23 *
24 * ===========================================================================
25 *
26 * Authors: Paul Thiessen
27 *
28 * File Description:
29 * implementation of non-GUI part of update viewer
30 *
31 * ===========================================================================
32 */
33 
34 #ifndef CN3D_UPDATE_VIEWER__HPP
35 #define CN3D_UPDATE_VIEWER__HPP
36 
37 #include <corelib/ncbistd.hpp>
38 #include <corelib/ncbi_limits.hpp>
39 
42 
43 #include <list>
44 
45 #include "viewer_base.hpp"
46 
47 
48 BEGIN_SCOPE(Cn3D)
49 
50 class UpdateViewerWindow;
52 class AlignmentManager;
53 class Sequence;
54 class StructureSet;
55 
56 class UpdateViewer : public ViewerBase
57 {
58  friend class UpdateViewerWindow;
59  friend class SequenceDisplay;
60 
61 public:
62 
64  ~UpdateViewer(void);
65 
66  void CreateUpdateWindow(void); // (re)creates the window
67 
68  // add new pairwise alignments to the update window
69  typedef std::list < BlockMultipleAlignment * > AlignmentList;
70  void AddAlignments(const AlignmentList& alignmentList);
71 
72  // replace contents of update window with given alignments
73  void ReplaceAlignments(const AlignmentList& alignmentList);
74 
75  // delete a single alignment
77 
78  // import
79  void ImportSequences(void);
80  void ImportStructure(void);
81 
82  // turns the current alignments+display into the "initial state" (the bottom) of the undo stack
83  void SetInitialState(void);
84 
85  // functions to save edited data
86  void SaveDialog(bool prompt);
87  void SaveAlignments(void);
88 
89  // run BLAST on given pairwise alignment - if BLAST is successful, then alignment will be
90  // replaced with the result, otherwise the alignment is left unchanged
91  void BlastUpdate(BlockMultipleAlignment *alignment, bool usePSSMFromMultiple);
92 
93  // find alignment of nearest BLAST-2-sequences neighbor in the multiple, and use this as
94  // a guide alignment to align this update with the multiple's master
96 
97  // save pending structures
98  void SavePendingStructures(void);
99 
100  // sort updates
101  void SortByIdentifier(void);
102  void SortByPSSM(void);
103 
104 private:
106 
107  const Sequence * GetMasterSequence(void) const;
108  typedef std::list < const Sequence * > SequenceList;
109  void FetchSequencesViaHTTP(SequenceList *newSequences, StructureSet *sSet) const;
110  void ReadSequencesFromFile(SequenceList *newSequences, StructureSet *sSet) const;
111  void FetchSequences(StructureSet *sSet, SequenceList *newSequences) const;
112 
113  void SortUpdates(void);
114  void MakeEmptyAlignments(const SequenceList& newSequences,
115  const Sequence *master, AlignmentList *newAlignments) const;
116 
117  typedef std::list < ncbi::CRef < ncbi::objects::CBiostruc > > BiostrucList;
119  typedef struct {
120  ncbi::CRef < ncbi::objects::CBiostruc_feature > structureAlignment;
121  int masterDomainID, dependentDomainID;
123  typedef std::list < StructureAlignmentInfo > PendingStructureAlignments;
125 
126  void GetVASTAlignments(const SequenceList& newSequences,
127  const Sequence *master, AlignmentList *newAlignments,
128  PendingStructureAlignments *structureAlignments,
129  unsigned int masterFrom = kMax_UInt, unsigned int masterTo = kMax_UInt) const; // kMax_UInt means unrestricted
130 };
131 
132 END_SCOPE(Cn3D)
133 
134 #endif // CN3D_UPDATE_VIEWER__HPP
User-defined methods of the data storage class.
User-defined methods of the data storage class.
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 SortUpdates(void)
void SortByPSSM(void)
void ImportStructure(void)
const Sequence * GetMasterSequence(void) const
void SaveDialog(bool prompt)
std::list< ncbi::CRef< ncbi::objects::CBiostruc > > BiostrucList
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
UpdateViewer(AlignmentManager *alnMgr)
void ImportSequences(void)
void BlastNeighbor(BlockMultipleAlignment *update)
BiostrucList pendingStructures
std::list< const Sequence * > SequenceList
void SetInitialState(void)
void SortByIdentifier(void)
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define kMax_UInt
Definition: ncbi_limits.h:185
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
ncbi::CRef< ncbi::objects::CBiostruc_feature > structureAlignment
Modified on Sun Apr 14 05:25:04 2024 by modify_doxy.py rev. 669887