From a6215d691252b368a0565db6366392c1556e7498 Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Tue, 11 Feb 2025 09:59:51 +1300 Subject: [PATCH] Use annotation sources to pre-populate sessions We can now use genes that are annotated (have a feature_cvterm row) and have a "source_file" feature_cvtermprop. Initially this is for genes mentioned in legacy GO annotations. Refs pombase/canto#2843 --- lib/Canto/Chado/FeaturePubLookup.pm | 35 ++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/lib/Canto/Chado/FeaturePubLookup.pm b/lib/Canto/Chado/FeaturePubLookup.pm index 69a4d8612..e4a7499ed 100644 --- a/lib/Canto/Chado/FeaturePubLookup.pm +++ b/lib/Canto/Chado/FeaturePubLookup.pm @@ -98,10 +98,43 @@ JOIN cvterm fcpt ON fcp.type_id = fcpt.cvterm_id WHERE pub.uniquename = ? AND t.name = ? AND fcpt.name = 'feature_pub_source' +UNION +SELECT f.uniquename AS gene_uniquename, + f.name AS gene_name, + fcp.value AS feature_pub_source +FROM feature f +JOIN cvterm ft ON ft.cvterm_id = f.type_id +JOIN feature_cvterm fc ON fc.feature_id = f.feature_id +JOIN pub ON pub.pub_id = fc.pub_id +JOIN feature_cvtermprop fcp ON fcp.feature_cvterm_id = fc.feature_cvterm_id +JOIN cvterm fcpt ON fcpt.cvterm_id = fcp.type_id +WHERE fcpt.name = 'source_file' + AND pub.uniquename = ? + AND ft.name = ? +UNION +SELECT DISTINCT gene.uniquename AS gene_uniquename, + gene.name AS gene_name, + fcp.value AS feature_pub_source +FROM feature f +JOIN feature_relationship rel ON rel.subject_id = f.feature_id +JOIN cvterm rel_type ON rel_type.cvterm_id = rel.type_id +JOIN feature gene ON gene.feature_id = rel.object_id +JOIN cvterm gene_type ON gene_type.cvterm_id = gene.type_id +JOIN cvterm ft ON ft.cvterm_id = f.type_id +JOIN feature_cvterm fc ON fc.feature_id = f.feature_id +JOIN pub ON pub.pub_id = fc.pub_id +JOIN feature_cvtermprop fcp ON fcp.feature_cvterm_id = fc.feature_cvterm_id +JOIN cvterm fcpt ON fcpt.cvterm_id = fcp.type_id +WHERE fcpt.name = 'source_file' + AND rel_type.name = 'part_of' + AND pub.uniquename = ? + AND gene_type.name = ? EOQ my $sth = $chado_dbh->prepare($query); - $sth->execute($publication_uniquename, $feature_type) + $sth->execute($publication_uniquename, $feature_type, + $publication_uniquename, $feature_type, + $publication_uniquename, $feature_type) or die "Couldn't execute: " . $sth->errstr; my @rows = ();