ToPS
|
00001 /* 00002 * InhomogeneousMarkovChainCreator.cpp 00003 * 00004 * Copyright 2011 Andre Yoshiaki Kashiwabara <akashiwabara@usp.br> 00005 * Ígor Bonádio <ibonadio@ime.usp.br> 00006 * Vitor Onuchic <vitoronuchic@gmail.com> 00007 * Alan Mitchell Durham <aland@usp.br> 00008 * 00009 * This program 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 * This program 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 this program; if not, write to the Free Software 00021 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00022 * MA 02110-1301, USA. 00023 */ 00024 00025 #include "InhomogeneousMarkovChainCreator.hpp" 00026 #include "VariableLengthMarkovChainCreator.hpp" 00027 #include "ConfigurationReader.hpp" 00028 #include "InhomogeneousMarkovChain.hpp" 00029 #include "Alphabet.hpp" 00030 #include <boost/algorithm/string.hpp> 00031 namespace tops { 00032 00033 ProbabilisticModelPtr InhomogeneousMarkovChainCreator::create(ProbabilisticModelParameters & parameters) const { 00034 InhomogeneousMarkovChainPtr model = InhomogeneousMarkovChainPtr(new InhomogeneousMarkovChain()); 00035 ProbabilisticModelParameterValuePtr symbols = parameters.getMandatoryParameterValue("alphabet"); 00036 ProbabilisticModelParameterValuePtr position_specific_model_names = parameters.getMandatoryParameterValue("position_specific_distribution"); 00037 ProbabilisticModelParameterValuePtr p = parameters.getMandatoryParameterValue("phased"); 00038 if((symbols == NULL) || (position_specific_model_names == NULL) || (p == NULL)) 00039 { 00040 std::cerr << help() << std::endl; 00041 } 00042 model->initialize(parameters); 00043 return model; 00044 } 00045 00046 00047 }