alnvec_row_handle.hpp
上传用户:yhdzpy8989
上传日期:2007-06-13
资源大小:13604k
文件大小:6k
- /*
- * ===========================================================================
- * PRODUCTION $Log: alnvec_row_handle.hpp,v $
- * PRODUCTION Revision 1000.1 2004/04/12 18:16:07 gouriano
- * PRODUCTION PRODUCTION: UPGRADED [CATCHUP_003] Dev-tree R1.4
- * PRODUCTION
- * ===========================================================================
- */
- #ifndef GUI_WIDGETS_ALN_MULTIPLE___ALNVEC_ROW_HANDLE__HPP
- #define GUI_WIDGETS_ALN_MULTIPLE___ALNVEC_ROW_HANDLE__HPP
- /* $Id: alnvec_row_handle.hpp,v 1000.1 2004/04/12 18:16:07 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: Andrey Yazhuk
- *
- * File Description:
- *
- */
- #include <corelib/ncbiobj.hpp>
- #include <objtools/alnmgr/alnvec.hpp>
- #include <gui/widgets/aln_multiple/alnmulti_ds.hpp>
- BEGIN_NCBI_SCOPE
- /// CAlnVecRowHandle is inherited from IAlignRowHandle and represents a row
- /// of CAlnVec-based alignment.
- class CAlnVecRowHandle : public IAlignRowHandle
- {
- public:
- typedef objects::CAlnVec TAlnVec;
- typedef TAlnVec::TNumrow TNumrow;
- typedef TAlnVec::TRange TRange;
- typedef TAlnVec::TSignedRange TSignedRange;
- CAlnVecRowHandle(const TAlnVec* aln_vec, TNumrow row)
- : m_AlnVec(aln_vec), m_Row(row) {}
- TNumrow GetRowNum() const;
- const objects::CBioseq_Handle& GetBioseqHandle() const;
-
- TSignedSeqPos GetSeqAlnStart() const;
- TSignedSeqPos GetSeqAlnStop() const;
- TSignedRange GetSeqAlnRange() const;
- TSignedSeqPos GetSeqStop() const;
- bool IsNegativeStrand() const;
- string& GetSeqString (string &buffer, const TRange &seq_rng) const;
- string& GetAlnSeqString(string &buffer, const TSignedRange &aln_rng) const;
- TSignedSeqPos GetAlnPosFromSeqPos(TSeqPos seq_pos,
- TAlnVec::ESearchDirection dir = TAlnVec::eNone,
- bool try_reverse_dir = true) const;
- TSignedSeqPos GetSeqPosFromAlnPos(TSeqPos aln_pos,
- TAlnVec::ESearchDirection dir = TAlnVec::eNone,
- bool try_reverse_dir = true) const;
-
- CRef<TAlnVec::CAlnChunkVec> GetAlnChunks(const TSignedRange& range,
- TAlnVec::TGetChunkFlags flags) const;
- protected:
- const objects::CAlnVec* m_AlnVec;
- TNumrow m_Row;
- };
- inline CAlnVecRowHandle::TNumrow CAlnVecRowHandle::GetRowNum() const
- {
- return m_Row;
- }
- inline const objects::CBioseq_Handle& CAlnVecRowHandle::GetBioseqHandle() const
- {
- return m_AlnVec->GetBioseqHandle(m_Row);
- }
- inline TSignedSeqPos CAlnVecRowHandle::GetSeqAlnStart() const
- {
- return m_AlnVec->GetSeqAlnStart(m_Row);
- }
- inline TSignedSeqPos CAlnVecRowHandle::GetSeqAlnStop() const
- {
- return m_AlnVec->GetSeqAlnStop(m_Row);
- }
- inline TSignedSeqPos CAlnVecRowHandle::GetSeqStop() const
- {
- return m_AlnVec->GetSeqStop(m_Row);
- }
- inline bool CAlnVecRowHandle::IsNegativeStrand() const
- {
- return m_AlnVec->IsNegativeStrand(m_Row);
- }
- inline CAlnVecRowHandle::TSignedRange CAlnVecRowHandle::GetSeqAlnRange() const
- {
- return m_AlnVec->GetSeqAlnRange(m_Row);
- }
- inline string& CAlnVecRowHandle::GetSeqString (string &buffer,
- const TRange &seq_rng) const
- {
- return m_AlnVec->GetSeqString(buffer, m_Row, seq_rng);
- }
- inline string & CAlnVecRowHandle::GetAlnSeqString(string &buffer,
- const TSignedRange &aln_rng) const
- {
- return m_AlnVec->GetAlnSeqString(buffer, m_Row, aln_rng);
- }
- inline TSignedSeqPos CAlnVecRowHandle::GetAlnPosFromSeqPos(TSeqPos seq_pos,
- TAlnVec::ESearchDirection dir,
- bool try_reverse_dir) const
- {
- return m_AlnVec->GetAlnPosFromSeqPos(m_Row, seq_pos, dir, try_reverse_dir);
- }
-
- inline TSignedSeqPos CAlnVecRowHandle::GetSeqPosFromAlnPos (TSeqPos aln_pos,
- TAlnVec::ESearchDirection dir,
- bool try_reverse_dir) const
- {
- return m_AlnVec->GetSeqPosFromAlnPos(m_Row, aln_pos, dir, try_reverse_dir);
- }
- inline CRef<CAlnVecRowHandle::TAlnVec::CAlnChunkVec>
- CAlnVecRowHandle::GetAlnChunks(const TSignedRange& range,
- TAlnVec::TGetChunkFlags flags) const
- {
- return m_AlnVec->GetAlnChunks(m_Row, range, flags);
- }
- END_NCBI_SCOPE
- /*
- * ===========================================================================
- * $Log: alnvec_row_handle.hpp,v $
- * Revision 1000.1 2004/04/12 18:16:07 gouriano
- * PRODUCTION: UPGRADED [CATCHUP_003] Dev-tree R1.4
- *
- * Revision 1.4 2004/03/08 17:15:04 yazhuk
- * Added GetAlnPosFromSeqPos()
- *
- * Revision 1.3 2004/03/02 15:11:21 yazhuk
- * Added IsNegativeStrand()
- *
- * Revision 1.2 2004/01/08 19:38:48 yazhuk
- * Added GetSeqString()
- *
- * Revision 1.1 2003/10/29 23:29:38 yazhuk
- * Initial revision
- *
- * ===========================================================================
- */
- #endif // GUI_WIDGETS_ALN_MULTIPLE___ALNVEC_ROW_HANDLE__HPP