Sleipnir
|
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 DATAPAIRI_H 00023 #define DATAPAIRI_H 00024 00025 #include "dat.h" 00026 00027 namespace Sleipnir { 00028 00029 class CDataPair; 00030 class CDatFilter; 00031 00032 class CPairImpl { 00033 protected: 00034 static const char c_szQuantExt[]; 00035 00036 static bool Open( const char*, std::ifstream& ); 00037 static bool Open( const char*, std::vector<float>& ); 00038 }; 00039 00040 class CDataPairImpl : protected CPairImpl, public CDat { 00041 protected: 00042 CDataPairImpl( ) : m_fQuantized(false) {} 00043 void Reset( bool ); 00044 bool m_fContinuous; 00045 bool m_fQuantized; 00046 std::vector<float> m_vecdQuant; 00047 00048 static const char c_acQdab[]; 00049 bool OpenQdab( const char* szDatafile ); 00050 void SetQuants( const float* adBinEdges, size_t iBins ); 00051 std::vector<float> GetQuants(); 00052 }; 00053 00054 class CPCLPairImpl : protected CPairImpl, public CPCL { 00055 protected: 00056 std::vector<std::vector<float> > m_vecvecdQuants; 00057 }; 00058 00059 class CDatFilterImpl { 00060 protected: 00061 CDatFilterImpl( ) : m_pDat(NULL), m_pFilter(NULL) { } 00062 00063 bool Attach( const CDataPair*, const CDatFilter*, const CGenes*, CDat::EFilter, const CDat* ); 00064 size_t GetGenes( ) const; 00065 std::string GetGene( size_t ) const; 00066 00067 const CDat* m_pAnswers; 00068 const CDataPair* m_pDat; 00069 const CDatFilter* m_pFilter; 00070 CDat::EFilter m_eFilter; 00071 std::vector<bool> m_vecfGenes; 00072 std::vector<size_t> m_veciAnswers; 00073 }; 00074 00075 } 00076 00077 #endif // DATAPAIRI_H