libStatGen Software  1
Chromosome.h
00001 #ifndef _CHROMOSOME_H_
00002 #define _CHROMOSOME_H_
00003 
00004 #include "GenomeSequence.h"
00005 
00006 class Chromosome{
00007 public:
00008     explicit Chromosome(GenomeSequence* gs, unsigned int chrosomeIndex);
00009     explicit Chromosome(GenomeSequence* gs, const char* chromosomeName);
00010     explicit Chromosome(const char* genomseSequenceFileName, unsigned int chromosomeIndex, bool isColorSpace);
00011     explicit Chromosome(const std::string& genomseSequenceFileName, unsigned int chromosomeIndex, bool isColorSpace);
00012     genomeIndex_t Length() const
00013     {
00014         return chromosomeSize;
00015     }
00016     // 0-based index 
00017     inline char operator[](genomeIndex_t index) const
00018     {
00019         index += offset;
00020         return (*gs)[index];
00021     }
00022     const char* Name() const {
00023         return gs->getChromosomeName(this->chromosomeIndex);
00024     }
00025 private:
00026     GenomeSequence* gs;
00027     int chromosomeIndex;
00028     genomeIndex_t offset;           // chromosome index 0 corresponds (*gs)[offset]
00029     genomeIndex_t chromosomeSize;   // return the length of the chromosome
00030 };
00031 
00032 #endif /* _CHROMOSOME_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends