diff --git a/planet/controllers/expression_profile.py b/planet/controllers/expression_profile.py index 094e42d..9e55e6e 100644 --- a/planet/controllers/expression_profile.py +++ b/planet/controllers/expression_profile.py @@ -74,18 +74,24 @@ def expression_profile_find(probe, species_id=None): @expression_profile.route('/compare//') +@expression_profile.route('/compare///') @cache.cached() -def expression_profile_compare(first_profile_id, second_profile_id): +def expression_profile_compare(first_profile_id, second_profile_id, normalize=0): """ Gets expression profile data from the database and renders it. - :param profile_id: ID of the profile to show + :param first_profile_id: internal ID of the first profile + :param second_profile_id: internal ID of the second profile + :param normalize: 1 to normalize profiles (to max value), 0 to disable + :return: """ first_profile = ExpressionProfile.query.get_or_404(first_profile_id) second_profile = ExpressionProfile.query.get_or_404(second_profile_id) - return render_template("compare_profiles.html", first_profile=first_profile, - second_profile=second_profile) + return render_template("compare_profiles.html", + first_profile=first_profile, + second_profile=second_profile, + normalize=normalize) @expression_profile.route('/compare_probes///') @@ -95,7 +101,11 @@ def expression_profile_compare_probes(probe_a, probe_b, species_id, normalize=0) """ Gets expression profile data from the database and renders it. - :param profile_id: ID of the profile to show + :param probe_a: name of the first probe + :param probe_b: name of the second probe + :param species_id: internal id of the species the probes are linked with + :param normalize: 1 to normalize profiles (to max value), 0 to disable + :return: """ first_profile = ExpressionProfile.query.filter_by(probe=probe_a).filter_by(species_id=species_id).first_or_404() second_profile = ExpressionProfile.query.filter_by(probe=probe_b).filter_by(species_id=species_id).first_or_404() diff --git a/planet/templates/compare_profiles.html b/planet/templates/compare_profiles.html index 5bae109..698e43d 100644 --- a/planet/templates/compare_profiles.html +++ b/planet/templates/compare_profiles.html @@ -3,10 +3,18 @@ {% block container %}

Comparing profiles of {{ first_profile.probe }} and {{ second_profile.probe }}

- {% if normalize == 1 %} - Disable normalization + {% if species_id %} + {% if normalize == 1 %} + Normalization: Enabled | (disable) + {% else %} + Normalization: Disabled | (enable) + {% endif %} {% else %} - Enable normalization + {% if normalize == 1 %} + Normalization: Enabled | (disable) + {% else %} + Normalization: Disabled | (enable) + {% endif %} {% endif %}