include/algo/align/util/blast_tabular.hpp

Go to the documentation of this file.
00001 #ifndef ALGO_ALIGN_UTIL_BLAST_TABULAR__HPP
00002 #define ALGO_ALIGN_UTIL_BLAST_TABULAR__HPP
00003 
00004 /* $Id: blast_tabular.hpp 159919 2009-05-11 14:19:26Z kapustin $
00005 * ===========================================================================
00006 *
00007 *                            public DOMAIN NOTICE                          
00008 *               National Center for Biotechnology Information
00009 *                                                                          
00010 *  This software/database is a "United States Government Work" under the   
00011 *  terms of the United States Copyright Act.  It was written as part of    
00012 *  the author's official duties as a United States Government employee and 
00013 *  thus cannot be copyrighted.  This software/database is freely available 
00014 *  to the public for use. The National Library of Medicine and the U.S.    
00015 *  Government have not placed any restriction on its use or reproduction.  
00016 *                                                                          
00017 *  Although all reasonable efforts have been taken to ensure the accuracy  
00018 *  and reliability of the software and data, the NLM and the U.S.          
00019 *  Government do not and cannot warrant the performance or results that    
00020 *  may be obtained by using this software or data. The NLM and the U.S.    
00021 *  Government disclaim all warranties, express or implied, including       
00022 *  warranties of performance, merchantability or fitness for any particular
00023 *  purpose.                                                                
00024 *                                                                          
00025 *  Please cite the author in any work or product based on this material.   
00026 *
00027 * ===========================================================================
00028 *
00029 * Author:  Yuri Kapustin
00030 *
00031 * File Description:
00032 *   CBlastTabular (a.k.a "m8") format representation
00033 *
00034 */
00035 
00036 #include <corelib/ncbistd.hpp>
00037 #include <objects/seqalign/Std_seg.hpp>
00038 #include <algo/align/util/align_shadow.hpp>
00039 
00040 BEGIN_NCBI_SCOPE
00041 
00042 
00043 class  CBlastTabular: public CAlignShadow
00044 {
00045 public:
00046 
00047     typedef CAlignShadow TParent;
00048     typedef TParent::TCoord TCoord;
00049 
00050     // c'tors
00051     CBlastTabular(void) {};
00052 
00053     CBlastTabular(const objects::CSeq_align& seq_align, bool save_xcript = false);
00054 
00055     CBlastTabular(const TId& idquery, TCoord qstart, bool qstrand,
00056                   const TId& idsubj, TCoord sstart, bool sstrand,
00057                   const string& xcript);
00058 
00059     CBlastTabular(const char* m8, bool force_local_ids = false);
00060 
00061     /// Construct CBlastTabular from m8 line,
00062     /// use score_func to select seq-id from FASTA-style ids  
00063     typedef int (*SCORE_FUNC)(const CRef<objects::CSeq_id>& id);
00064     CBlastTabular(const char* m8, SCORE_FUNC score_func);
00065 
00066     // getters / setters
00067     void   SetLength(TCoord length);
00068     TCoord GetLength(void) const;
00069 
00070     void   SetMismatches(TCoord mismatches);
00071     TCoord GetMismatches(void) const;
00072 
00073     void   SetGaps(TCoord gaps);
00074     TCoord GetGaps(void) const;
00075 
00076     void   SetEValue(double evalue);
00077     double GetEValue(void) const;
00078 
00079     void   SetIdentity(float identity);
00080     float  GetIdentity(void) const;
00081 
00082     void   SetScore(float evalue);
00083     float  GetScore(void) const;
00084 
00085     virtual void Modify(Uint1 where, TCoord new_pos);
00086 
00087 protected:
00088     
00089     TCoord  m_Length;     // length of the alignment           
00090     TCoord  m_Mismatches; // number of mismatches              
00091     TCoord  m_Gaps;       // number of gap openings            
00092     double  m_EValue;     // e-Value                           
00093     float   m_Identity;   // Percent identity (ranging from 0 to 1)
00094     float   m_Score;      // bit score
00095 
00096     template <class F>
00097     void   x_Deserialize(const char* m8, F seq_id_extractor);
00098 
00099     virtual void   x_PartialSerialize(CNcbiOstream& os) const;
00100     virtual void   x_PartialDeserialize(const char* m8);
00101 
00102     static void sx_MineSegment(size_t where, const objects::CStd_seg::TLoc & locs,
00103                                TSeqPos * delta, TSeqPos * prev);
00104 };
00105 
00106 
00107 /////////////////////////////////////////////////////////////////////////////
00108 ////////////////////////////////////////////////////////////////////////////
00109 
00110 END_NCBI_SCOPE
00111 
00112 #endif /* ALGO_ALIGN_UTIL_BLAST_TABULAR__HPP  */
00113 
00114 

Generated on Sun Dec 6 21:55:32 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Dec 07 16:20:32 2009 by modify_doxy.py rev. 173732