|
bpp-seq
2.1.0
|
00001 // 00002 // File: InvertebrateMitochondrialCodonAlphabet.h 00003 // Authors: Eric Bazin 00004 // Sylvain Gaillard 00005 // Created on: thu mar 1 14:25:09 CET 2005 00006 // 00007 00008 /* 00009 Copyright or © or Copr. CNRS, (November 17, 2004) 00010 00011 This software is a computer program whose purpose is to provide classes 00012 for sequences analysis. 00013 00014 This software is governed by the CeCILL license under French law and 00015 abiding by the rules of distribution of free software. You can use, 00016 modify and/ or redistribute the software under the terms of the CeCILL 00017 license as circulated by CEA, CNRS and INRIA at the following URL 00018 "http://www.cecill.info". 00019 00020 As a counterpart to the access to the source code and rights to copy, 00021 modify and redistribute granted by the license, users are provided only 00022 with a limited warranty and the software's author, the holder of the 00023 economic rights, and the successive licensors have only limited 00024 liability. 00025 00026 In this respect, the user's attention is drawn to the risks associated 00027 with loading, using, modifying and/or developing or reproducing the 00028 software by the user in light of its specific status of free software, 00029 that may mean that it is complicated to manipulate, and that also 00030 therefore means that it is reserved for developers and experienced 00031 professionals having in-depth computer knowledge. Users are therefore 00032 encouraged to load and test the software's suitability as regards their 00033 requirements in conditions enabling the security of their systems and/or 00034 data to be ensured and, more generally, to use and operate it in the 00035 same conditions as regards security. 00036 00037 The fact that you are presently reading this means that you have had 00038 knowledge of the CeCILL license and that you accept its terms. 00039 */ 00040 00041 #include "InvertebrateMitochondrialCodonAlphabet.h" 00042 00043 using namespace bpp; 00044 using namespace std; 00045 00046 InvertebrateMitochondrialCodonAlphabet::InvertebrateMitochondrialCodonAlphabet(const NucleicAlphabet* alpha) : CodonAlphabet(alpha) 00047 { 00048 string A = alpha->intToChar(0); 00049 string G = alpha->intToChar(2); 00050 string T = alpha->intToChar(3); 00051 00052 vector<string> vstop; 00053 00054 vstop.push_back(T + A + A); 00055 vstop.push_back(T + A + G); 00056 00057 int istop; 00058 unsigned int j; 00059 for (unsigned int i = 0 ; i < vstop.size() ; i++) { 00060 istop = charToInt(vstop[i]); 00061 stopCodons_.push_back(istop); 00062 00063 j = 0; 00064 while (j < getNumberOfChars()) { 00065 if (getStateAt(j).getNum() == istop) { 00066 getStateAt(j).setName(STOP); 00067 break; 00068 } 00069 j++; 00070 } 00071 } 00072 initCodon_ = charToInt(A + T + G); 00073 } 00074