00001 #ifndef FILTER_FACTORY_H 00002 #define FILTER_FACTORY_H 00003 00004 //-------------------------------------------------------------------- 00005 // 00006 // This file is part of PEACE. 00007 // 00008 // PEACE is free software: you can redistribute it and/or modify it 00009 // under the terms of the GNU General Public License as published by 00010 // the Free Software Foundation, either version 3 of the License, or 00011 // (at your option) any later version. 00012 // 00013 // PEACE is distributed in the hope that it will be useful, but 00014 // WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 // General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU General Public License 00019 // along with PEACE. If not, see <http://www.gnu.org/licenses/>. 00020 // 00021 // Miami University makes no representations or warranties about the 00022 // suitability of the software, either express or implied, including 00023 // but not limited to the implied warranties of merchantability, 00024 // fitness for a particular purpose, or non-infringement. Miami 00025 // University shall not be liable for any damages suffered by licensee 00026 // as a result of using, result of using, modifying or distributing 00027 // this software or its derivatives. 00028 // 00029 // By using or copying this Software, Licensee agrees to abide by the 00030 // intellectual property laws, and all other applicable laws of the 00031 // U.S., and the terms of GNU General Public License (version 3). 00032 // 00033 // Authors: Dhananjai M. Rao raodm@muohio.edu 00034 // 00035 //--------------------------------------------------------------------- 00036 00037 #include <iostream> 00038 00039 // For declaration to make compiler happy. 00040 class Filter; 00041 class ClusterMaker; 00042 00043 /** Centralized factory for creating filters. 00044 00045 This is a centralized helper class that can be used to create new 00046 instances of various filters. This class provides a convenient 00047 FilterFactory::create() method for this purpose. In addition, it 00048 also provides a mechanism to list all the known filters. 00049 00050 <p>A set of filters (stored in the FilterChain class) are run on 00051 all entries in a FASTA file prior to commencement of the core 00052 clustering operation. The filters perform various validation 00053 operations to ensure ESTs are good prior to clustering. Filtering 00054 ensures that the overall quality of clustering provided by PEACE 00055 is good.</p> 00056 00057 <p>Each filter object in the chain implements a specific type of 00058 filteration operation and ultimately returns an integer indicating 00059 the cluster to which an EST is to be assigned. If the cluster ID 00060 is -1, then that indicates that the EST must be subjected to 00061 regular clustering operations.</p> 00062 00063 \see FilterChain 00064 */ 00065 class FilterFactory { 00066 public: 00067 /** Method to instantiate a suitable filter. 00068 00069 This method must be used to instantiate a suitable filter 00070 instance. This method uses the name (parameter) to suitably 00071 instantiate a filter. If the name is not valid, then this method 00072 returns NULL. 00073 00074 \param[in] name The name of the filter to be instantiated. 00075 00076 \param[in] clusterMaker The top-level cluster maker that has 00077 been specified by the user. The cluster maker encapsulates the 00078 EST analyzer object specified by the user. The filters can use 00079 the clusterMaker to perform any special processing they may 00080 need. 00081 */ 00082 static Filter* create(const char* name, ClusterMaker *clusterMaker); 00083 00084 /** Method to display the list of filters available. 00085 00086 This method is typically used to display the list of 00087 filters currently available. This method is typically used 00088 in the main() method when displaying usage information. 00089 00090 \param[out] os The output stream to which the list of filter 00091 names must be written. 00092 */ 00093 static void displayList(std::ostream& os); 00094 00095 protected: 00096 // Currently this class has no protected members. 00097 00098 private: 00099 /** The default constructor. 00100 00101 The default constructor has is private in order to ensure that 00102 this class is never instantiated. Instead, the static methods 00103 in this class must be directly used to instantiate a filter. 00104 */ 00105 FilterFactory() {} 00106 00107 /** The destructor. 00108 00109 The destructor is private to ensure that objects of this class 00110 are never deleted. 00111 */ 00112 ~FilterFactory() {} 00113 }; 00114 00115 #endif
1.6.1