+ parameter transfer to python layer works
[qpalma.git] / QPalmaDP / print_align.cpp
1 #include "fill_matrix.h"
2 using namespace std;
3
4 void print_align(Pre_score* matrix, int length_est, int length_dna,Align_pair* vektor, int result_length, int print_matrix)
5
6 {
7 //Druck der matrix
8 switch(print_matrix)
9 {
10 case 1:
11 {
12 cout <<"Matrix: \n";
13
14 for (int k = 0; k<length_est; k++)//k Zeile, l Spalte
15 {
16 cout << "Zeile " << k << ":\t";
17 for (int l= 0; l<length_dna; l++)
18 {
19 cout << ((Pre_score*)matrix + (k*length_dna) + l)->value <<"\t";
20 }
21 cout <<"\n";
22 }
23 break;
24 }
25
26 case 2:
27 {
28 cout <<"Matrix: \n";
29
30 for (int k = 0; k<length_est; k++)//k Zeile, l Spalte
31 {
32 cout << "Zeile " << k << ":\t";
33 for (int l= 0; l<length_dna; l++)
34 {
35 if (((((Pre_score*)matrix + (k*length_dna) + l)->prev_i) == k-1) && ((((Pre_score*)matrix + (k*length_dna) + l)->prev_j) == l-1))
36 cout << "\\" <<((Pre_score*)matrix + (k*length_dna) + l)->value <<"\t";
37 else if (((((Pre_score*)matrix + (k*length_dna) + l)->prev_i) == k) && ((((Pre_score*)matrix + (k*length_dna) + l)->prev_j) == l-1))
38 cout << "<"<< ((Pre_score*)matrix + (k*length_dna) + l)->value <<"\t";
39 else if (((((Pre_score*)matrix + (k*length_dna) + l)->prev_i) == k -1) && ((((Pre_score*)matrix + (k*length_dna) + l)->prev_j) == l))
40 cout << "|"<< ((Pre_score*)matrix + (k*length_dna) + l)->value <<"\t";
41 else { cout << ((Pre_score*)matrix + (k*length_dna) + l)->value << "(";
42 cout << ((Pre_score*)matrix + (k*length_dna) + l)->prev_i << "," << ((Pre_score*)matrix + (k*length_dna) + l)->prev_j << ")\t";
43 }
44
45 }
46 cout <<"\n";
47 }
48
49 cout << "length_est" << length_est << "\n";
50 cout << "length_dna" << length_dna << "\n";
51 cout << "result_length: " << result_length << "\n";
52
53
54 break;
55 }
56
57 case 3:
58 {
59 //Druck des Alignment
60
61 // cout << "Alignment\n" ;
62 int j = 0;
63 // cout << "resultlength: " << result_length <<"\n";
64 while (j<result_length) {
65 int pacman = j;
66 cout << "D:(" <<j<<")\t";
67 for (int i=0; ((j<result_length) && (i<50)); i++)
68 {
69 cout << vektor[j].dna_char << " ";
70 j++;
71 }
72
73 cout << "\n";
74
75 cout << "E:(" <<pacman<<")\t";
76 for (int i=0;((pacman<result_length) && (i<50)); i++)
77 {
78 cout << vektor[pacman].est_char << " ";
79 pacman++;
80 }
81 cout << "\n\n";
82 }
83
84 //Ende Druck Alignment
85 break ;
86 }
87
88 default:
89 {
90 cout <<"";
91 }
92 }
93
94
95
96 }
97