ToPS
|
00001 /* 00002 * SequenceFactory.hpp 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 #ifndef SEQUENCE_FACTORY_H 00026 #define SEQUENCE_FACTORY_H 00027 00028 #include "crossplatform.hpp" 00029 00030 #include <boost/shared_ptr.hpp> 00031 #include "Sequence.hpp" 00032 00033 namespace tops{ 00034 class DLLEXPORT Alphabet; 00035 typedef boost::shared_ptr<Alphabet> AlphabetPtr; 00036 struct my_tolower 00037 { 00038 char operator()(char c) const 00039 { 00040 return tolower(c); 00041 } 00042 }; 00043 00045 class DLLEXPORT SequenceFactory 00046 { 00047 private: 00048 AlphabetPtr _alphabet; 00049 public: 00050 SequenceFactory(){} 00051 SequenceFactory(AlphabetPtr alpha) 00052 { 00053 _alphabet = alpha; 00054 }; 00055 virtual ~SequenceFactory(){} 00056 virtual Sequence createSequence(const std::string & seq); 00057 virtual Sequence createSequenceRemovedSpaces(const std::string & seq); 00058 virtual Sequence createSequence(const std::vector<std::string> & seq); 00059 00060 virtual Sequence createSequence(const std::string & seq, std::vector <int> &invalidPositions); 00061 virtual Sequence createSequenceRemovedSpaces(const std::string & seq, std::vector <int>& invalidPositions); 00062 virtual Sequence createSequence(const std::vector<std::string> & seq, std::vector <int> & invalidPositions); 00063 00064 00065 }; 00066 } 00067 #endif