blast_aux.hpp

来自「ncbi源码」· HPP 代码 · 共 283 行

HPP
283
字号
/* * =========================================================================== * PRODUCTION $Log: blast_aux.hpp,v $ * PRODUCTION Revision 1000.3  2004/06/01 18:02:37  gouriano * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.35 * PRODUCTION * =========================================================================== *//*  $Id: blast_aux.hpp,v 1000.3 2004/06/01 18:02:37 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.** ===========================================================================** Author:  Christiam Camacho**//// @file blast_aux.hpp/// Contains C++ wrapper classes to structures in algo/blast/core as well as/// some auxiliary functions to convert CSeq_loc to/from BlastMask structures.#ifndef ALGO_BLAST_API___BLAST_AUX__HPP#define ALGO_BLAST_API___BLAST_AUX__HPP#include <corelib/ncbistd.hpp>#include <corelib/ddumpable.hpp>#include <objmgr/scope.hpp>#include <objects/seqalign/Seq_align_set.hpp>#include <algo/blast/api/blast_types.hpp>// NewBlast includes#include <algo/blast/core/blast_util.h>#include <algo/blast/core/blast_options.h>#include <algo/blast/core/blast_filter.h> // Needed for BlastMaskLoc & BlastSeqLoc#include <algo/blast/core/blast_extend.h>#include <algo/blast/core/blast_gapalign.h>#include <algo/blast/core/blast_hits.h>/** @addtogroup AlgoBlast * * @{ */BEGIN_NCBI_SCOPEBEGIN_SCOPE(objects)    class CSeq_loc;END_SCOPE(objects)BEGIN_SCOPE(blast)/** Converts a CSeq_loc into a BlastMaskLoc structure used in NewBlast * @param slp CSeq_loc to convert [in] * @param index Number of frame/query number? this CSeq_loc applies to [in] * @return Linked list of BlastMaskLoc structures */NCBI_XBLAST_EXPORTBlastMaskLoc*CSeqLoc2BlastMaskLoc(const objects::CSeq_loc &slp, int index);/** Convert coordinates in masking locations for one sequence from DNA to  * protein, creating mask locations for each of the 6 translation frames. * @param mask Pointer to masking locations structure [in] [out] * @param seqloc DNA sequence data [in] * @param scope Which scope this sequence belongs to? [in] */void BlastMaskLocDNAToProtein(BlastMaskLoc** mask,          const objects::CSeq_loc &seqloc, objects::CScope* scope);/** Convert coordinates in masking locations for a set of sequences from * protein to DNA. * @param mask Pointer to masking locations for all frames of a set  *            of translated sequences [in] [out] * @param slp Vector of DNA sequence data [in] */void BlastMaskLocProteinToDNA(BlastMaskLoc** mask, TSeqLocVector &slp);/** Declares class to handle deallocating of the structure using the appropriate * function */#define DECLARE_AUTO_CLASS_WRAPPER(struct_name, free_func) \/** Wrapper class for struct_name. */\\class C##struct_name : public CDebugDumpable \{ \public: \    C##struct_name() : m_Ptr(NULL) {} \    C##struct_name(struct_name* p) : m_Ptr(p) {} \    void Reset(struct_name* p) { if (m_Ptr) { free_func(m_Ptr); } m_Ptr = p; } \    ~C##struct_name() { if (m_Ptr) { free_func(m_Ptr); m_Ptr = NULL; } } \    operator struct_name *() { return m_Ptr; } \    operator struct_name *() const { return m_Ptr; } \    struct_name* operator->() { return m_Ptr; } \    struct_name* operator->() const { return m_Ptr; } \    struct_name** operator&() { return &m_Ptr; } \    void DebugDump(CDebugDumpContext ddc, unsigned int depth) const; \private: \    struct_name* m_Ptr; \}DECLARE_AUTO_CLASS_WRAPPER(BLAST_SequenceBlk, BlastSequenceBlkFree);DECLARE_AUTO_CLASS_WRAPPER(BlastQueryInfo, BlastQueryInfoFree);DECLARE_AUTO_CLASS_WRAPPER(QuerySetUpOptions, BlastQuerySetUpOptionsFree);DECLARE_AUTO_CLASS_WRAPPER(LookupTableOptions, LookupTableOptionsFree);DECLARE_AUTO_CLASS_WRAPPER(LookupTableWrap, LookupTableWrapFree);DECLARE_AUTO_CLASS_WRAPPER(BlastInitialWordOptions,                           BlastInitialWordOptionsFree);DECLARE_AUTO_CLASS_WRAPPER(BlastInitialWordParameters,                           BlastInitialWordParametersFree);DECLARE_AUTO_CLASS_WRAPPER(Blast_ExtendWord, BlastExtendWordFree);DECLARE_AUTO_CLASS_WRAPPER(BlastExtensionOptions, BlastExtensionOptionsFree);DECLARE_AUTO_CLASS_WRAPPER(BlastExtensionParameters, BlastExtensionParametersFree);DECLARE_AUTO_CLASS_WRAPPER(BlastHitSavingOptions, BlastHitSavingOptionsFree);DECLARE_AUTO_CLASS_WRAPPER(BlastHitSavingParameters,                           BlastHitSavingParametersFree);DECLARE_AUTO_CLASS_WRAPPER(PSIBlastOptions, sfree);DECLARE_AUTO_CLASS_WRAPPER(BlastDatabaseOptions, BlastDatabaseOptionsFree);DECLARE_AUTO_CLASS_WRAPPER(BlastScoreBlk, BlastScoreBlkFree);DECLARE_AUTO_CLASS_WRAPPER(BlastScoringOptions, BlastScoringOptionsFree);DECLARE_AUTO_CLASS_WRAPPER(BlastEffectiveLengthsOptions,                           BlastEffectiveLengthsOptionsFree);DECLARE_AUTO_CLASS_WRAPPER(BlastGapAlignStruct, BLAST_GapAlignStructFree);DECLARE_AUTO_CLASS_WRAPPER(BlastHSPResults, Blast_HSPResultsFree);END_SCOPE(blast)END_NCBI_SCOPE/* @} *//** ===========================================================================** $Log: blast_aux.hpp,v $* Revision 1000.3  2004/06/01 18:02:37  gouriano* PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.35** Revision 1.35  2004/05/14 16:02:56  madden* Rename BLAST_ExtendWord to Blast_ExtendWord in order to fix conflicts with C toolkit** Revision 1.34  2004/05/05 15:28:10  dondosha* Renamed functions in blast_hits.h accordance with new convention Blast_[StructName][Task]** Revision 1.33  2004/04/30 17:12:42  dondosha* Changed prefix from BLAST_ to conventional Blast_** Revision 1.32  2004/03/19 18:56:04  camacho* Move to doxygen AlgoBlast group** Revision 1.31  2004/03/18 13:50:38  camacho* Remove unused CDeleter template specializations** Revision 1.30  2004/03/16 14:48:01  dondosha* Typo fix in doxygen comment** Revision 1.29  2004/03/12 16:33:22  camacho* Rename BLAST_ExtendWord functions to avoid collisions with C toolkit libraries** Revision 1.28  2004/03/12 15:57:59  camacho* Make consistent use of New/Free functions for BLAST_ExtendWord structure** Revision 1.27  2003/12/03 16:36:07  dondosha* Renamed BlastMask to BlastMaskLoc, BlastResults to BlastHSPResults** Revision 1.26  2003/11/26 18:22:13  camacho* +Blast Option Handle classes** Revision 1.25  2003/10/07 17:27:37  dondosha* Lower case mask removed from options, added to the SSeqLoc structure** Revision 1.24  2003/09/11 17:44:39  camacho* Changed CBlastOption -> CBlastOptions** Revision 1.23  2003/09/10 20:00:49  dondosha* BlastLookupTableDestruct renamed to LookupTableWrapFree** Revision 1.22  2003/08/27 21:27:58  camacho* Fix to previous commit** Revision 1.21  2003/08/27 18:40:02  camacho* Change free function for blast db options struct** Revision 1.20  2003/08/20 15:23:47  ucko* DECLARE_AUTO_CLASS_WRAPPER: Remove occurrences of ## adjacent to punctuation.** Revision 1.19  2003/08/20 14:45:26  dondosha* All references to CDisplaySeqalign moved to blast_format.hpp** Revision 1.18  2003/08/19 22:11:49  dondosha* Major types definitions moved to blast_types.h** Revision 1.17  2003/08/19 20:22:05  dondosha* EProgram definition moved from CBlastOptions clase to blast scope** Revision 1.16  2003/08/19 13:45:21  dicuccio* Removed 'USING_SCOPE(objects)'.  Changed #include guards to be standards* compliant.  Added 'objects::' where necessary.** Revision 1.15  2003/08/18 22:17:52  camacho* Renaming of SSeqLoc members** Revision 1.14  2003/08/18 20:58:56  camacho* Added blast namespace, removed *__.hpp includes** Revision 1.13  2003/08/18 17:07:41  camacho* Introduce new SSeqLoc structure (replaces pair<CSeq_loc, CScope>).* Change in function to read seqlocs from files.** Revision 1.12  2003/08/14 19:08:45  dondosha* Use CRef instead of pointer to CSeq_loc in the TSeqLoc type definition** Revision 1.11  2003/08/12 19:17:58  dondosha* Added TSeqLocVector typedef so it can be used from all sources; removed scope argument from functions** Revision 1.10  2003/08/11 19:55:04  camacho* Early commit to support query concatenation and the use of multiple scopes.* Compiles, but still needs work.** Revision 1.9  2003/08/11 17:12:10  dondosha* Do not use CConstRef as argument to CSeqLoc2BlastMaskLoc** Revision 1.8  2003/08/11 16:09:53  dondosha* Pass CConstRef by value in CSeqLoc2BlastMaskLoc** Revision 1.7  2003/08/11 15:23:23  dondosha* Renamed conversion functions between BlastMaskLoc and CSeqLoc; added algo/blast/core to headers from core BLAST library** Revision 1.6  2003/08/11 13:58:51  dicuccio* Added export specifiers.  Fixed problem with unimplemented private copy ctor* (truly make unimplemented)** Revision 1.5  2003/08/01 17:40:56  dondosha* Use renamed functions and structures from local blastkar.h** Revision 1.4  2003/07/31 19:45:33  camacho* Eliminate Ptr notation** Revision 1.3  2003/07/30 15:00:01  camacho* Do not use Malloc/MemNew/MemFree** Revision 1.2  2003/07/14 22:17:17  camacho* Convert CSeq_loc to BlastMaskLocPtr** Revision 1.1  2003/07/10 18:34:19  camacho* Initial revision*** ===========================================================================*/#endif  /* ALGO_BLAST_API___BLAST_AUX__HPP */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?