BaseComposition.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 __BASE_COMPOSITION_H__
00019 #define __BASE_COMPOSITION_H__
00020 
00021 #include <map>
00022 
00023 #include "BaseAsciiMap.h"
00024 #include "BaseCount.h"
00025 
00026 class BaseComposition
00027 {
00028  public:
00029    // Constructor.
00030    BaseComposition();
00031 
00032    // Update the composition for the specified index with the specified
00033    // character.
00034    // Return false if the character is not a valid raw sequence character.
00035    // Return true if it is valid.
00036    bool updateComposition(unsigned int rawSequenceCharIndex, char baseChar);
00037 
00038    BaseAsciiMap::SPACE_TYPE getSpaceType()
00039    {
00040       return(myBaseAsciiMap.getSpaceType());
00041    }
00042 
00043    void resetBaseMapType()
00044    {
00045       myBaseAsciiMap.resetBaseMapType();
00046    };
00047 
00048    void setBaseMapType(BaseAsciiMap::SPACE_TYPE spaceType)
00049    {
00050       myBaseAsciiMap.setBaseMapType(spaceType);
00051    }
00052 
00053    // Print the composition.
00054    void print();
00055 
00056    // Clear the composition stored in the base count vector.
00057    void clear();
00058 
00059  private:
00060    // Map of bases used to determine if a character is valid and if so
00061    // maps it to a number.
00062    BaseAsciiMap myBaseAsciiMap;
00063 
00064    // Vector used to store the occurrence of each base type at a given 
00065    // read location.
00066    vector<BaseCount> myBaseCountVector;
00067 };
00068 #endif
Generated on Wed Nov 17 15:38:28 2010 for StatGen Software by  doxygen 1.6.3