SamReferenceInfo.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 __SAM_REFERENCE_INFO_H__
00019 #define __SAM_REFERENCE_INFO_H__
00020 
00021 #include "StringArray.h"
00022 #include "StringHash.h"
00023 #include "IntArray.h"
00024 
00025 class SamReferenceInfo
00026 {
00027 public:
00028     SamReferenceInfo();
00029     ~SamReferenceInfo();
00030     // Add reference sequence name and reference sequence length.
00031     void add(const char* referenceSequenceName, 
00032              int32_t referenceSequenceLength);
00033 
00034     int getReferenceID(const String & referenceName);
00035     int getReferenceID(const char* referenceName);
00036     const String & getReferenceLabel(int id) const;
00037 
00038     // Get the number of entries contained here.
00039     int32_t getNumEntries() const;
00040 
00041     // Return the reference name at the specified index.
00042     // Returns "" if index is out of bounds
00043     const char* getReferenceName(int index) const;
00044     
00045     // Return the reference length at the specified index.
00046     // Returns 0 if index is out of bounds
00047     int32_t getReferenceLength(int index) const;
00048 
00049     // Reset this reference info.
00050     void clear();
00051 
00052     SamReferenceInfo & operator = (const SamReferenceInfo & rhs);
00053 
00054 private:
00055     // Reference Name information
00056     StringArray    myReferenceContigs;
00057     StringIntHash  myReferenceHash;
00058     IntArray       myReferenceLengths;
00059 };
00060 
00061 #endif
00062 
Generated on Wed Nov 17 15:38:27 2010 for StatGen Software by  doxygen 1.6.3