The base class of all cluster makers. More...
#include <ClusterMaker.h>
Public Member Functions | |
virtual void | showArguments (std::ostream &os) |
Display valid command line arguments for this cluster maker. | |
virtual bool | parseArguments (int &argc, char **argv) |
Process command line arguments. | |
virtual int | makeClusters ()=0 |
Method to begin clustering. | |
ESTAnalyzer * | getAnalyzer () const |
Obtain the EST analyzer set for this cluster maker. | |
virtual int | addDummyCluster (const std::string name)=0 |
Add a dummy cluster to the cluster maker. | |
virtual void | addEST (const int clusterID, const int estIdx)=0 |
Add a EST directly to a given cluster. | |
virtual int | initialize ()=0 |
A method to handle initialization tasks for the ClusterMaker. | |
virtual | ~ClusterMaker () |
The destructor. | |
Protected Member Functions | |
ClusterMaker (const std::string &name, ESTAnalyzer *analyzer, const int refESTidx, const std::string &outputFileName) | |
The default constructor. | |
Protected Attributes | |
const std::string | name |
The name of this cluster maker. | |
const int | refESTidx |
The index of the reference EST in a given file. | |
const std::string | outputFileName |
The file to which results must be written. | |
ESTAnalyzer *const | analyzer |
The analyzer to be used for generating EST similarity metrics. | |
Private Member Functions | |
ClusterMaker & | operator= (const ClusterMaker &src) |
A dummy operator=. | |
Static Private Attributes | |
static arg_parser::arg_record | commonArgsList [] |
The set of common arguments for all cluster makers. |
The base class of all cluster makers.
This class must be the base class of all cluster makers in the system. This class provides some default functionality that can be readily used by each cluster maker.
Definition at line 48 of file ClusterMaker.h.
ClusterMaker::~ClusterMaker | ( | ) | [virtual] |
The destructor.
The destructor frees memory allocated for holding any data in this base class.
Definition at line 55 of file ClusterMaker.cpp.
ClusterMaker::ClusterMaker | ( | const std::string & | name, | |
ESTAnalyzer * | analyzer, | |||
const int | refESTidx, | |||
const std::string & | outputFileName | |||
) | [protected] |
The default constructor.
The constructor has been made protected to ensure that this class is never directly instantiated. Instead one of the derived cluster maker classes must be instantiated via the ClusterMakerFactor API methods.
[in] | name | The human readable name for this cluster maker. This name is used when generating errors, warnings, and other output messages for this object. |
[in,out] | analyzer | The EST analyzer to be used by this ClusterMaker for generating similarity metrics between two given ESTs. |
[in] | refESTidx | The reference EST's index in a given multi-FASTA file. Index values start with 0 (zero). The refESTidx is supplied as a global argument that is processed in the main() method. This value is simply copied to the refESTidx member in this class. |
[in] | outputFileName | The file name to which output must be written. If a valid output file is not specified, then results are written to standard output. The outputFileName is simply copied to the outputFileName member object. |
Definition at line 48 of file ClusterMaker.cpp.
virtual int ClusterMaker::addDummyCluster | ( | const std::string | name | ) | [pure virtual] |
Add a dummy cluster to the cluster maker.
This method can be used to add a dummy cluster to the cluster maker. The dummy clusters are added as direct descendants of the root cluster with the given name.
[in] | name | A human readable name to be set for this cluster. |
Implemented in MSTClusterMaker.
Referenced by LCFilter::addDummyEntry(), and LengthFilter::initialize().
virtual void ClusterMaker::addEST | ( | const int | clusterID, | |
const int | estIdx | |||
) | [pure virtual] |
Add a EST directly to a given cluster.
This method can be used to add an EST directly to a cluster. This bypasses any traditional mechanism and directly adds the EST to the specified cluster.
[in] | clusterID | The unique ID of the cluster to which the EST is to be added. This value must have been obtained from an earlier (successful) call to the ClusterMaker::addDummyCluster method. |
[in] | estIdx | The EST to be added to the given cluster. Once the EST has been added to this cluster it will not be included in the clustering process performed by this cluster maker. |
Implemented in MSTClusterMaker.
Referenced by Filter::applyFilter(), and Filter::processFilterData().
ESTAnalyzer* ClusterMaker::getAnalyzer | ( | ) | const [inline] |
Obtain the EST analyzer set for this cluster maker.
This method must be used to obtain the EST analyzer set for this cluster maker.
Definition at line 118 of file ClusterMaker.h.
References analyzer.
Referenced by LCFilter::initialize(), and LCFilter::runFilter().
virtual int ClusterMaker::initialize | ( | ) | [pure virtual] |
A method to handle initialization tasks for the ClusterMaker.
This method is called after the cluster maker has been created but before the ESTs have been loaded into the ESTAnalyzer.
Implemented in MSTClusterMaker, and TransMSTClusterMaker.
Referenced by main().
virtual int ClusterMaker::makeClusters | ( | ) | [pure virtual] |
Method to begin clustering.
This method must be used to create clusters based on a given EST analysis method. This method is a pure-virtual method. Therefore all cluster maker classes must override this method to perform all the necessary operations.
Implemented in MSTClusterMaker, and PMSTClusterMaker.
Referenced by main().
ClusterMaker & ClusterMaker::operator= | ( | const ClusterMaker & | src | ) | [private] |
A dummy operator=.
The operator=() is supressed for this class as it has constant members whose value is set when the object is created. These values cannot be changed during the lifetime of this object.
[in] | src | The source object from where data is to be copied. Currently this value is ignored. |
Definition at line 82 of file ClusterMaker.cpp.
bool ClusterMaker::parseArguments | ( | int & | argc, | |
char ** | argv | |||
) | [virtual] |
Process command line arguments.
This method is used to process command line arguments specific to this cluster maker. This method is typically used from the main method just after the cluster maker has been instantiated. This method consumes all valid command line arguments. If the command line arguments were valid and successfully processed, then this method returns true
.
[in,out] | argc | The number of command line arguments to be processed. |
[in,out] | argv | The array of command line arguments. |
true
if the command line arguments were successfully processed. Otherwise this method returns false
. This method returns true if all arguments are consumed successfully. Reimplemented in MSTClusterMaker, and PMSTClusterMaker.
Definition at line 72 of file ClusterMaker.cpp.
References arg_parser::check_args().
Referenced by main().
void ClusterMaker::showArguments | ( | std::ostream & | os | ) | [virtual] |
Display valid command line arguments for this cluster maker.
This method must be used to display all valid command line options that are supported by this cluster maker. Note that derived classes may override this method to display additional command line options that are applicable to it. This method is typically used in the main() method when displaying usage information.
[out] | os | The output stream to which the valid command line arguments must be written. |
Reimplemented in MSTClusterMaker, and PMSTClusterMaker.
Definition at line 58 of file ClusterMaker.cpp.
References commonArgsList.
Referenced by showUsage().
ESTAnalyzer* const ClusterMaker::analyzer [protected] |
The analyzer to be used for generating EST similarity metrics.
This pointer is used to hold a pointer to the EST analyzer that must be used for generating similarity metrics between two given pairs of ESTs. This pointer is initialized when the object is instantiated and is never changed during the lifetime of this object.
Definition at line 252 of file ClusterMaker.h.
Referenced by MSTClusterMaker::addEST(), PMSTClusterMaker::addMoreChildESTs(), MSTClusterMaker::addMoreChildESTs(), TransMSTClusterMaker::analyze(), PMSTClusterMaker::analyze(), MSTClusterMaker::analyze(), MSTClusterMaker::buildAndShowClusters(), PMSTClusterMaker::computeNextESTidx(), MSTClusterMaker::computeNextESTidx(), getAnalyzer(), TransMSTClusterMaker::initialize(), MSTClusterMaker::initialize(), PMSTClusterMaker::makeClusters(), MSTClusterMaker::makeClusters(), PMSTClusterMaker::manager(), MSTClusterMaker::manager(), PMSTClusterMaker::mergeManager(), PMSTClusterMaker::populateCache(), MSTClusterMaker::populateCache(), MSTClusterMaker::populateMST(), and TransMSTClusterMaker::pruneMetricEntries().
arg_parser::arg_record ClusterMaker::commonArgsList [static, private] |
{ {NULL, NULL, NULL, arg_parser::BOOLEAN} }
The set of common arguments for all cluster makers.
This instance variable contains a static list of arguments that are common all the cluster makers. The common argument list is statically defined and shared by all cluster maker instances.
Definition at line 264 of file ClusterMaker.h.
Referenced by showArguments().
const std::string ClusterMaker::name [protected] |
The name of this cluster maker.
This instance variable contains the human recognizable name for this cluster maker. This value is set when this object is instantiated (in the constructor) and is never changed during the life time of this object. This information is used when generating errors, warnings, and other output messages.
Definition at line 221 of file ClusterMaker.h.
Referenced by PMSTClusterMaker::showArguments(), and MSTClusterMaker::showArguments().
const std::string ClusterMaker::outputFileName [protected] |
The file to which results must be written.
This member object is used to hold the file name to which all the clustering results are to be written. This member is initialized to NULL. However, the value is changed by the parseArguments method depending on the actual value specified by the user.
Definition at line 242 of file ClusterMaker.h.
Referenced by MSTClusterMaker::buildAndShowClusters(), and PMSTClusterMaker::makeClusters().
const int ClusterMaker::refESTidx [protected] |
The index of the reference EST in a given file.
This member object is used to hold the index of a reference EST in a given file. The index values begin from 0 (zero). This member is initialized in the constructor and is never changed during the lifetime of this object. This reference est index is typically the root node of any clustering operations that are performed.
Definition at line 232 of file ClusterMaker.h.
Referenced by MSTClusterMaker::manager(), and PMSTClusterMaker::mergeManager().