update_viewer.hpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:8k
- /*
- * ===========================================================================
- * PRODUCTION $Log: update_viewer.hpp,v $
- * PRODUCTION Revision 1000.1 2004/04/12 17:34:36 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [CATCHUP_003] Dev-tree R1.25
- * PRODUCTION
- * ===========================================================================
- */
- /* $Id: update_viewer.hpp,v 1000.1 2004/04/12 17:34:36 gouriano Exp $
- * ===========================================================================
- *
- * PUBLIC DOMAIN NOTICE
- * National Center for Biotechnology Information
- *
- * This software/database is a "United States Government Work" under the
- * terms of the United States Copyright Act. It was written as part of
- * the author's official duties as a United States Government employee and
- * thus cannot be copyrighted. This software/database is freely available
- * to the public for use. The National Library of Medicine and the U.S.
- * Government have not placed any restriction on its use or reproduction.
- *
- * Although all reasonable efforts have been taken to ensure the accuracy
- * and reliability of the software and data, the NLM and the U.S.
- * Government do not and cannot warrant the performance or results that
- * may be obtained by using this software or data. The NLM and the U.S.
- * Government disclaim all warranties, express or implied, including
- * warranties of performance, merchantability or fitness for any particular
- * purpose.
- *
- * Please cite the author in any work or product based on this material.
- *
- * ===========================================================================
- *
- * Authors: Paul Thiessen
- *
- * File Description:
- * implementation of non-GUI part of update viewer
- *
- * ===========================================================================
- */
- #ifndef CN3D_UPDATE_VIEWER__HPP
- #define CN3D_UPDATE_VIEWER__HPP
- #include <corelib/ncbistl.hpp>
- #include <objects/mmdb1/Biostruc.hpp>
- #include <objects/mmdb3/Biostruc_feature.hpp>
- #include <list>
- #include "viewer_base.hpp"
- BEGIN_SCOPE(Cn3D)
- class UpdateViewerWindow;
- class BlockMultipleAlignment;
- class AlignmentManager;
- class Sequence;
- class StructureSet;
- class UpdateViewer : public ViewerBase
- {
- friend class UpdateViewerWindow;
- friend class SequenceDisplay;
- public:
- UpdateViewer(AlignmentManager *alnMgr);
- ~UpdateViewer(void);
- void CreateUpdateWindow(void); // (re)creates the window
- // add new pairwise alignments to the update window
- typedef std::list < BlockMultipleAlignment * > AlignmentList;
- void AddAlignments(const AlignmentList& alignmentList);
- // replace contents of update window with given alignments
- void ReplaceAlignments(const AlignmentList& alignmentList);
- // delete a single alignment
- void DeleteAlignment(BlockMultipleAlignment *toDelete);
- // import
- void ImportSequences(void);
- void ImportStructure(void);
- // turns the current alignments+display into the "initial state" (the bottom) of the undo stack
- void SetInitialState(void);
- // functions to save edited data
- void SaveDialog(bool prompt);
- void SaveAlignments(void);
- // run BLAST on given pairwise alignment - if BLAST is successful, then alignment will be
- // replaced with the result, otherwise the alignment is left unchanged
- void BlastUpdate(BlockMultipleAlignment *alignment, bool usePSSMFromMultiple);
- // find alignment of nearest BLAST-2-sequences neighbor in the multiple, and use this as
- // a guide alignment to align this update with the multiple's master
- void BlastNeighbor(BlockMultipleAlignment *update);
- // save pending structures
- void SavePendingStructures(void);
- // sort updates
- void SortByIdentifier(void);
- private:
- UpdateViewerWindow *updateWindow;
- const Sequence * GetMasterSequence(void) const;
- typedef std::list < const Sequence * > SequenceList;
- void FetchSequencesViaHTTP(SequenceList *newSequences, StructureSet *sSet) const;
- void ReadSequencesFromFile(SequenceList *newSequences, StructureSet *sSet) const;
- void FetchSequences(StructureSet *sSet, SequenceList *newSequences) const;
- void SortUpdates(void);
- void MakeEmptyAlignments(const SequenceList& newSequences,
- const Sequence *master, AlignmentList *newAlignments) const;
- typedef std::list < ncbi::CRef < ncbi::objects::CBiostruc > > BiostrucList;
- BiostrucList pendingStructures;
- typedef struct {
- ncbi::CRef < ncbi::objects::CBiostruc_feature > structureAlignment;
- int masterDomainID, slaveDomainID;
- } StructureAlignmentInfo;
- typedef std::list < StructureAlignmentInfo > PendingStructureAlignments;
- PendingStructureAlignments pendingStructureAlignments;
- void GetVASTAlignments(const SequenceList& newSequences,
- const Sequence *master, AlignmentList *newAlignments,
- PendingStructureAlignments *structureAlignments,
- int masterFrom = -1, int masterTo = -1) const; // -1 means unrestricted
- };
- END_SCOPE(Cn3D)
- #endif // CN3D_UPDATE_VIEWER__HPP
- /*
- * ---------------------------------------------------------------------------
- * $Log: update_viewer.hpp,v $
- * Revision 1000.1 2004/04/12 17:34:36 gouriano
- * PRODUCTION: UPGRADED [CATCHUP_003] Dev-tree R1.25
- *
- * Revision 1.25 2004/02/19 17:05:21 thiessen
- * remove cn3d/ from include paths; add pragma to disable annoying msvc warning
- *
- * Revision 1.24 2003/03/14 19:48:51 thiessen
- * allow multiple gi's in network sequence import dialog
- *
- * Revision 1.23 2003/02/03 19:20:08 thiessen
- * format changes: move CVS Log to bottom of file, remove std:: from .cpp files, and use new diagnostic macros
- *
- * Revision 1.22 2003/01/23 20:03:05 thiessen
- * add BLAST Neighbor algorithm
- *
- * Revision 1.21 2002/10/27 22:23:51 thiessen
- * save structure alignments from vastalign.cgi imports
- *
- * Revision 1.20 2002/10/25 19:00:02 thiessen
- * retrieve VAST alignment from vastalign.cgi on structure import
- *
- * Revision 1.19 2002/09/30 17:13:02 thiessen
- * change structure import to do sequences as well; change cache to hold mimes; change block aligner vocabulary; fix block aligner dialog bugs
- *
- * Revision 1.18 2002/09/16 21:24:58 thiessen
- * add block freezing to block aligner
- *
- * Revision 1.17 2002/09/09 13:38:23 thiessen
- * separate save and save-as
- *
- * Revision 1.16 2002/08/13 20:46:37 thiessen
- * add global block aligner
- *
- * Revision 1.15 2002/07/26 15:28:48 thiessen
- * add Alejandro's block alignment algorithm
- *
- * Revision 1.14 2002/06/05 14:28:41 thiessen
- * reorganize handling of window titles
- *
- * Revision 1.13 2002/03/28 14:06:02 thiessen
- * preliminary BLAST/PSSM ; new CD startup style
- *
- * Revision 1.12 2002/02/13 14:53:30 thiessen
- * add update sort
- *
- * Revision 1.11 2002/02/12 17:19:23 thiessen
- * first working structure import
- *
- * Revision 1.10 2001/10/01 16:03:58 thiessen
- * make CDD annotation window non-modal; add SetWindowTitle to viewers
- *
- * Revision 1.9 2001/09/27 15:36:48 thiessen
- * decouple sequence import and BLAST
- *
- * Revision 1.8 2001/09/18 03:09:38 thiessen
- * add preliminary sequence import pipeline
- *
- * Revision 1.7 2001/05/02 13:46:15 thiessen
- * major revision of stuff relating to saving of updates; allow stored null-alignments
- *
- * Revision 1.6 2001/04/19 12:58:25 thiessen
- * allow merge and delete of individual updates
- *
- * Revision 1.5 2001/04/05 22:54:51 thiessen
- * change bg color handling ; show geometry violations
- *
- * Revision 1.4 2001/04/04 00:27:22 thiessen
- * major update - add merging, threader GUI controls
- *
- * Revision 1.3 2001/03/22 00:32:36 thiessen
- * initial threading working (PSSM only); free color storage in undo stack
- *
- * Revision 1.2 2001/03/13 01:24:16 thiessen
- * working undo system for >1 alignment (e.g., update window)
- *
- * Revision 1.1 2001/03/09 15:48:44 thiessen
- * major changes to add initial update viewer
- *
- */