libStatGen Software  1
SamStatistics.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_STATISTICS_H__
00019 #define __SAM_STATISTICS_H__
00020 
00021 #include <stdint.h>
00022 #include "SamRecord.h"
00023 
00024 class SamStatistics
00025 {
00026 public:
00027     SamStatistics();
00028     ~SamStatistics();
00029 
00030     // Reset the statistics - clear them for processing a new file.
00031     void reset();
00032 
00033     // Method to update the statistics to include the passed in record.
00034     bool updateStatistics(SamRecord& samRecord);
00035 
00036     void print();
00037 
00038 private:
00039 
00040     ///////////////////////////////////////////////////////
00041     // Read Counts 
00042 
00043     /// The number of reads (records) that were processed.
00044     uint64_t myReadCount;
00045     
00046     /// The number of mapped reads (records).
00047     uint64_t myMappedReadCount;
00048 
00049     /// The number of paired reads (records).
00050     uint64_t myPairedReadCount;
00051 
00052     /// The number of proper paired reads (records).
00053     uint64_t myProperPairedReadCount;
00054 
00055     /// The number of duplicate reads (based on the flag).
00056     uint64_t myDupReadCount;
00057 
00058     /// The number of QC failure reads (based on the flag).
00059     uint64_t myQCFailureReadCount;
00060 
00061     ///////////////////////////////////////////////////////
00062     // Base Counts
00063 
00064     /// The total number of bases in the reads in the file (sum of read lengths)
00065     uint64_t myBaseCount;
00066 
00067     /// The total number of bases in mapped reads (sum of read lengths for mapped reads).
00068     uint64_t myMappedReadBases;
00069 };
00070 
00071 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends