|
gnFileContig.hGo to the documentation of this file.00001 00002 // File: gnFileContig.h 00003 // Purpose: File Position holder. 00004 // Description: 00005 // Changes: 00006 // Version: libGenome 0.1.0 00007 // Author: Aaron Darling 00008 // Last Edited: April 15, 2001, 10:34:50pm 00009 // Modified by: 00010 // Copyright: (c) Aaron Darling 00011 // Licenses: Proprietary 00013 #ifndef _gnFileContig_h_ 00014 #define _gnFileContig_h_ 00015 00016 #include "gn/gnDefs.h" 00017 00018 #include <string> 00019 #include "gn/gnClone.h" 00020 #ifdef __GNUG__ 00021 #include "pair.h" 00022 #endif 00023 00031 class GNDLLEXPORT gnFileContig : public gnClone 00032 { 00033 public: 00034 gnFileContig(); 00035 gnFileContig( string nameStr, const uint64 pos, const uint64 len ); 00036 gnFileContig( const gnFileContig& fc ); 00037 ~gnFileContig(); 00038 00039 gnFileContig* Clone() const; 00040 void Clear(); 00041 00042 string GetName() const; 00043 gnSeqI GetSeqLength() const; 00044 pair<uint64,uint64> GetFileStartEnd() const; 00045 uint64 GetFileLength() const; 00046 pair<uint64,uint64> GetSectStartEnd( const gnContigSection i ) const; 00047 uint64 GetSectLength( gnContigSection i ) const; 00048 boolean HasRepeatSeqGap() const; 00049 pair<uint32,uint32> GetRepeatSeqGapSize() const; 00050 00051 boolean SetName( string nameStr ); 00052 boolean SetSeqLength( const gnSeqI len ); 00053 boolean AddToSeqLength( const gnSeqI len ); 00054 boolean SetFileStart( const uint64 s ); 00055 boolean SetFileEnd( const uint64 e ); 00056 boolean SetFileStartEnd( const pair<uint64,uint64> se ); 00057 boolean SetSectStart( const gnContigSection i, const uint64 s ); 00058 boolean SetSectEnd( const gnContigSection i, const uint64 e ); 00059 boolean SetSectStartEnd( const gnContigSection i, const pair<uint64,uint64> se); 00060 boolean SetRepeatSeqGap( const boolean rsg ); 00061 boolean SetRepeatSeqGapSize( const pair<uint64,uint64> rsgSize ); 00062 boolean SetRepeatSeqSize( const uint64 seqSize ); 00063 boolean SetRepeatGapSize( const uint64 gapSize ); 00064 private: 00065 string m_name; 00066 gnSeqI m_seqLength; 00067 pair<uint64,uint64> m_fileStartEnd; 00068 00069 pair<uint64,uint64> m_startEndArray[CONTIG_SECTION_SIZE]; 00070 // sequence access 00071 boolean m_repeatSeqGap; // if true, use m_repeatSeqGapSize 00072 pair< uint64, uint64 > m_repeatSeqGapSize; 00073 };// class gnFileContig 00074 00075 // Clone 00076 inline 00077 gnFileContig* gnFileContig::Clone() const 00078 { 00079 return new gnFileContig( *this ); 00080 } 00081 // GET 00082 inline 00083 string gnFileContig::GetName() const 00084 { 00085 return m_name; 00086 } 00087 inline 00088 gnSeqI gnFileContig::GetSeqLength() const 00089 { 00090 return m_seqLength; 00091 } 00092 inline 00093 pair<uint64,uint64> gnFileContig::GetFileStartEnd() const 00094 { 00095 return m_fileStartEnd; 00096 } 00097 inline 00098 uint64 gnFileContig::GetFileLength() const 00099 { 00100 return m_fileStartEnd.second - m_fileStartEnd.first + 1; 00101 } 00102 inline 00103 pair<uint64,uint64> gnFileContig::GetSectStartEnd( const gnContigSection i ) const 00104 { 00105 if( (uint32)i < CONTIG_SECTION_SIZE ) 00106 return m_startEndArray[(uint32)i]; 00107 return pair<uint64,uint64>(0,0); 00108 } 00109 inline 00110 uint64 gnFileContig::GetSectLength( gnContigSection i ) const 00111 { 00112 if( (uint32)i < CONTIG_SECTION_SIZE ) 00113 return m_startEndArray[(uint32)i].second - m_startEndArray[(uint32)i].first + 1; 00114 return 0; 00115 } 00116 inline 00117 boolean gnFileContig::HasRepeatSeqGap() const 00118 { 00119 return m_repeatSeqGap; 00120 } 00121 inline 00122 pair<uint32,uint32> gnFileContig::GetRepeatSeqGapSize() const 00123 { 00124 return m_repeatSeqGapSize; 00125 } 00126 // SET 00127 inline 00128 boolean gnFileContig::SetName( string nameStr ) 00129 { 00130 m_name = nameStr; 00131 return true; 00132 } 00133 inline 00134 boolean gnFileContig::SetSeqLength( const gnSeqI len ) 00135 { 00136 m_seqLength = len; 00137 return true; 00138 } 00139 inline 00140 boolean gnFileContig::AddToSeqLength( const gnSeqI len ) 00141 { 00142 m_seqLength += len; 00143 return true; 00144 } 00145 inline 00146 boolean gnFileContig::SetFileStart( const uint64 s ) 00147 { 00148 m_fileStartEnd.first = s; 00149 return true; 00150 } 00151 inline 00152 boolean gnFileContig::SetFileEnd( const uint64 e ) 00153 { 00154 m_fileStartEnd.second = e; 00155 return true; 00156 } 00157 inline 00158 boolean gnFileContig::SetFileStartEnd( const pair<uint64,uint64> se ) 00159 { 00160 m_fileStartEnd = se; 00161 return true; 00162 } 00163 inline 00164 boolean gnFileContig::SetSectStart( const gnContigSection i, const uint64 s ) 00165 { 00166 if( (uint32)i < CONTIG_SECTION_SIZE ) 00167 { 00168 m_startEndArray[(uint32)i].first = s; 00169 return true; 00170 } 00171 return false; 00172 } 00173 inline 00174 boolean gnFileContig::SetSectEnd( const gnContigSection i, const uint64 e ) 00175 { 00176 if( (uint32)i < CONTIG_SECTION_SIZE ) 00177 { 00178 m_startEndArray[(uint32)i].second = e; 00179 return true; 00180 } 00181 return false; 00182 } 00183 inline 00184 boolean gnFileContig::SetSectStartEnd( const gnContigSection i, const pair<uint64,uint64> se ) 00185 { 00186 if( (uint32)i < CONTIG_SECTION_SIZE ) 00187 { 00188 m_startEndArray[(uint32)i] = se; 00189 return true; 00190 } 00191 return false; 00192 } 00193 inline 00194 boolean gnFileContig::SetRepeatSeqGap( const boolean rsg ) 00195 { 00196 m_repeatSeqGap = rsg; 00197 return true; 00198 } 00199 inline 00200 boolean gnFileContig::SetRepeatSeqGapSize( const pair<uint64,uint64> rsgSize ) 00201 { 00202 return SetRepeatSeqSize( rsgSize.first ) && 00203 SetRepeatGapSize( rsgSize.second ); 00204 } 00205 00206 00207 #endif 00208 // _gnFileContig_h_ Generated at Fri Nov 30 15:36:51 2001 for libGenome by 1.2.8.1 written by Dimitri van Heesch, © 1997-2001 |