PileupElement.h

00001 /*
00002  *  Copyright (C) 2010  Regents of the University of Michigan
00003  *
00004  *   This program is free software: you can redistribute it and/or modify
00005  *   it under the terms of the GNU General Public License as published by
00006  *   the Free Software Foundation, either version 3 of the License, or
00007  *   (at your option) any later version.
00008  *
00009  *   This program is distributed in the hope that it will be useful,
00010  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *   GNU General Public License for more details.
00013  *
00014  *   You should have received a copy of the GNU General Public License
00015  *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 
00018 #ifndef __PILEUP_ELEMENT_H__
00019 #define __PILEUP_ELEMENT_H__
00020 
00021 #include "SamRecord.h"
00022 
00023 /// This is a base class pileup component, representing the information
00024 /// for one reference position.  Child classes will be defined to detail more
00025 /// information that needs to be saved and how it should be analyzed.
00026 class PileupElement
00027 {
00028 public:
00029     static const int32_t UNSET_POSITION = -1;
00030 
00031     PileupElement();
00032 
00033     // NOTE that this method does not actually copy, it just resets.
00034     PileupElement(const PileupElement& q);
00035 
00036     virtual ~PileupElement();
00037 
00038 
00039     // Add an entry to this pileup element.  
00040     virtual void addEntry(SamRecord& record);
00041 
00042     // Perform the analysis associated with this class.
00043     virtual void analyze();
00044 
00045     // Resets the entry, setting the new position associated with this element.
00046     virtual void reset(int32_t refPosition);
00047     
00048     const char* getChromosome() const { return(myChromosome.c_str()); }
00049 
00050     int32_t getRefPosition()  const { return(myRefPosition); }
00051 
00052     static void setReference(GenomeSequence* reference);
00053 
00054 protected:
00055     static GenomeSequence* getReference() { return(myRefPtr); }
00056 
00057 private:
00058     int32_t myRefPosition;
00059     std::string myChromosome;
00060     static GenomeSequence* myRefPtr;
00061 };
00062 
00063 
00064 #endif
Generated on Tue Sep 6 17:51:59 2011 for libStatGen Software by  doxygen 1.6.3