00001 #ifndef TRAPPER_DNP_TYPES_H 00002 #define TRAPPER_DNP_TYPES_H 00003 #include <iostream> 00004 00005 int dnp_type( char dnp, char cons ) 00006 { 00007 if ( dnp == 'a' ) { 00008 if ( cons == 't' ) { 00009 return 0; 00010 } 00011 else if ( cons == 'g' ) { 00012 return 1; 00013 } 00014 else if ( cons == 'c' ) { 00015 return 2; 00016 } 00017 else { 00018 std::cerr<<"Problem in dnp_type(), returning -1"<<endl; 00019 return -1; 00020 } 00021 00022 00023 } 00024 else if ( dnp == 't' ) { 00025 if ( cons == 'a' ) { 00026 return 6; 00027 } 00028 else if ( cons == 'g' ) { 00029 return 3; 00030 } 00031 else if ( cons == 'c' ) { 00032 return 4; 00033 } 00034 else { 00035 std::cerr<<"Problem in dnp_type(), returning -1"<<endl; 00036 return -1; 00037 } 00038 00039 } 00040 else if ( dnp == 'g' ) { 00041 if ( cons == 't' ) { 00042 return 9; 00043 } 00044 else if ( cons == 'a' ) { 00045 return 7; 00046 } 00047 else if ( cons == 'c' ) { 00048 return 5; 00049 } 00050 else { 00051 std::cerr<<"Problem in dnp_type(), returning -1"<<endl; 00052 return -1; 00053 } 00054 00055 } 00056 else if ( dnp == 'c' ) { 00057 if ( cons == 't' ) { 00058 return 10; 00059 } 00060 else if ( cons == 'g' ) { 00061 return 11; 00062 } 00063 else if ( cons == 'a' ) { 00064 return 8; 00065 } 00066 else { 00067 std::cerr<<"Problem in dnp_type(), returning -1"<<endl; 00068 return -1; 00069 } 00070 00071 } 00072 else { 00073 std::cerr<<"Problem in dnp_type(), returning -1"<<endl; 00074 return -1; 00075 } 00076 00077 00078 } 00079 00080 00081 #endif //TRAPPER_DNP_TYPES_H