Skip to content

Commit 3efc415

Browse files
committed
Add use_external_help config option
If set, use Manuel's Canto tutorial: https://pombase.github.io/canto_tutorial/ Refs #2835
1 parent 48ce0a7 commit 3efc415

File tree

5 files changed

+64
-7
lines changed

5 files changed

+64
-7
lines changed

canto.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ strains_mode: 0
4848
instance_front_path: /docs/instance_front
4949
canto_front_path: /docs/canto_front
5050
help_path: /docs/index
51+
external_help_url: 'https://pombase.github.io/canto_tutorial/'
52+
53+
use_external_help: 0
5154

5255
base_docs_path: docs
5356

@@ -1935,6 +1938,7 @@ available_annotation_type_list:
19351938
complexes). As a general rule, molecular functions correspond to
19361939
single step activities performed by individual gene products.
19371940
detailed_help_path: /docs/go_annotation
1941+
external_help_url: 'https://pombase.github.io/canto_tutorial/go_MF/'
19381942
- name: biological_process
19391943
category: ontology
19401944
abbreviation: P
@@ -1973,6 +1977,7 @@ available_annotation_type_list:
19731977
term request because there is no translation machinery specifically for
19741978
histone H2A.
19751979
detailed_help_path: /docs/go_annotation
1980+
external_help_url: 'https://pombase.github.io/canto_tutorial/go_BP/'
19761981
- name: cellular_component
19771982
category: ontology
19781983
abbreviation: C
@@ -2004,6 +2009,7 @@ available_annotation_type_list:
20042009
proteins or nucleic acids. Cellular component also does not include
20052010
multicellular anatomical terms.
20062011
detailed_help_path: /docs/go_annotation
2012+
external_help_url: 'https://pombase.github.io/canto_tutorial/go_CC/'
20072013
- name: host_phenotype
20082014
category: ontology
20092015
namespace: 'host_phenotype'
@@ -2204,6 +2210,7 @@ available_annotation_type_list:
22042210
Alleles may be annotated with multiple phenotype terms,
22052211
including both normal and abnormal phenotypes for one allele.
22062212
detailed_help_path: /docs/fypo_annotation
2213+
external_help_url: 'https://pombase.github.io/canto_tutorial/phenotypes/'
22072214
- name: post_translational_modification
22082215
category: ontology
22092216
namespace: PSI-MOD
@@ -2221,6 +2228,7 @@ available_annotation_type_list:
22212228
evidence_codes:
22222229
- IDA
22232230
detailed_help_path: /docs/modification_annotation
2231+
external_help_url: 'https://pombase.github.io/canto_tutorial/protein_modification/'
22242232
clear_extensions_on_feature_change:
22252233
- residue
22262234
- name: wt_rna_expression
@@ -2250,6 +2258,7 @@ available_annotation_type_list:
22502258
- Reporter gene assay
22512259
- RNA-sequencing evidence
22522260
detailed_help_path: /docs/gene_expression
2261+
external_help_url: 'https://pombase.github.io/canto_tutorial/rna_protein_level/'
22532262
- name: wt_protein_expression
22542263
category: ontology
22552264
ontology_size: small
@@ -2266,6 +2275,7 @@ available_annotation_type_list:
22662275
- Reporter gene assay
22672276
- Western blot
22682277
detailed_help_path: /docs/gene_expression
2278+
external_help_url: 'https://pombase.github.io/canto_tutorial/rna_protein_level/'
22692279
- name: genotype_interaction
22702280
category: genotype_interaction
22712281
feature_type: genotype
@@ -2306,6 +2316,7 @@ available_annotation_type_list:
23062316
- Synthetic Growth Defect
23072317
- Synthetic Lethality
23082318
- Synthetic Rescue
2319+
external_help_url: 'https://pombase.github.io/canto_tutorial/genetic_interaction/'
23092320
- name: genetic_interaction
23102321
category: interaction
23112322
display_name: 'legacy genetic interaction'
@@ -2322,6 +2333,7 @@ available_annotation_type_list:
23222333
- Synthetic Lethality
23232334
- Synthetic Rescue
23242335
detailed_help_path: /docs/genetic_interaction_annotation
2336+
external_help_url: 'https://pombase.github.io/canto_tutorial/genetic_interaction/'
23252337
- name: physical_interaction
23262338
category: interaction
23272339
display_name: 'physical interaction'
@@ -2344,6 +2356,7 @@ available_annotation_type_list:
23442356
- Reconstituted Complex
23452357
- Two-hybrid
23462358
detailed_help_path: /docs/physical_interaction_annotation
2359+
external_help_url: 'https://pombase.github.io/canto_tutorial/physical_interaction/'
23472360
- name: protein_sequence_feature_or_motif
23482361
category: ontology
23492362
ontology_size: small
@@ -2359,6 +2372,7 @@ available_annotation_type_list:
23592372
peptide_localization_signal
23602373
help_text: >
23612374
A Protein localization signal is a peptide sub-sequence used to target the protein to a specific organelle.
2375+
external_help_url: 'https://pombase.github.io/canto_tutorial/protein_sequence_feature/'
23622376

23632377
# restrict the list of annotation types
23642378
enabled_annotation_type_list:
@@ -2438,27 +2452,35 @@ help_text:
24382452
biological_process_definition:
24392453
inline: Annotate a gene product's role in a process.
24402454
docs_path: "go_annotation#process"
2455+
url: "https://pombase.github.io/canto_tutorial/go_BP/"
24412456
cellular_component_definition:
24422457
inline: Annotate the location in a cell where a gene product acts.
24432458
docs_path: "go_annotation#component"
2459+
url: 'https://pombase.github.io/canto_tutorial/go_CC/'
24442460
molecular_function_definition:
24452461
inline: Annotate a gene product's molecular activity.
24462462
docs_path: "go_annotation#function"
2463+
url: 'https://pombase.github.io/canto_tutorial/go_MF/'
24472464
post_translational_modification_definition:
24482465
inline: Annotate the type, position, timing, etc. of covalent protein modifications.
24492466
docs_path: "modification_annotation"
2467+
url: 'https://pombase.github.io/canto_tutorial/protein_modification/'
24502468
wt_rna_expression_definition:
24512469
inline: Annotate qualitative descriptions for the normal level and timing of RNA expression from a gene.
24522470
docs_path: "gene_expression"
2471+
url: 'https://pombase.github.io/canto_tutorial/rna_protein_level/'
24532472
wt_protein_expression_definition:
24542473
inline: Annotate qualitative descriptions for the normal level and timing of protein expression from a gene.
24552474
docs_path: "gene_expression"
2475+
url: 'https://pombase.github.io/canto_tutorial/rna_protein_level/'
24562476
physical_interaction_definition:
24572477
inline: Annotate interacting gene products and supporting evidence.
24582478
docs_path: "physical_interaction_annotation"
2479+
url: 'https://pombase.github.io/canto_tutorial/protein_sequence_feature/'
24592480
genetic_interaction_definition:
24602481
inline: Annotate interaction type and interacting genes.
24612482
docs_path: "genetic_interaction_annotation"
2483+
url: 'https://pombase.github.io/canto_tutorial/genetic_interaction/'
24622484
experimental_conditions_definition:
24632485
inline: >
24642486
Conditions are the aspects of the experimental setup that are independent

root/curs/autohandler

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ var flybase_mode = <% $flybase_mode ? 'true' : 'false' %>;
2929
var max_term_name_select_count = <% $max_term_name_select_count %>;
3030
var show_quick_deletion_buttons = <% $show_quick_deletion_buttons %>;
3131
var show_quick_wild_type_buttons = <% $show_quick_wild_type_buttons %>;
32+
var use_external_help = <% $use_external_help ? 'true' : 'false' %>;
3233
</script>
3334

3435
<div id="disabled-overlay"></div>
@@ -88,4 +89,5 @@ my $flybase_mode = $c->config()->{flybase_mode} || 0;
8889
my $max_term_name_select_count = $c->config()->{max_term_name_select_count} || 20;
8990
my $show_quick_deletion_buttons = $c->config()->{show_quick_deletion_buttons} || 0;
9091
my $show_quick_wild_type_buttons = $c->config()->{show_quick_wild_type_buttons} || 0;
92+
my $use_external_help = $c->config()->{use_external_help};
9193
</%init>

root/docs/annotation_type_list.mhtml

+18-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<ul class="canto-type-list">
22
% for my $an_type (@annotation_type_list) {
33
<li>
4-
% my $annotation_doc_path = $an_type->{detailed_help_path};
5-
% if (defined $annotation_doc_path) {
6-
% my $an_doc_uri = $c->uri_for($annotation_doc_path);
7-
<span class="canto-type-list-name"><a href="<% $an_doc_uri %>"><% $an_type->{display_name} %></a></span>:
4+
% my $annotation_doc_url = get_doc_uri($an_type);
5+
% if (defined $annotation_doc_url) {
6+
<span class="canto-type-list-name"><a href="<% $annotation_doc_url %>"><% $an_type->{display_name} %></a></span>:
87
% } else {
98
<span class="canto-type-list-name"><% $an_type->{display_name} %></span>:
109
% }
@@ -16,4 +15,19 @@
1615
<%init>
1716
my $config = $c->config();
1817
my @annotation_type_list = @{$config->{annotation_type_list}};
18+
19+
sub get_doc_uri
20+
{
21+
my $an_type = shift;
22+
23+
if ($c->config()->{use_external_help}) {
24+
my $external_help_url = $an_type->{external_help_url};
25+
if (defined $external_help_url) {
26+
return $external_help_url;
27+
}
28+
}
29+
30+
return $an_type->{detailed_help_path};
31+
}
32+
1933
</%init>

root/menu.mhtml

+9-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
% }
2929
</ul>
3030
</span>
31-
<a class="btn btn-default" href="<% $c->uri_for($c->config()->{help_path}) %>">Help</a>
31+
<a class="btn btn-default" target="_blank" href="<% $help_url %>">Help</a>
3232
</span>
3333
</div>
3434

@@ -37,4 +37,12 @@
3737
my $local_path = $c->req()->path();
3838
my $return_path_uri = $c->req()->uri();
3939
my $login_url = $c->uri_for('/do_oauth', { return_path => $return_path_uri });
40+
41+
my $help_url;
42+
43+
if ($c->config()->{use_external_help}) {
44+
$help_url = $c->config()->{external_help_url};
45+
} else {
46+
$help_url = $c->uri_for($c->config()->{help_path})
47+
}
4048
</%init>

root/static/js/canto-modules.js

+13-2
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,7 @@ canto.service('CantoGlobals', function ($window) {
886886
this.hostsWithNoGenes = $window.hostsWithNoGenes;
887887
this.annotationFigureField = $window.annotation_figure_field;
888888
this.allele_qc_api_url = $window.allele_qc_api_url;
889+
this.use_external_help = $window.use_external_help;
889890
});
890891

891892
canto.service('CantoService', function ($http) {
@@ -1291,8 +1292,18 @@ var helpIcon = function (CantoGlobals, CantoConfig) {
12911292

12921293
CantoConfig.get('help_text').then(function (results) {
12931294
if (results[$scope.key]) {
1294-
if (results[$scope.key].docs_path) {
1295-
$scope.url = CantoGlobals.application_root + '/docs/' + results[$scope.key].docs_path;
1295+
if (CantoGlobals.use_external_help) {
1296+
if (results[$scope.key].url) {
1297+
$scope.url = results[$scope.key].url;
1298+
} else {
1299+
$scope.url = CantoGlobals.application_root + '/docs/' + results[$scope.key].docs_path;
1300+
}
1301+
} else {
1302+
if (results[$scope.key].docs_path) {
1303+
$scope.url = CantoGlobals.application_root + '/docs/' + results[$scope.key].docs_path;
1304+
} else {
1305+
$scope.url = results[$scope.key].url;
1306+
}
12961307
}
12971308
if (results[$scope.key].inline) {
12981309
$scope.helpText = results[$scope.key].inline;

0 commit comments

Comments
 (0)