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 PileupElement(); 00030 00031 // NOTE that this method does not actually copy, it just resets. 00032 PileupElement(const PileupElement& q); 00033 00034 virtual ~PileupElement(); 00035 00036 00037 // Add an entry to this pileup element. 00038 virtual void addEntry(SamRecord& record); 00039 00040 // Perform the analysis associated with this class. 00041 virtual void analyze(); 00042 00043 // Resets the entry, setting the new position associated with this element. 00044 virtual void reset(int32_t refPosition); 00045 00046 const char* getChromosome() const { return(myChromosome.c_str()); } 00047 00048 int32_t getRefPosition() const { return(myRefPosition); } 00049 00050 static void setReference(GenomeSequence* reference); 00051 00052 protected: 00053 static const int32_t UNSET_POSITION = -1; 00054 static GenomeSequence* getReference() { return(myRefPtr); } 00055 00056 private: 00057 int32_t myRefPosition; 00058 std::string myChromosome; 00059 static GenomeSequence* myRefPtr; 00060 }; 00061 00062 00063 #endif
1.6.3