00001 /************************************************************************** 00002 * Copyright (c) 2001-2011 T. M. Murali * 00003 * Copyright (c) 2011 Phillip Whisenhunt * 00004 * Copyright (c) 2011 David Badger * 00005 * Copyright (c) 2010 Jacqueline Addesa * 00006 * * 00007 * This file is part of Biorithm. * 00008 * * 00009 * Biorithm is free software: you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation, either version 3 of the License, or * 00012 * (at your option) any later version. * 00013 * * 00014 * Biorithm is distributed in the hope that it will be useful, * 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00017 * GNU General Public License for more details. * 00018 * * 00019 * You should have received a copy of the GNU General Public License * 00020 * along with Biorithm. If not, see <http://www.gnu.org/licenses/>. * 00021 * * 00022 **************************************************************************/ 00023 00030 #ifndef RAND_GATHER_H 00031 #define RAND_GATHER_H 00032 00033 // Purpose: Interfaces for rand_gather and rand_aggregate, classes to collect 00034 // gain annotation data over multiple runs of the algorithm 00035 00036 #include <iostream> 00037 #include <string> 00038 #include <map> 00039 #include "gain.h" 00040 00041 using namespace std; 00042 00043 //map from protein name to number of times it was predicted as annotated 00044 typedef map<string, int> annotation_counts_type; 00045 00046 class rand_gather 00047 { 00048 public: 00049 00050 //constructor: takes the total number of runs and the output stream for printing the annotation counts 00051 rand_gather(int p_total_runs); 00052 00053 //copy constructor 00054 rand_gather(const rand_gather& copy); 00055 00056 //update the annotation counts using provided state data 00057 void UpdateCounts(MyNodeStatesType& states); 00058 00059 private: 00060 //current random run number and total number of (expected) runs 00061 int current_run, total_runs; 00062 00063 //map of protein names to their annotation counts 00064 annotation_counts_type annotation_counts; 00065 }; 00066 00067 //map from function GO ID to a rand_gather object 00068 typedef map<string, rand_gather> function_aggregate_type; 00069 00070 class rand_aggregate 00071 { 00072 public: 00073 //constructor: empty so far 00074 rand_aggregate(); 00075 }; 00076 00077 #endif