From 204a308be0f741726b9a620d88fbc22b22124c81 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 29 Dec 2023 18:55:37 +0000 Subject: Namespace all modules under gn2. We move all modules under a gn2 directory. This is important for "correct" packaging and deployment as a Guix service. --- .../partial_correlations/pcorrs_error.html | 65 +++++ .../partial_correlations/pcorrs_poll_results.html | 19 ++ .../pcorrs_results_presentation.html | 261 +++++++++++++++++++++ .../pcorrs_results_with_target_traits.html | 115 +++++++++ .../pcorrs_select_operations.html | 167 +++++++++++++ 5 files changed, 627 insertions(+) create mode 100644 gn2/wqflask/templates/partial_correlations/pcorrs_error.html create mode 100644 gn2/wqflask/templates/partial_correlations/pcorrs_poll_results.html create mode 100644 gn2/wqflask/templates/partial_correlations/pcorrs_results_presentation.html create mode 100644 gn2/wqflask/templates/partial_correlations/pcorrs_results_with_target_traits.html create mode 100644 gn2/wqflask/templates/partial_correlations/pcorrs_select_operations.html (limited to 'gn2/wqflask/templates/partial_correlations') diff --git a/gn2/wqflask/templates/partial_correlations/pcorrs_error.html b/gn2/wqflask/templates/partial_correlations/pcorrs_error.html new file mode 100644 index 00000000..8d6c4bbe --- /dev/null +++ b/gn2/wqflask/templates/partial_correlations/pcorrs_error.html @@ -0,0 +1,65 @@ +{% extends "base.html" %} +{% block title %}Error: {{message}}{% endblock %} +{% block content %} + + +
+
+
+
+ + + +

ERROR

+ +

+ This error is not what we wanted to see. Unfortunately errors + are part of all software systems and we need to resolve this + together. +

+

+ It is important to report this ERROR so we can fix it for everyone. +

+ +

+ Report to the GeneNetwork team by recording the steps you take + to reproduce this ERROR. Next to those steps, copy-paste below + stack trace, either as + a new + issue or E-mail this full page to one of the developers + directly. +

+
+ +

+ GeneNetwork error:
+ {{message}} +

+ + {%if command_id %} +

+ Please provide the following information to help with + troubleshooting:
+ Command ID: {{command_id}} +

+ {%endif%} + +

+ To check if this already a known issue, search the + issue + tracker. +

+ + Toggle full stack trace +
+
+	  GeneNetwork {{ version }} {% for line in stack %} {{ line }}
+	  {% endfor %}
+	
+
+
+
+
+ + +{% endblock %} diff --git a/gn2/wqflask/templates/partial_correlations/pcorrs_poll_results.html b/gn2/wqflask/templates/partial_correlations/pcorrs_poll_results.html new file mode 100644 index 00000000..38577c32 --- /dev/null +++ b/gn2/wqflask/templates/partial_correlations/pcorrs_poll_results.html @@ -0,0 +1,19 @@ +{%extends "base.html"%} + +{%block title%}Partial Correlations:{%endblock%} + +{%block css%} + +{%endblock%} + +{%block content%} + +
+
+

Computing partial correlations...

+ Image indicating computation of partial correlations is ongoing +
+
+{%endblock%} diff --git a/gn2/wqflask/templates/partial_correlations/pcorrs_results_presentation.html b/gn2/wqflask/templates/partial_correlations/pcorrs_results_presentation.html new file mode 100644 index 00000000..dac02397 --- /dev/null +++ b/gn2/wqflask/templates/partial_correlations/pcorrs_results_presentation.html @@ -0,0 +1,261 @@ +{%extends "base.html"%} + +{%block title%}Partial Correlations:{%endblock%} + +{%block css%} + + + + +{%endblock%} + +{%block content%} +
+

+ Primary Trait

+ + {{primary["dataset_type"]}}/{{primary["trait_name"]}} + [{{primary["symbol"] }} on Chr {{primary["chr"]}} @ {{primary["mb"]}}]: + {{primary["description"]}} + --- FROM: {{primary["dataset_name"]}} +

+

Control Traits

+ {%for trait in controls:%} + + {{trait["dataset_type"]}}/{{trait["trait_name"]}} + [{{trait["symbol"] }} on Chr {{trait["chr"]}} @ {{trait["mb"]}}]: + {{trait["description"]}} + --- FROM: {{trait["dataset_name"]}}
+ {%endfor%} +

+ +
+ {%if dataset_type == "Publish":%} + + + + + + + + + + + + + + + + + + + + {%for idx, trait in enumerate(correlations, start=1):%} + + + + + + + + + + + + + + + {%endfor%} + +
+ IndexRecordPhenotypeAuthorsYearNPartial {%if "spearman" in (method | lower):%}rho{%else:%}r{%endif%}p(partial {%if "spearman" in (method | lower):%}rho{%else:%}r{%endif%}){%if "spearman" in (method | lower):%}rho{%else:%}r{%endif%}p({%if "spearman" in (method | lower):%}rho{%else:%}r{%endif%})delta {%if "spearman" in (method | lower):%}rho{%else:%}r{%endif%}
+ + {{idx}} + + {{trait["trait_name"]}} + + + {{trait["post_publication_description"]}}{{trait["authors"]}}{{trait["year"]}}{{trait["noverlap"]}} + {{format_number(trait.get("partial_corr"))}} + + {{format_number(trait.get("partial_corr_p_value"))}} + + {{format_number(trait.get("corr"))}} + + {{format_number(trait.get("corr_p_value"))}} + + {{format_number(trait.get("delta"))}} +
+ {%endif%} + + {%if dataset_type == "Geno":%} + + + + + + + + + + + + + + + + + + + {%for idx, trait in enumerate(correlations, start=1):%} + + + + + + + + + + + + + + {%endfor%} + +
IndexLocusChrMegabaseNPartial {%if "spearman" in (method | lower):%}rho{%else:%}r{%endif%}p(partial {%if "spearman" in (method | lower):%}rho{%else:%}r{%endif%}){%if "spearman" in (method | lower):%}rho{%else:%}r{%endif%}p({%if "spearman" in (method | lower):%}rho{%else:%}r{%endif%})delta {%if "spearman" in (method | lower):%}rho{%else:%}r{%endif%}
+ + {{idx}} + + {{trait["trait_name"]}} + + {{trait["chr"]}}{{trait["mb"]}}{{trait["noverlap"]}} + {{format_number(trait.get("partial_corr"))}} + + {{format_number(trait.get("partial_corr_p_value"))}} + + {{format_number(trait.get("corr"))}} + + {{format_number(trait.get("corr_p_value"))}} + + {{format_number(trait.get("delta"))}} +
+ {%endif%} + + {%if dataset_type == "ProbeSet":%} + + + + + + + + + + + + + + + + + + + + + + + + + + + {%for idx, trait in enumerate(correlations, start=1):%} + + + + + + + + + + + + + + + + + + + + + + {%endfor%} + +
IndexRecordGene IDHomologene IDSymbolDescriptionChrMegabaseMean ExprNSample Partial {%if "spearman" in (method | lower):%}rho{%else:%}r{%endif%}Sample p(partial {%if "spearman" in (method | lower):%}rho{%else:%}r{%endif%})Sample {%if "spearman" in (method | lower):%}rho{%else:%}r{%endif%}Sample p({%if "spearman" in (method | lower):%}rho{%else:%}r{%endif%})delta {%if "spearman" in (method | lower):%}rho{%else:%}r{%endif%}Lit CorrTissue {%if "spearman" in (method | lower):%}rho{%else:%}r{%endif%}Tissue p({%if "spearman" in (method | lower):%}rho{%else:%}r{%endif%})
+ + {{idx}} + + {{trait["trait_name"]}} + + {{trait["geneid"]}}{{trait["homologeneid"]}}{{trait["symbol"]}}{{trait["description"]}}{{trait["chr"]}}{{trait["mb"]}}{{trait["mean_expr"]}}{{trait["noverlap"]}} + {{format_number(trait.get("partial_corr"))}} + + {{format_number(trait.get("partial_corr_p_value"))}} + + {{format_number(trait.get("corr"))}} + + {{format_number(trait.get("corr_p_value"))}} + + {{format_number(trait.get("delta"))}} + + {{format_number(trait.get("l_corr"))}} + + {{format_number(trait.get("tissue_corr"))}} + + {{format_number(trait.get("tissue_p_value"))}} +
+ {%endif%} + +
+
+{%endblock%} + +{%block js%} +{%if step == "select-corr-method":%} + + +{%endif%} +{%endblock%} diff --git a/gn2/wqflask/templates/partial_correlations/pcorrs_results_with_target_traits.html b/gn2/wqflask/templates/partial_correlations/pcorrs_results_with_target_traits.html new file mode 100644 index 00000000..c1ef6001 --- /dev/null +++ b/gn2/wqflask/templates/partial_correlations/pcorrs_results_with_target_traits.html @@ -0,0 +1,115 @@ +{%extends "base.html"%} + +{%block title%}Partial Correlations:{%endblock%} + +{%block css%} + + + + + +{%endblock%} + +{%block content%} +
+

+ Primary Trait

+ + {{primary["dataset_type"]}}/{{primary["trait_name"]}} + [{{primary["symbol"] }} on Chr {{primary["chr"]}} @ {{primary["mb"]}}]: + {{primary["description"]}} + --- FROM: {{primary["dataset_name"]}} +

+

Control Traits

+ {%for trait in controls:%} + + {{trait["dataset_type"]}}/{{trait["trait_name"]}} + [{{trait["symbol"] }} on Chr {{trait["chr"]}} @ {{trait["mb"]}}]: + {{trait["description"]}} + --- FROM: {{trait["dataset_name"]}}
+ {%endfor%} +

+ + + + + + + + + + + + {%if method == "spearmans":%} + + + + + + {%else:%} + + + + + + {%endif%} + + + + + {%for idx, trait in enumerate(pcorrs, start=1):%} + + + + + + + + + + + + + + + {%else:%} + + + + {%endfor%} + +
_IndexDatabaseRecordSymbolDescriptionNPartial rhop(partial rho)rhop(rho)delta rhoPartial rp(partial r)rp(r)delta r
+ + {{idx}}{{trait["dataset_name"]}} + + {{trait["trait_name"]}} + + {{trait["symbol"]}}{{trait["description"]}}{{trait["noverlap"]}}{{format_number(trait["partial_corr"])}}{{format_number(trait["partial_corr_p_value"])}}{{format_number(trait["corr"])}}{{format_number(trait["corr_p_value"])}}{{format_number(trait["delta"])}}
+ No correlations were computed +
+ +
+{%endblock%} + +{%block js%} + +{%endblock%} diff --git a/gn2/wqflask/templates/partial_correlations/pcorrs_select_operations.html b/gn2/wqflask/templates/partial_correlations/pcorrs_select_operations.html new file mode 100644 index 00000000..fe7f8cd4 --- /dev/null +++ b/gn2/wqflask/templates/partial_correlations/pcorrs_select_operations.html @@ -0,0 +1,167 @@ +{%extends "base.html"%} + +{%block title%}Partial Correlations:{%endblock%} + +{%block css%} + + + + + +{%endblock%} + +{%block content%} +
+
+ {%with messages = get_flashed_messages(with_categories=true)%} + {%if messages:%} + + {%endif%} + {%endwith%} + + +

Partial Correlation

+
Please select one primary trait, one to three control traits, and at least one target trait.
+
+ + + + + + + + + + + + + + + + + + + + {%for trait in traits:%} + + + + + + + + + + + + + + {%endfor%} + +
Primary (X)Controls (Z)Targets (Y)IgnoredDatasetTrait IDSymbolDescriptionLocationMeanMax LRSMax LRS Location Chr and Mb
+ + + + + + + + {{trait.get("dataset", "_")}} + {{trait.get("trait_name", "_")}}{{trait.get("symbol", "_")}}{{trait.get("description", "_")}}{{trait.get("location", "_")}}{{trait.get("mean", "_")}}{{trait.get("lrs", "_")}}{{trait.get("lrs_location", "_")}}
+ +
+

Compute partial correlations for target selected above:

+ + + +
+ +

OR

+

Compute partial correlation for each trait in the database below:

+ +
+ + +
+ +
+ + +
+ +
+ + +
+ + +
+
+{%endblock%} + +{%block js%} + +{%endblock%} -- cgit v1.2.3