include/algo/align/prosplign/compartments.hpp

Go to the documentation of this file.
00001 #ifndef ALGO_ALIGN_PROSPLIGN_COMPART__HPP
00002 #define ALGO_ALIGN_PROSPLIGN_COMPART__HPP
00003 
00004 /* $Id: compartments.hpp 174015 2009-10-22 17:54:50Z souvorov $
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:  Boris Kiryutin, Vyacheslav Chetvernin
00030  * File Description: Get protein compartments from BLAST hits
00031  *
00032  */
00033 
00034 #include <corelib/ncbistl.hpp>
00035 #include <corelib/ncbiargs.hpp>
00036 #include <algo/align/splign/splign.hpp>
00037 #include <objects/seqalign/seqalign__.hpp>
00038 
00039 BEGIN_NCBI_SCOPE
00040 USING_SCOPE(objects);
00041 
00042 BEGIN_SCOPE(prosplign)
00043 
00044 class  CCompartOptions {
00045 public:
00046     static void SetupArgDescriptions(CArgDescriptions* argdescr);
00047 
00048     CCompartOptions(const CArgs& args);
00049 
00050     double m_CompartmentPenalty;
00051     double m_MinCompartmentIdty;
00052     double m_MinSingleCompartmentIdty;
00053     int    m_MaxExtent;
00054     bool   m_ByCoverage;
00055     int    m_MaxIntron;
00056 
00057     static const double default_CompartmentPenalty;
00058     static const double default_MinCompartmentIdty;
00059     static const double default_MinSingleCompartmentIdty;
00060     static const int    default_MaxExtent = 500;
00061     static const bool   default_ByCoverage = true;
00062     static const int    default_MaxIntron;
00063 };
00064 
00065 struct SCompartment {
00066     SCompartment(int from_, int to_, bool strand_, int covered_aa_, double score_) :
00067         from(from_), to(to_), strand(strand_), covered_aa(covered_aa_), score(score_) {}
00068 
00069     int from;
00070     int to;
00071     bool strand;
00072     int covered_aa;
00073     double score;
00074 
00075     bool operator< (const SCompartment& comp) const
00076     {
00077         if (strand == comp.strand) {
00078             return from < comp.from;
00079         } else {
00080             return strand < comp.strand;
00081         }
00082     }
00083 };
00084 
00085 typedef vector<SCompartment> TCompartmentStructs;
00086 typedef list<CRef<CSeq_annot> > TCompartments;
00087 
00088 /// Makes compartments. Hits should be for a single protein-genomic pair.
00089 TCompartments SelectCompartmentsHits(const CSplign::THitRefs& hitrefs, CCompartOptions compart_options);
00090 TCompartmentStructs MakeCompartments(const TCompartments& compartments_hits, CCompartOptions compart_options);
00091 /// Composition of above two functions
00092 TCompartmentStructs MakeCompartments(const CSplign::THitRefs& hitrefs, CCompartOptions compart_options);
00093 
00094 END_SCOPE(prosplign)
00095 END_NCBI_SCOPE
00096 #endif
00097 
00098 

Generated on Wed Dec 9 02:54:21 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Wed Dec 09 08:17:25 2009 by modify_doxy.py rev. 173732