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 ORTHOLOGY_H 00023 #define ORTHOLOGY_H 00024 00025 #include "orthologyi.h" 00026 00027 namespace Sleipnir { 00028 00064 class COrthology : COrthologyImpl { 00065 public: 00066 bool Open( std::istream& istm ); 00067 void Save( std::ostream& ostm ) const; 00068 00079 size_t GetClusters( ) const { 00080 00081 return m_vecvecpGenes.size( ); } 00082 00096 size_t GetGenes( size_t iCluster ) const { 00097 00098 return m_vecvecpGenes[ iCluster ].size( ); } 00099 00117 CGene& GetGene( size_t iCluster, size_t iGene ) const { 00118 00119 return *m_vecvecpGenes[ iCluster ][ iGene ]; } 00120 00128 size_t GetGenomes( ) const { 00129 00130 return m_vecpGenomes.size( ); } 00131 00145 CGenome* GetGenome( size_t iOrganism ) const { 00146 00147 return m_vecpGenomes[ iOrganism ]; } 00148 00162 const std::string& GetOrganism( size_t iOrganism ) const { 00163 00164 return m_vecstrOrganisms[ iOrganism ]; } 00165 00181 size_t GetOrganism( const CGene& Gene ) const { 00182 TMapGeneI::const_iterator iterGenome; 00183 00184 return ( ( ( iterGenome = m_mapGenes.find( (CGene*)&Gene ) ) == m_mapGenes.end( ) ) ? -1 : 00185 iterGenome->second ); } 00186 }; 00187 00188 } 00189 00190 #endif // ORTHOLOGY_H