Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Fixed bug #38. Code unprotected
Browse files Browse the repository at this point in the history
  • Loading branch information
luissian committed Dec 13, 2019
1 parent 508f79c commit 26bd1a7
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 98 deletions.
72 changes: 36 additions & 36 deletions templates/iSkyLIMS_wetlab/StatsPerResearcher.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
{% load static %}
{% block content %}
{% csrf_token %}
<script type="text/javascript" src="{% static "iSkyLIMS_wetlab/js/fusioncharts/js/fusioncharts.widgets.js" %}"></script>
<script type="text/javascript" src="{% static "iSkyLIMS_wetlab/js/fusioncharts/js/fusioncharts.js" %}"></script>
<script type="text/javascript" src="{% static "iSkyLIMS_wetlab/js/fusioncharts/js/themes/fusioncharts.theme.fint.js" %}"></script>
<script type="text/javascript" src="{% static "iSkyLIMS_wetlab/js/fusioncharts/js/themes/fusioncharts.theme.ocean.js" %}"></script>
<script type="text/javascript" src="{% static "iSkyLIMS_wetlab/js/fusioncharts/js/themes/fusioncharts.theme.carbon.js" %}"></script>
<script type="text/javascript" src="{% static "iSkyLIMS_wetlab/js/fusioncharts/js/fusioncharts.widgets.js" %}"></script>
<script type="text/javascript" src="{% static "iSkyLIMS_wetlab/js/fusioncharts/js/fusioncharts.js" %}"></script>
<script type="text/javascript" src="{% static "iSkyLIMS_wetlab/js/fusioncharts/js/themes/fusioncharts.theme.fint.js" %}"></script>
<script type="text/javascript" src="{% static "iSkyLIMS_wetlab/js/fusioncharts/js/themes/fusioncharts.theme.ocean.js" %}"></script>
<script type="text/javascript" src="{% static "iSkyLIMS_wetlab/js/fusioncharts/js/themes/fusioncharts.theme.carbon.js" %}"></script>
<script type="text/javascript" src="{% static "iSkyLIMS_wetlab/js/fusioncharts/js/themes/fusioncharts.theme.zune.js" %}"></script>
<script type="text/javascript" src="{% static "iSkyLIMS_wetlab/js/wetlab.js" %}"></script>
<script type="text/javascript" src="{% static "iSkyLIMS_wetlab/js/wetlab.js" %}"></script>

{% if researcher_statistics %}
<div class="row row-space-2 margin-b-4">
Expand Down Expand Up @@ -48,12 +48,12 @@ <h3> Projects using the sequencer {{sequencer_name }} : </h3>
</div> <!--// end panel -->
</div> <!--// end col-sm-12 -->
</div> <!--// end row -->

<div class="row row-space-2 margin-b-4">
<div class="col-sm-12" >
<div class="panel panel-default">
<div class="panel-heading"><h3><center>Graphic Statistics for Investigator {{researcher_statistics.researcher_name}} </center></h3></div>
<div class="panel-body">
<div class="panel-body">
{% for seq_researcher_graph in researcher_statistics.researcher_graph %}
{% for id_graph, chart in seq_researcher_graph %}
<div class="col-sm-6" >
Expand All @@ -67,35 +67,35 @@ <h3> Projects using the sequencer {{sequencer_name }} : </h3>
</div> <!--// end panel -->
</div> <!--// end col-sm-8 -->
</div> <!--// end row -->




<div class="row row-space-2 margin-b-4">
<div class="col-sm-12" >
<div class="panel panel-default">
<div class="panel-heading"><h3><center> {{researcher_statistics.researcher_name}} projects comparison </center></h3></div>
<div class="panel-body">
<!-- comparations chart starts here-->
{% for seq_comp_graph in researcher_statistics.comp_graphs %}
{% for id_graph, chart in seq_comp_graph %}
<div class="col-sm-6" >
<!-- Showing graph-->
<div id="{{id_graph}}"> </div>
{{ chart|safe }}
</div> <!--// end col-sm-6 -->
{% endfor %}
{% endfor %}
</div> <!-- end of panel body -->
</div> <!--// end panel -->
</div> <!--// end col-sm-8 -->
</div> <!--// end row -->


{{% if researcher_statistics.comp_graphs %}}
<div class="row row-space-2 margin-b-4">
<div class="col-sm-12" >
<div class="panel panel-default">
<div class="panel-heading"><h3><center> {{researcher_statistics.researcher_name}} projects comparison </center></h3></div>
<div class="panel-body">
<!-- comparations chart starts here-->
{% for seq_comp_graph in researcher_statistics.comp_graphs %}
{% for id_graph, chart in seq_comp_graph %}
<div class="col-sm-6" >
<!-- Showing graph-->
<div id="{{id_graph}}"> </div>
{{ chart|safe }}
</div> <!--// end col-sm-6 -->
{% endfor %}
{% endfor %}
</div> <!-- end of panel body -->
</div> <!--// end panel -->
</div> <!--// end col-sm-8 -->
</div> <!--// end row -->
{{% endif %}}
<div class="row row-space-2 margin-b-4">
<div class="col-sm-8" >
<div class="panel panel-default">
<div class="panel-heading"><h3><center>Statistics Sequencer utilization for {{researcher_statistics.researcher_name}} </center></h3></div>
<div class="panel-body">
<div class="panel-body">
<!-- Sequencer pie Chart starts here-->
<div id="sequencer_pie_chart"> </div>
{{ researcher_statistics.sequencer_pie_graph |safe }}
Expand All @@ -116,15 +116,15 @@ <h3> Projects using the sequencer {{sequencer_name }} : </h3>
<form method="post" enctype="multipart/form-data" name="statsresearcher" id="statsresearcher" class="form-horizontal well">
{% csrf_token %}
<input type="hidden" name="action" value="researcher"/>
<div class="form-group required">
<div class="form-group required">
<label class="col-sm-5 control-label" for="researchername" >Fill the Investigator name </label>
{% if request.user|has_group:"WetlabManager" %}
<div class="col-sm-5"><input class="form-control" type="text" required = "required" name="researchername" id="reserchername" size="100" maxlength="100"></div>
{% else %}
<div class="col-sm-5"><input class="form-control" type="text" name="researchername" id="reserchername" value="{{user.get_username}}" size="100" maxlength="100" placeholder="{{user.get_username}}" readonly></div>
{% endif %}
</div> <!-- end from-group -->

<br>

<div class="form-group">
Expand All @@ -136,7 +136,7 @@ <h3> Projects using the sequencer {{sequencer_name }} : </h3>
<label class="col-sm-5 control-label" for="enddate" >End Date Search (DD-MM-YYYY)</label>
<div class="col-sm-5"><input class="form-control" type="date" name="enddate" value="" id="enddate"></div>
<br>

</div> <!-- end from-group -->
<input class="btn pull-left btn-primary" type="reset" value="Reset Fields">
<input class="btn pull-right btn-primary" type="submit" value="Submit">
Expand All @@ -145,7 +145,7 @@ <h3> Projects using the sequencer {{sequencer_name }} : </h3>
</div> <!-- end of panel body -->
</div> <!--// end panel -->
</div> <!--// end col-sm-7 -->

<!-- Insert the help panel -->
<BR><BR>
<div class="col-sm-3 col-sm-offset-1">
Expand All @@ -159,7 +159,7 @@ <h3> Projects using the sequencer {{sequencer_name }} : </h3>
</div> <!--// end panel -->
<!-- Insert the Help window when clicking on the button -->
{% include 'iSkyLIMS_wetlab/search-researcher-help.html' %}

</div> <!--// end row -->
<!-- End of FORM for searching RUN information -->
{% endif %}
Expand Down
124 changes: 62 additions & 62 deletions views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down

0 comments on commit 26bd1a7

Please sign in to comment.