221 double transition_prob(-INFINITY);
224 return transition_prob;
247 else if (trans_type ==
LEXICAL){
262 return transition_prob;
282 size_t tbState(state_iter);
291 for(
size_t trellPos=sequencePosition-1 ; trellPos !=
SIZE_MAX ;trellPos--){
293 tbState = (*traceback_table)[trellPos][tbState];
304 else if (traceback_identifier ==
STATE_NAME && identifier.compare(st->
getName())==0) {
break;}
305 else if (traceback_identifier ==
STATE_LABEL && identifier.compare(st->
getLabel())==0) {
break;}
306 else if (traceback_identifier ==
STATE_GFF && identifier.compare(st->
getGFF())==0) {
break;}
319 std::vector<int> tracebackPath;
320 std::vector<std::string> tracebackString;
334 size_t trackIndex = alphaTrack->
getIndex();
337 std::cerr <<
"External transition function called on track that isn't discrete (ALPHANUMERIC)\n";
344 int16_t starting_state = tb_state;
347 for(
size_t trellisPos = position-1; trellisPos !=
SIZE_MAX ; --trellisPos){
349 tracebackPath.push_back(tb_state);
351 if ((combineIdent ==
FULL) ||
354 (combineIdent ==
STATEGFF && combineIdentName.compare(st->
getGFF())==0))
357 tracebackString.push_back(seq->
getSymbol(trellisPos));
360 tb_state= (*traceback_table)[trellisPos][tb_state];
364 if(traceback_identifier ==
START_INIT && tb_state == -1) {
break;}
365 else if (traceback_identifier ==
DIFF_STATE && starting_state != tb_state) {
break;}
366 else if (traceback_identifier ==
STATE_NAME && tracebackIdentifierName.compare(temp_st->
getName())==0){
break;}
367 else if (traceback_identifier ==
STATE_LABEL && tracebackIdentifierName.compare(temp_st->
getLabel())==0) {
break;}
368 else if (traceback_identifier ==
STATE_GFF && tracebackIdentifierName.compare(temp_st->
getGFF())==0) {
break;}
371 size_t length=tracebackPath.size();
372 std::string CombinedString;
376 if (maxSymbolSize ==1){
377 for(std::vector<std::string>::reverse_iterator rit = tracebackString.rbegin(); rit!=tracebackString.rend();++rit){
378 CombinedString+=(*rit);
382 std::vector<std::string>::reverse_iterator rit = tracebackString.rbegin();
383 CombinedString+=(*rit);
385 for(; rit!=tracebackString.rend();++rit){
386 CombinedString+=
"," + (*rit);
393 return transitionValue;
421 for(
size_t position =
seq_size -1 ; position>0 ; position--){
422 pointer = (*traceback_table)[position][pointer];
425 std::cerr <<
"No valid path at Position: " << position << std::endl;
449 int16_t pointer = (*traceback_table)[position][state];
451 std::cerr <<
"No valid path at State: " << state <<
" from Position: " << position << std::endl;
455 for(
size_t pos = position - 1 ; pos>0 ; pos--){
456 pointer = (*traceback_table)[pos][pointer];
459 std::cerr <<
"No valid path at State: " << state <<
" from Position: " << position << std::endl;
478 for(
size_t i=0;i<reps;i++){
495 int16_t st_pointer = (*ending_nth_viterbi)[n].st_tb;
496 int16_t sc_pointer = (*ending_nth_viterbi)[n].score_tb;
502 for(
size_t position =
seq_size -1 ; position>0 ; position--){
503 (*nth_traceback_table)[position].get(st_pointer,sc_pointer);
505 if (st_pointer == -1){
506 std::cerr <<
"No valid path at Position: " << position << std::endl;
515 int16_t st_pointer = (*ending_nth_viterbi)[n].st_tb;
516 int16_t sc_pointer = (*ending_nth_viterbi)[n].score_tb;
521 for(
size_t position =
seq_size -1 ; position>0 ; position--){
522 nthScore& temp = (*(*naive_nth_scores)[position][st_pointer])[sc_pointer];
523 st_pointer = temp.
st_tb;
525 if (st_pointer == -1){
526 std::cerr <<
"No valid path at Position: " << position << std::endl;