include/algo/align/ngalign/result_set.hpp

Go to the documentation of this file.
00001 #ifndef NGALIGN_RESULT_SET__HPP
00002 #define NGALIGN_RESULT_SET__HPP
00003 
00004 /*  $Id: result_set.hpp 170087 2009-09-08 20:52:21Z boukn $
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  * Authors:  Nathan Bouk
00030  *
00031  * File Description:
00032  *
00033  */
00034 
00035 #include <corelib/ncbistd.hpp>
00036 #include <corelib/ncbiobj.hpp>
00037 #include <objects/seqloc/Na_strand.hpp>
00038 
00039 #include <objects/seqloc/Seq_loc.hpp>
00040 #include <objects/seqloc/Seq_id.hpp>
00041 #include <objmgr/scope.hpp>
00042 
00043 #include <algo/align/util/align_filter.hpp>
00044 
00045 
00046 
00047 BEGIN_NCBI_SCOPE
00048 
00049 BEGIN_SCOPE(objects)
00050     class CScope;
00051     class CSeq_align;
00052     class CSeq_align_set;
00053     class CSeq_id;
00054 END_SCOPE(objects)
00055 
00056 BEGIN_SCOPE(blast)
00057     class SSeqLoc;
00058     class CSearchResultSet;
00059     class CSearchResults;
00060 END_SCOPE(blast)
00061 
00062 
00063 
00064 class CQuerySet : public CObject
00065 {
00066 public:
00067     typedef map<string, CRef<objects::CSeq_align_set> > TSubjectToAlignSet;
00068 
00069     CQuerySet(const blast::CSearchResults& Results);
00070     CQuerySet(const objects::CSeq_align_set& Results);
00071 
00072     TSubjectToAlignSet& Get() { return m_SubjectMap; }
00073     const TSubjectToAlignSet& Get() const { return m_SubjectMap; }
00074 
00075     CRef<objects::CSeq_align_set> ToSeqAlignSet() const;
00076     CRef<objects::CSeq_align_set> ToBestSeqAlignSet() const;
00077 
00078     CConstRef<objects::CSeq_id> GetQueryId() const { return m_QueryId; }
00079 
00080     void Insert(CRef<CQuerySet> QuerySet);
00081     void Insert(const objects::CSeq_align_set& AlignSet);
00082 
00083     // gets the rank of the best (lowest) ranked alignment in this query set
00084     int GetBestRank() const;
00085 
00086 private:
00087 
00088     TSubjectToAlignSet m_SubjectMap;
00089     CRef<objects::CSeq_id> m_QueryId;
00090 
00091     bool x_AlreadyContains(const objects::CSeq_align_set& Set,
00092                            const objects::CSeq_align& New) const;
00093 };
00094 
00095 
00096 class CAlignResultsSet : public CObject
00097 {
00098 public:
00099     typedef map<string, CRef<CQuerySet> > TQueryToSubjectSet;
00100 
00101     CAlignResultsSet() { ; }
00102     CAlignResultsSet(const blast::CSearchResultSet& BlastResults);
00103 
00104     TQueryToSubjectSet& Get() { return m_QueryMap; }
00105     const TQueryToSubjectSet& Get() const { return m_QueryMap; }
00106 
00107     bool QueryExists(const objects::CSeq_id& Id) const;
00108     CRef<CQuerySet> GetQuerySet(const objects::CSeq_id& Id);
00109     CConstRef<CQuerySet> GetQuerySet(const objects::CSeq_id& Id) const;
00110 
00111 
00112     CRef<objects::CSeq_align_set> ToSeqAlignSet() const;
00113     CRef<objects::CSeq_align_set> ToBestSeqAlignSet() const;
00114 
00115     void Insert(CRef<CQuerySet> QuerySet);
00116     void Insert(CRef<CAlignResultsSet> AlignSet);
00117     void Insert(const blast::CSearchResultSet& BlastResults);
00118 
00119     size_t size() const { return m_QueryMap.size(); }
00120     bool empty() const { return m_QueryMap.empty(); }
00121 
00122 private:
00123 
00124     TQueryToSubjectSet m_QueryMap;
00125 
00126 };
00127 
00128 
00129 
00130 
00131 
00132 END_NCBI_SCOPE
00133 
00134 #endif
00135 
00136 

Generated on Sun Dec 6 21:55:28 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