Changed trials-in-common page to use a single database query to get analyses. Changed...
[sgn.git] / mason / analytics_protocols / analytics_protocols_details.mas
blob3c6dbb5f62e64e53de6ef93f3a6d5921095187be
1 <%args>
2 $analytics_protocol_id
3 $analytics_protocol_name
4 $analytics_protocol_description
5 $analytics_protocol_type_id
6 $analytics_protocol_type_name
7 $analytics_protocol_create_date
8 $analytics_protocol_properties
9 $analytics_protocol_result_summary
10 </%args>
12 <div class="row">
13     <div class="col-sm-12">
15         <table class="table table-hover table-bordered" >
17             <tr>
18                 <td><b>Analytics Protocol Name</b></td>
19                 <td>
20                     <div id="analytics_protocol_name">
21 % if ($analytics_protocol_name) {
22 %   print "$analytics_protocol_name";
23 % } else {
24 %   print "<span class='text-danger'>[No Analytics Protocol Name]</span>";
25 % }
26                     </div>
27                 </td>
28             </tr>
30             <tr><td><b>Description</b></td>
31                 <td>
32                     <div id="analytics_protocol_description">
33 % if ($analytics_protocol_description) {
34 %  print "$analytics_protocol_description";
35 % } else {
36 %  print "<span class='text-danger'>[No Description]</span>";
37 % }
38                     </div>
39                 </td>
40             </tr>
42             <tr><td><b>Type</b></td>
43                 <td>
44                     <div id="analytics_protocol_type_name">
45 %  print "$analytics_protocol_type_name";
46                     </div>
47                 </td>
48             </tr>
50             <tr><td><b>Created</b></td>
51                 <td>
52                     <div id="analytics_protocol_create_date">
53 %  print "$analytics_protocol_create_date";
54                     </div>
55                 </td>
56             </tr>
58             <tr><td><b>Properties</b></td>
59                 <td>
60                     <div id="analytics_protocol_properties">
61 %  if ($analytics_protocol_properties) {
62 %    foreach my $k (sort keys %{$analytics_protocol_properties}) {
63 %       print $k." : ".$analytics_protocol_properties->{$k}."<br/>";
64 %    }
65 %  }
66                     </div>
67                 </td>
68             </tr>
70             <tr><td><b>Result Summary</b></td>
71                 <td>
72                     <div id="analytics_protocol_result_summary">
73 %  if ($analytics_protocol_result_summary) {
74 %       foreach my $s (@$analytics_protocol_result_summary) {
75 %           print "<div class='well well-sm'>";
76 %           my $analytics_result_type = $s->{statistics_select_original};
77 %           my $env_corr_results = $s->{env_correlation_results};
78 %           my $env_iterations = $s->{env_iterations};
79 %           my $number_iterations = $s->{number_iterations};
80 %           my $varcomps = $s->{env_varcomps};
81 %           my $avg_varcomps_display = $s->{avg_varcomps_display};
82 %           my $avg_cross_validation_display = $s->{avg_cross_validation_display};
83 %           if ($analytics_result_type) {
84 %               print "<h4>Type: ".$analytics_result_type."</h4>";
85 %           }
86 %           if ($env_corr_results) {
87 %               print "<strong>Simulated Environment Correlation Results</strong><br/>";
88 %               print $number_iterations." iterations<br/>";
89 %               foreach my $env_type (sort keys %$env_corr_results) {
90 %                   my $mean = $env_corr_results->{$env_type}->{mean};
91 %                   my $std = $env_corr_results->{$env_type}->{std};
92 %                   print $env_type." : ".$mean." +- ".$std."<br/>";
93 %               }
94 %           }
95 %           if ($env_iterations) {
96 %               print "<br/><strong>Simulated Environment Parameters</strong><br/>";
97 %               foreach my $iteration (sort keys %$env_iterations) {
98 %                   print $iteration." : ";
99 %                   foreach my $param (sort keys %{$env_iterations->{$iteration}}) {
100 %                       print " ".$param." : ".$env_iterations->{$iteration}->{$param}." ";
101 %                   }
102 %                   print "<br/>";
103 %               }
104 %           }
105 %           my @types = ('original', 'altered', 'env_linear', 'env_1DN', 'env_2DN', 'env_ar1xar1', 'env_random', 'env_realdata');
106 %           #if ($varcomps) {
107 %           #    print "<br/><strong>Variance Components</strong>";
108 %           #    foreach my $i (@$varcomps) {
109 %           #       print "<br/>$i->{type}<br/>";
110 %           #        foreach my $t (@types) {
111 %           #            if ($i->{$t}->{covariance}) {
112 %           #                my $string = " $t: ";
113 %           #                foreach my $i (@{$i->{$t}->{covariance}}) {
114 %           #                    $string .= $i->[0]." : ".$i->[1]." ";
115 %           #                }
116 %           #                print " ".$string."<br/>";
117 %           #            }
118 %           #            if ($i->{$t}->{genetic_covariance}) {
119 %           #                my $string = " $t: Genetic: ". join(',', @{$i->{$t}->{genetic_covariance}} );
120 %           #                $string .= " Env: ". join(',', @{$i->{$t}->{env_covariance}} );
121 %           #                $string .= " Residual: ".$i->{$t}->{residual};
122 %           #                print " ".$string."<br/>";
123 %           #            }
124 %           #        }
125 %           #    }
126 %           #}
127 %           if ($avg_varcomps_display) {
128 %               print "<br/><strong>Variance Components</strong><br/>";
129 %               foreach my $i (@$avg_varcomps_display) {
130 %                   if (defined($i->{mean})) {
131 %                       print "$i->{type}: $i->{type_scenario}: $i->{level}: $i->{mean} +- $i->{std}<br/>";
132 %                   }
133 %               }
134 %           }
135 %           if ($avg_cross_validation_display) {
136 %               print "<br/><strong>Cross Validation</strong><br/>";
137 %               foreach my $i (@$avg_cross_validation_display) {
138 %                   print "$i->{type}: $i->{type_scenario}: CV1: $i->{cv1_mean} +- $i->{cv1_std} CV2: $i->{cv2_mean} +- $i->{cv2_std}<br/>";
139 %               }
140 %           }
141 %           print "</div>";
142 %       }
143 %  }
144                     </div>
145                 </td>
146             </tr>
148         </table>
150     </div>
151 </div>