diff --git a/templates/iSkyLIMS_wetlab/StatsPerResearcher.html b/templates/iSkyLIMS_wetlab/StatsPerResearcher.html index b2c04a5..f5fe387 100644 --- a/templates/iSkyLIMS_wetlab/StatsPerResearcher.html +++ b/templates/iSkyLIMS_wetlab/StatsPerResearcher.html @@ -2,13 +2,13 @@ {% load static %} {% block content %} {% csrf_token %} - - - - - + + + + + - + {% if researcher_statistics %}
@@ -48,12 +48,12 @@

Projects using the sequencer {{sequencer_name }} :

- +

Graphic Statistics for Investigator {{researcher_statistics.researcher_name}}

-
+
{% for seq_researcher_graph in researcher_statistics.researcher_graph %} {% for id_graph, chart in seq_researcher_graph %}
@@ -67,35 +67,35 @@

Projects using the sequencer {{sequencer_name }} :

- - - -
-
-
-

{{researcher_statistics.researcher_name}} projects comparison

-
- - {% for seq_comp_graph in researcher_statistics.comp_graphs %} - {% for id_graph, chart in seq_comp_graph %} -
- -
- {{ chart|safe }} -
- {% endfor %} - {% endfor %} -
-
-
-
+ + {{% if researcher_statistics.comp_graphs %}} +
+
+
+

{{researcher_statistics.researcher_name}} projects comparison

+
+ + {% for seq_comp_graph in researcher_statistics.comp_graphs %} + {% for id_graph, chart in seq_comp_graph %} +
+ +
+ {{ chart|safe }} +
+ {% endfor %} + {% endfor %} +
+
+
+
+ {{% endif %}}

Statistics Sequencer utilization for {{researcher_statistics.researcher_name}}

-
+
{{ researcher_statistics.sequencer_pie_graph |safe }} @@ -116,7 +116,7 @@

Projects using the sequencer {{sequencer_name }} :

{% csrf_token %} -
+
{% if request.user|has_group:"WetlabManager" %}
@@ -124,7 +124,7 @@

Projects using the sequencer {{sequencer_name }} :

{% endif %}
- +
@@ -136,7 +136,7 @@

Projects using the sequencer {{sequencer_name }} :


- +
@@ -145,7 +145,7 @@

Projects using the sequencer {{sequencer_name }} :

- +

@@ -159,7 +159,7 @@

Projects using the sequencer {{sequencer_name }} :

{% include 'iSkyLIMS_wetlab/search-researcher-help.html' %} - +
{% endif %} diff --git a/views.py b/views.py index 70a3c64..0bce5fa 100644 --- a/views.py +++ b/views.py @@ -1719,68 +1719,68 @@ def stats_per_researcher (request): else: total_lanes_summary[sequencer] = '' - - comp_graphs, comp_seq_graphs = [] , [] - for sequencer in projects_name_dict.keys() : - for lane_summary in total_lanes_summary[sequencer] : - q_30_value, mean_q_value , yield_mb_value , cluster_pf_value = lane_summary.get_stats_info().split(';') - total_q_30_list.append(float(q_30_value)) - total_mean_q_list.append(float(mean_q_value)) - total_yield_mb_list.append(int(yield_mb_value.replace(',',''))) - total_cluster_pf_list.append(int(cluster_pf_value.replace(',',''))) - comp_q30_dict[sequencer]['Other investigators']= format(statistics.mean(total_q_30_list), '.2f') - comp_mean_q_dict[sequencer]['Other investigators'] = format(statistics.mean(total_mean_q_list), '.2f') - comp_yield_mb_dict[sequencer]['Other investigators'] = sum(total_yield_mb_list) - comp_cluster_pf_dict[sequencer]['Other investigators'] = sum(total_cluster_pf_list) - # create the graphic for q30 quality - - theme = '' - heading = 'Comparation graphics for Q > 30 for investigator ' + r_name - sub_caption = '' - x_axis_name = r_name + ' versus other investigators' - y_axis_name = 'Q 30 (in %)' - - data_source = column_graphic_simple (heading, sub_caption, x_axis_name, y_axis_name, theme, comp_q30_dict[sequencer]) - seq_chart = sequencer + 'comparation_q30_chart' - seq_graph = sequencer + 'comparation_q30_graph' - comp_q30_seq_graph = FusionCharts("column3d", seq_graph , "500", "350",seq_chart , "json", data_source).render() - comp_seq_graphs.append([seq_chart, comp_q30_seq_graph]) - - theme = '' - heading = 'Comparation graphics for Mean Quality for investigator ' + r_name - sub_caption = '' - x_axis_name = r_name + ' versus other investigators' - y_axis_name = 'Mean Quality' - data_source = column_graphic_simple (heading, sub_caption, x_axis_name, y_axis_name, theme, comp_mean_q_dict[sequencer]) - seq_chart = sequencer + 'comparation_mean_q_chart' - seq_graph = sequencer + 'comparation_mean_q_graph' - comp_mean_q_seq_graph = FusionCharts("column3d", seq_graph , "500", "350",seq_chart , "json", data_source).render() - comp_seq_graphs.append([seq_chart, comp_mean_q_seq_graph]) - - theme = '' - heading = 'Comparation graphics for Yield (Mb) for investigator ' + r_name - sub_caption = '' - x_axis_name = r_name + ' versus other investigators' - y_axis_name = '(Mb)' - data_source = column_graphic_simple (heading, sub_caption, x_axis_name, y_axis_name, theme, comp_yield_mb_dict[sequencer]) - seq_chart = sequencer + 'comparation_yield_mb_chart' - seq_graph = sequencer + 'comparation_yield_mb_graph' - comp_yield_mb_seq_graph = FusionCharts("column3d", seq_graph , "500", "350",seq_chart , "json", data_source).render() - comp_seq_graphs.append([seq_chart, comp_yield_mb_seq_graph]) - - theme = '' - heading = 'Comparation graphics for Cluster PF for investigator ' + r_name - sub_caption = '' - x_axis_name = r_name + ' versus other investigators' - y_axis_name = 'Cluster pf' - data_source = column_graphic_simple (heading, sub_caption, x_axis_name, y_axis_name, theme, comp_cluster_pf_dict[sequencer]) - seq_chart = sequencer + 'comparation_cluster_pf_chart' - seq_graph = sequencer + 'comparation_cluster_pf_graph' - comp_cluster_pf_seq_graph = FusionCharts("column3d", seq_graph , "500", "350",seq_chart , "json", data_source).render() - comp_seq_graphs.append([seq_chart, comp_cluster_pf_seq_graph]) - comp_graphs.append(comp_seq_graphs) - - researcher_statistics ['comp_graphs'] = comp_graphs + if len(total_lanes_summary) > 0: + comp_graphs, comp_seq_graphs = [] , [] + for sequencer in projects_name_dict.keys() : + for lane_summary in total_lanes_summary[sequencer] : + q_30_value, mean_q_value , yield_mb_value , cluster_pf_value = lane_summary.get_stats_info().split(';') + total_q_30_list.append(float(q_30_value)) + total_mean_q_list.append(float(mean_q_value)) + total_yield_mb_list.append(int(yield_mb_value.replace(',',''))) + total_cluster_pf_list.append(int(cluster_pf_value.replace(',',''))) + comp_q30_dict[sequencer]['Other investigators']= format(statistics.mean(total_q_30_list), '.2f') + comp_mean_q_dict[sequencer]['Other investigators'] = format(statistics.mean(total_mean_q_list), '.2f') + comp_yield_mb_dict[sequencer]['Other investigators'] = sum(total_yield_mb_list) + comp_cluster_pf_dict[sequencer]['Other investigators'] = sum(total_cluster_pf_list) + # create the graphic for q30 quality + + theme = '' + heading = 'Comparation graphics for Q > 30 for investigator ' + r_name + sub_caption = '' + x_axis_name = r_name + ' versus other investigators' + y_axis_name = 'Q 30 (in %)' + + data_source = column_graphic_simple (heading, sub_caption, x_axis_name, y_axis_name, theme, comp_q30_dict[sequencer]) + seq_chart = sequencer + 'comparation_q30_chart' + seq_graph = sequencer + 'comparation_q30_graph' + comp_q30_seq_graph = FusionCharts("column3d", seq_graph , "500", "350",seq_chart , "json", data_source).render() + comp_seq_graphs.append([seq_chart, comp_q30_seq_graph]) + + theme = '' + heading = 'Comparation graphics for Mean Quality for investigator ' + r_name + sub_caption = '' + x_axis_name = r_name + ' versus other investigators' + y_axis_name = 'Mean Quality' + data_source = column_graphic_simple (heading, sub_caption, x_axis_name, y_axis_name, theme, comp_mean_q_dict[sequencer]) + seq_chart = sequencer + 'comparation_mean_q_chart' + seq_graph = sequencer + 'comparation_mean_q_graph' + comp_mean_q_seq_graph = FusionCharts("column3d", seq_graph , "500", "350",seq_chart , "json", data_source).render() + comp_seq_graphs.append([seq_chart, comp_mean_q_seq_graph]) + + theme = '' + heading = 'Comparation graphics for Yield (Mb) for investigator ' + r_name + sub_caption = '' + x_axis_name = r_name + ' versus other investigators' + y_axis_name = '(Mb)' + data_source = column_graphic_simple (heading, sub_caption, x_axis_name, y_axis_name, theme, comp_yield_mb_dict[sequencer]) + seq_chart = sequencer + 'comparation_yield_mb_chart' + seq_graph = sequencer + 'comparation_yield_mb_graph' + comp_yield_mb_seq_graph = FusionCharts("column3d", seq_graph , "500", "350",seq_chart , "json", data_source).render() + comp_seq_graphs.append([seq_chart, comp_yield_mb_seq_graph]) + + theme = '' + heading = 'Comparation graphics for Cluster PF for investigator ' + r_name + sub_caption = '' + x_axis_name = r_name + ' versus other investigators' + y_axis_name = 'Cluster pf' + data_source = column_graphic_simple (heading, sub_caption, x_axis_name, y_axis_name, theme, comp_cluster_pf_dict[sequencer]) + seq_chart = sequencer + 'comparation_cluster_pf_chart' + seq_graph = sequencer + 'comparation_cluster_pf_graph' + comp_cluster_pf_seq_graph = FusionCharts("column3d", seq_graph , "500", "350",seq_chart , "json", data_source).render() + comp_seq_graphs.append([seq_chart, comp_cluster_pf_seq_graph]) + comp_graphs.append(comp_seq_graphs) + + researcher_statistics ['comp_graphs'] = comp_graphs # Sequencer graphic utilization sequencer_used = {}