Sleipnir
src/genomei.h
00001 /*****************************************************************************
00002 * This file is provided under the Creative Commons Attribution 3.0 license.
00003 *
00004 * You are free to share, copy, distribute, transmit, or adapt this work
00005 * PROVIDED THAT you attribute the work to the authors listed below.
00006 * For more information, please see the following web page:
00007 * http://creativecommons.org/licenses/by/3.0/
00008 *
00009 * This file is a component of the Sleipnir library for functional genomics,
00010 * authored by:
00011 * Curtis Huttenhower (chuttenh@princeton.edu)
00012 * Mark Schroeder
00013 * Maria D. Chikina
00014 * Olga G. Troyanskaya (ogt@princeton.edu, primary contact)
00015 *
00016 * If you use this library, the included executable tools, or any related
00017 * code in your work, please cite the following publication:
00018 * Curtis Huttenhower, Mark Schroeder, Maria D. Chikina, and
00019 * Olga G. Troyanskaya.
00020 * "The Sleipnir library for computational functional genomics"
00021 *****************************************************************************/
00022 #ifndef GENOMEI_H
00023 #define GENOMEI_H
00024 
00025 #include <map>
00026 #include <vector>
00027 
00028 #include "filei.h"
00029 
00030 namespace Sleipnir {
00031 
00032 class CGene;
00033 class CGenome;
00034 class IOntology;
00035 
00036 class CGeneImpl {
00037 protected:
00038     CGeneImpl( const std::string& );
00039     ~CGeneImpl( );
00040 
00041     CGeneImpl& operator=( const CGeneImpl& );
00042     void IncrementOntologies( const IOntology* );
00043 
00044     std::string             m_strName;
00045     size_t                  m_iOntologies;
00046     const IOntology**       m_apOntologies;
00047     std::vector<size_t>**   m_apveciAnnotations;
00048     size_t                  m_iSynonyms;
00049     std::string*            m_astrSynonyms;
00050     bool                    m_fRNA;
00051     bool                    m_fDubious;
00052     std::string             m_strGloss;
00053     float                   m_weight;
00054 };
00055 
00056 class CGenomeImpl : protected CFileImpl {
00057 protected:
00058     typedef std::map<std::string,size_t>    TMapStrI;
00059 
00060     static const char   c_szDubious[];
00061     static const char   c_szORF[];
00062     static const char*  c_aszRNA[];
00063 
00064     ~CGenomeImpl( );
00065 
00066     std::vector<CGene*> m_vecpGenes;
00067     TMapStrI            m_mapGenes;
00068 };
00069 
00070 class CGenesImpl {
00071 protected:
00072     static const char   c_cComment  = '#';
00073 
00074     typedef std::map<std::string,size_t>    TMapStrI;
00075 
00076     CGenesImpl( CGenome& );
00077 
00078     CGenome&            m_Genome;
00079     std::vector<CGene*> m_vecpGenes;
00080     TMapStrI            m_mapGenes;
00081     bool                isWeighted;
00082 };
00083 }
00084 
00085 #endif // GENOMEI_H