From 24ff688f279aec916eb46e568740ef89dd2f732b Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Tue, 23 Jan 2024 21:39:24 +1300 Subject: [PATCH 01/19] Pull correct canto-base Docker image for tests --- .github/workflows/test-with-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-docker.yml b/.github/workflows/test-with-docker.yml index d25f3ca4b..a18b88720 100644 --- a/.github/workflows/test-with-docker.yml +++ b/.github/workflows/test-with-docker.yml @@ -17,6 +17,6 @@ jobs: steps: - uses: actions/checkout@v3 - name: pull base image - run: docker pull pombase/canto-base:v14 + run: docker pull pombase/canto-base:v15 - name: run make test inside a Docker container run: ./etc/docker-run-tests.sh From dedf2b645dbbdb8609a8014c002fcd059a09ec5b Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Tue, 23 Jan 2024 23:14:03 +1300 Subject: [PATCH 02/19] Use the latest canto-base for tests --- etc/docker-run-tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/docker-run-tests.sh b/etc/docker-run-tests.sh index 2f2cc4cfa..027e3f402 100755 --- a/etc/docker-run-tests.sh +++ b/etc/docker-run-tests.sh @@ -1,4 +1,4 @@ #!/bin/sh - docker run --rm --net="host" --mount type=bind,source=$(pwd)/,target=/canto -w=/canto \ - pombase/canto-base:v15 /bin/bash -c "cd /canto && perl Makefile.PL && make test" + pombase/canto-base:v17 /bin/bash -c "cd /canto && perl Makefile.PL && make test" From c6efe92272f181ce42323101ae8561e5d0691c39 Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Tue, 23 Jan 2024 23:16:47 +1300 Subject: [PATCH 03/19] Update to version v1790 --- canto.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canto.yaml b/canto.yaml index ff945db48..14730baf5 100644 --- a/canto.yaml +++ b/canto.yaml @@ -25,7 +25,7 @@ header_image: logos/curation_tool.png canto_url: https://curation.pombase.org/ -app_version: v1789 +app_version: v1790 schema_version: 34 From a7edd7ec9200ca519d09549fb51d4f685a451d56 Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Tue, 23 Jan 2024 23:19:17 +1300 Subject: [PATCH 04/19] Pull the correct canto-base Docker image for tests --- .github/workflows/test-with-docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-with-docker.yml b/.github/workflows/test-with-docker.yml index a18b88720..f30306946 100644 --- a/.github/workflows/test-with-docker.yml +++ b/.github/workflows/test-with-docker.yml @@ -17,6 +17,6 @@ jobs: steps: - uses: actions/checkout@v3 - name: pull base image - run: docker pull pombase/canto-base:v15 + run: docker pull pombase/canto-base:v17 - name: run make test inside a Docker container run: ./etc/docker-run-tests.sh From c56a487f58d56120aefbeaf271c92688c9403735 Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Tue, 23 Jan 2024 23:19:44 +1300 Subject: [PATCH 05/19] Update to version v1791 --- canto.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canto.yaml b/canto.yaml index 14730baf5..099a14338 100644 --- a/canto.yaml +++ b/canto.yaml @@ -25,7 +25,7 @@ header_image: logos/curation_tool.png canto_url: https://curation.pombase.org/ -app_version: v1790 +app_version: v1791 schema_version: 34 From d618789f757373974a2654f19448d44bb679cdef Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Mon, 29 Jan 2024 19:00:33 +1300 Subject: [PATCH 06/19] Enable allele QC checker for all users Refs pombase/canto#2688 Refs pombase/canto#2801 --- root/static/js/canto-modules.js | 1 - 1 file changed, 1 deletion(-) diff --git a/root/static/js/canto-modules.js b/root/static/js/canto-modules.js index 298d84a21..d83379880 100644 --- a/root/static/js/canto-modules.js +++ b/root/static/js/canto-modules.js @@ -4243,7 +4243,6 @@ var alleleEditDialogCtrl = const alleleType = $scope.alleleData.type.trim(); if (!qcUrl || !$scope.current_type_config || - !$scope.userIsAdmin || !$scope.current_type_config.check_description_with_api) { $scope.descriptionState = 'ok'; return $q.when(null); From d6c287177fd54cc8b8dd328703a7495e396d3338 Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Mon, 29 Jan 2024 19:02:43 +1300 Subject: [PATCH 07/19] Update to version v1792 --- canto.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canto.yaml b/canto.yaml index 099a14338..436d76ed7 100644 --- a/canto.yaml +++ b/canto.yaml @@ -25,7 +25,7 @@ header_image: logos/curation_tool.png canto_url: https://curation.pombase.org/ -app_version: v1791 +app_version: v1792 schema_version: 34 From 95c0a1fd583533084e0cc1042d16a1fa42f4ee46 Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Thu, 1 Feb 2024 08:24:06 +1300 Subject: [PATCH 08/19] Revert "Enable allele QC checker for all users" Seems like it needs more work: https://github.com/pombase/canto/issues/2802#issuecomment-1918928528 This reverts commit d618789f757373974a2654f19448d44bb679cdef. --- root/static/js/canto-modules.js | 1 + 1 file changed, 1 insertion(+) diff --git a/root/static/js/canto-modules.js b/root/static/js/canto-modules.js index d83379880..298d84a21 100644 --- a/root/static/js/canto-modules.js +++ b/root/static/js/canto-modules.js @@ -4243,6 +4243,7 @@ var alleleEditDialogCtrl = const alleleType = $scope.alleleData.type.trim(); if (!qcUrl || !$scope.current_type_config || + !$scope.userIsAdmin || !$scope.current_type_config.check_description_with_api) { $scope.descriptionState = 'ok'; return $q.when(null); From 2fc1270adab8af80a4009c58d757d39a346b9737 Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Thu, 1 Feb 2024 08:24:43 +1300 Subject: [PATCH 09/19] Update to version v1793 --- canto.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canto.yaml b/canto.yaml index 436d76ed7..15256f32f 100644 --- a/canto.yaml +++ b/canto.yaml @@ -25,7 +25,7 @@ header_image: logos/curation_tool.png canto_url: https://curation.pombase.org/ -app_version: v1792 +app_version: v1793 schema_version: 34 From b385247631441affd75df9c6ef46edf0278b9b5f Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Mon, 29 Jan 2024 19:00:33 +1300 Subject: [PATCH 10/19] Enable allele QC checker for all users Refs pombase/canto#2688 Refs pombase/canto#2801 --- root/static/js/canto-modules.js | 1 - 1 file changed, 1 deletion(-) diff --git a/root/static/js/canto-modules.js b/root/static/js/canto-modules.js index 298d84a21..d83379880 100644 --- a/root/static/js/canto-modules.js +++ b/root/static/js/canto-modules.js @@ -4243,7 +4243,6 @@ var alleleEditDialogCtrl = const alleleType = $scope.alleleData.type.trim(); if (!qcUrl || !$scope.current_type_config || - !$scope.userIsAdmin || !$scope.current_type_config.check_description_with_api) { $scope.descriptionState = 'ok'; return $q.when(null); From 76b267454df56943b7c119d289eb41bc2c52c455 Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Thu, 1 Feb 2024 08:30:24 +1300 Subject: [PATCH 11/19] Update to version v1794 --- canto.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canto.yaml b/canto.yaml index 15256f32f..1434d5318 100644 --- a/canto.yaml +++ b/canto.yaml @@ -25,7 +25,7 @@ header_image: logos/curation_tool.png canto_url: https://curation.pombase.org/ -app_version: v1793 +app_version: v1794 schema_version: 34 From 5b2152e0c1af04d241d0b5a63bb3ec827087c41e Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Thu, 29 Feb 2024 14:42:32 +1300 Subject: [PATCH 12/19] Fix broken modification checking in long workflow Refs pombase/canto#2802 --- root/curs/modules/ontology.mhtml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/root/curs/modules/ontology.mhtml b/root/curs/modules/ontology.mhtml index 8a348eefc..53b211fb1 100644 --- a/root/curs/modules/ontology.mhtml +++ b/root/curs/modules/ontology.mhtml @@ -59,6 +59,7 @@ Annotation extensions term-id="{{currentTerm()}}" is-valid="extensionBuilderIsValid" annotation-type-name="<% $annotation_type_name %>" + gene-systematic-id="<% $gene_systematic_id %>" feature-type="finalFeatureType"> @@ -95,8 +96,10 @@ Annotation extensions <%init> my $feature_display_name; +my $gene_systematic_id = ''; if ($feature_type eq 'gene') { $feature_display_name = $feature->display_name(); + $gene_systematic_id = $feature->primary_identifier(); } else { $feature_display_name = $feature->display_name($c->config()); } From 9708b5f0a896f9be9cb6e14129ffa623faf32ce6 Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Thu, 29 Feb 2024 14:44:02 +1300 Subject: [PATCH 13/19] Update to version v1795 --- canto.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canto.yaml b/canto.yaml index 1434d5318..b94603505 100644 --- a/canto.yaml +++ b/canto.yaml @@ -25,7 +25,7 @@ header_image: logos/curation_tool.png canto_url: https://curation.pombase.org/ -app_version: v1794 +app_version: v1795 schema_version: 34 From b9d6fd770dca182bbda8eec7dfe6f7c7c89da7a3 Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Fri, 1 Mar 2024 13:02:12 +1300 Subject: [PATCH 14/19] Display a notice for admin for message to curators Refs pombase/canto#2808 --- lib/Canto/Controller/Curs.pm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/Canto/Controller/Curs.pm b/lib/Canto/Controller/Curs.pm index 64dfc8cf0..4e00f0464 100644 --- a/lib/Canto/Controller/Curs.pm +++ b/lib/Canto/Controller/Curs.pm @@ -216,8 +216,8 @@ sub top : Chained('/') PathPart('curs') CaptureArgs(1) $st->{submitter_email} = $submitter_email; $st->{submitter_name} = $submitter_name; - $st->{message_to_curators} = - $self->get_metadata($schema, MESSAGE_FOR_CURATORS_KEY); + my $message_to_curators = $self->get_metadata($schema, MESSAGE_FOR_CURATORS_KEY); + $st->{message_to_curators} = $message_to_curators; my $external_notes = $self->get_metadata($schema, Canto::Curs->EXTERNAL_NOTES_KEY); @@ -258,6 +258,12 @@ sub top : Chained('/') PathPart('curs') CaptureArgs(1) $st->{current_user_is_admin} = 0; } + if ($st->{current_user_is_admin} && + ($state eq NEEDS_APPROVAL || $state eq APPROVAL_IN_PROGRESS || $state eq APPROVED) && + defined $message_to_curators && $message_to_curators !~ /^\s*$/) { + push @{$st->{notice}}, qq|This session has a message to curators|; + } + if ($config->{canto_offline} && !$st->{read_only_curs} && (!defined $current_user || !$current_user->is_admin()) && $path !~ m:/(ws/\w+/list):) { From dcd7803f5d3dd8dcf75c26bc8a24a380e9210b5a Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Fri, 1 Mar 2024 08:34:56 +1300 Subject: [PATCH 15/19] Show child term definition on mouse-over Refs pombase/canto#2796 --- lib/Canto/Track/OntologyLookup.pm | 2 +- root/static/ng_templates/term_children.html | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Canto/Track/OntologyLookup.pm b/lib/Canto/Track/OntologyLookup.pm index 42a6781ba..4acb4909d 100644 --- a/lib/Canto/Track/OntologyLookup.pm +++ b/lib/Canto/Track/OntologyLookup.pm @@ -190,7 +190,7 @@ sub _make_term_hash if (!$seen{$child_cvterm->cvterm_id()}) { push @child_hashes, {$self->_make_term_hash($child_cvterm, - $child_cvterm->cv()->name(), 0, 0, 0, undef)}; + $child_cvterm->cv()->name(), 1, 0, 0, undef)}; $seen{$child_cvterm->cvterm_id()} = 1; } } diff --git a/root/static/ng_templates/term_children.html b/root/static/ng_templates/term_children.html index 7c07a26bd..31b621b5e 100644 --- a/root/static/ng_templates/term_children.html +++ b/root/static/ng_templates/term_children.html @@ -11,7 +11,8 @@
  • - {{child.name}} + {{child.name}}
  • From 302004c9d98b8833cbfe8d93ac5d1296e909b795 Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Fri, 1 Mar 2024 13:04:53 +1300 Subject: [PATCH 16/19] Update to version v1796 --- canto.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canto.yaml b/canto.yaml index b94603505..b371c3864 100644 --- a/canto.yaml +++ b/canto.yaml @@ -25,7 +25,7 @@ header_image: logos/curation_tool.png canto_url: https://curation.pombase.org/ -app_version: v1795 +app_version: v1796 schema_version: 34 From 07c1d08c6b3a4b4469d4fb8a3500bc10574a8f46 Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Thu, 7 Mar 2024 16:03:34 +1300 Subject: [PATCH 17/19] Pre-populate sessions with genes from Chado Refs pombase/canto#219 --- canto.yaml | 4 ++ lib/Canto/Controller/Curs.pm | 13 +++++++ lib/Canto/Curs/MetadataStorer.pm | 6 +++ lib/Canto/Track.pm | 65 ++++++++++++++++++++++++++++++++ 4 files changed, 88 insertions(+) diff --git a/canto.yaml b/canto.yaml index b371c3864..1c8e7b6f3 100644 --- a/canto.yaml +++ b/canto.yaml @@ -1462,6 +1462,10 @@ implementation_classes: organism_adaptor: Canto::Track::OrganismLookup strain_adaptor: Canto::Track::StrainLookup +# Possible values for "feature_pub_source" in Chado when pre-populating +# sessions. Ignored if the feature_pub_lookup adaptor isn't configured. +feature_pub_sources: [] + wildtype_name_template: '@@gene_display_name@@+' deletion_name_template: '@@gene_display_name@@delta' transformant_name_template: '@@gene_display_name@@ transformant' diff --git a/lib/Canto/Controller/Curs.pm b/lib/Canto/Controller/Curs.pm index 4e00f0464..ea8b06db9 100644 --- a/lib/Canto/Controller/Curs.pm +++ b/lib/Canto/Controller/Curs.pm @@ -347,6 +347,19 @@ sub top : Chained('/') PathPart('curs') CaptureArgs(1) $use_dispatch = 0; } + if ($state eq CURATION_IN_PROGRESS) { + my $existing_genes = + $self->get_metadata($schema, Canto::Curs::MetadataStorer::SESSION_HAS_EXISTING_GENES); + + if (defined $existing_genes) { + $self->unset_metadata($schema, Canto::Curs::MetadataStorer::SESSION_HAS_EXISTING_GENES); + my $pub_uniquename = $st->{pub}->uniquename(); + push @{$st->{message}}, qq|Warning: this session has been populated with $pub_uniquename genes known from other sources. Use the "Add more genes from $pub_uniquename" link to add missing genes|; + $c->detach('edit_genes'); + $use_dispatch = 0; + } + } + if ($use_dispatch) { my $dispatch_dest = $state_dispatch{$state}; if (defined $dispatch_dest) { diff --git a/lib/Canto/Curs/MetadataStorer.pm b/lib/Canto/Curs/MetadataStorer.pm index 3cd32b74a..796809447 100644 --- a/lib/Canto/Curs/MetadataStorer.pm +++ b/lib/Canto/Curs/MetadataStorer.pm @@ -51,6 +51,12 @@ has state => (is => 'ro', init_arg => undef, isa => 'Canto::Curs::State', lazy_build => 1); +use constant { + # the session was pre-populated with genes from Chado associated with + # the publication + SESSION_HAS_EXISTING_GENES => "session_has_existing_genes", +}; + sub _build_state { my $self = shift; diff --git a/lib/Canto/Track.pm b/lib/Canto/Track.pm index d48685b13..2b2f6e553 100644 --- a/lib/Canto/Track.pm +++ b/lib/Canto/Track.pm @@ -96,6 +96,69 @@ sub create_curs return ($curs, $curs_db); } +=head2 + + Usage : lookup_and_store_chado_genes($config, $curs_schema, $pub); + Function: If Chado is configured, lookup any genes that are known from + PMID keywords or other source (see feature_pub_sources in + config.yaml) + Args : + Returns : + +=cut + +sub lookup_and_store_chado_genes +{ + my ($config, $state, $curs_schema, $pub_uniquename) = @_; + + my $feature_pub_lookup = Canto::Track::get_adaptor($config, 'feature_pub'); + + if (!defined $feature_pub_lookup) { + return; + } + + my $taxonid; + + my $instance_organism = $config->{instance_organism}; + + if (defined $instance_organism) { + $taxonid = $instance_organism->{taxonid}; + } else { + return; + } + + my @results = $feature_pub_lookup->lookup(publication_uniquename => $pub_uniquename, + feature_type => 'gene'); + + if (@results == 0) { + return; + } + + my @feature_pub_sources = @{$config->{feature_pub_sources}}; + + my %genes_to_add = (); + + map { + my $row = $_; + + if (grep { $row->{feature_pub_source} eq $_ } @feature_pub_sources) { + $genes_to_add{$row->{gene_uniquename}} = 1; + } + } @results; + + my $organism = + Canto::CursDB::Organism::get_organism($curs_schema, $taxonid); + + for my $gene_uniquename (keys %genes_to_add) { + $curs_schema->create_with_type('Gene', { + primary_identifier => $gene_uniquename, + organism => $organism, + }); + } + + $state->set_metadata($curs_schema, Canto::Curs::MetadataStorer::SESSION_HAS_EXISTING_GENES, scalar(keys %genes_to_add)); +} + =head2 create_curs_db Usage : Canto::Track::create_curs_db($config, $curs_object, ); @@ -179,6 +242,8 @@ sub create_curs_db my $state = Canto::Curs::State->new(config => $config); $state->store_statuses($curs_schema); + lookup_and_store_chado_genes($config, $state, $curs_schema, $pub->uniquename()); + if (wantarray) { return ($curs_schema, $db_file_name); } else { From 4c6a8a5044e003837089f9bdefb133271110e9f0 Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Thu, 7 Mar 2024 16:04:19 +1300 Subject: [PATCH 18/19] Fix docs typo --- lib/Canto/Role/MetadataAccess.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Canto/Role/MetadataAccess.pm b/lib/Canto/Role/MetadataAccess.pm index 7d0d5fdfe..f67a552ef 100644 --- a/lib/Canto/Role/MetadataAccess.pm +++ b/lib/Canto/Role/MetadataAccess.pm @@ -58,7 +58,7 @@ sub my $self = shift; if (@_ < 3) { - croak "not enough arguments to get_metadata()"; + croak "not enough arguments to set_metadata()"; } my $schema = shift; From b5254fa900db26f845602265fc5fb38b5e6c52ab Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Thu, 7 Mar 2024 16:04:43 +1300 Subject: [PATCH 19/19] Update to version v1797 --- canto.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/canto.yaml b/canto.yaml index 1c8e7b6f3..1708e985b 100644 --- a/canto.yaml +++ b/canto.yaml @@ -25,7 +25,7 @@ header_image: logos/curation_tool.png canto_url: https://curation.pombase.org/ -app_version: v1796 +app_version: v1797 schema_version: 34