From 7633f11084b71528bc6e7d646b31073cce600782 Mon Sep 17 00:00:00 2001 From: Kim Rutherford Date: Sat, 16 Nov 2024 14:09:46 +1300 Subject: [PATCH] Add the curation session key to each annotation Refs pombase/curation#3771 --- src/pombase/data_types.rs | 2 ++ src/pombase/types.rs | 1 + src/pombase/web/data_build.rs | 5 +++++ tests/util/mod.rs | 1 + 4 files changed, 9 insertions(+) diff --git a/src/pombase/data_types.rs b/src/pombase/data_types.rs index f5a78635..dae662ad 100644 --- a/src/pombase/data_types.rs +++ b/src/pombase/data_types.rs @@ -1082,6 +1082,8 @@ pub struct OntAnnotationDetail { #[serde(skip_serializing_if="Option::is_none")] pub reference: Option, #[serde(skip_serializing_if="Option::is_none")] + pub curation_session: Option, + #[serde(skip_serializing_if="Option::is_none")] pub evidence: Option, #[serde(skip_serializing_if="Option::is_none")] pub eco_evidence: Option, diff --git a/src/pombase/types.rs b/src/pombase/types.rs index 158e7ec1..2a81168e 100644 --- a/src/pombase/types.rs +++ b/src/pombase/types.rs @@ -6,6 +6,7 @@ pub type MiscExtRange = FlexStr; pub type GeneUniquename = FlexStr; pub type TermUniquename = FlexStr; pub type ReferenceUniquename = FlexStr; +pub type CurationSessionKey = FlexStr; pub type GeneName = FlexStr; pub type TypeName = FlexStr; pub type GeneProduct = FlexStr; diff --git a/src/pombase/web/data_build.rs b/src/pombase/web/data_build.rs index f73612bc..65d8f769 100644 --- a/src/pombase/web/data_build.rs +++ b/src/pombase/web/data_build.rs @@ -4040,6 +4040,7 @@ phenotypes, so just the first part of this extension will be used: let mut allele_promoters = vec![]; let mut throughput: Option = None; let mut curator_orcid: Option = None; + let mut curation_session: Option = None; // need to get evidence first as it's used later // See: https://github.com/pombase/website/issues/455 @@ -4135,6 +4136,9 @@ phenotypes, so just the first part of this extension will be used: "curator_orcid" => { curator_orcid = prop.value.clone(); }, + "canto_session" => { + curation_session = prop.value.clone(); + }, "annotation_throughput_type" => { if let Some(throughput_type) = prop.value.clone() { throughput = Some(match throughput_type.as_ref() { @@ -4273,6 +4277,7 @@ phenotypes, so just the first part of this extension will be used: genes: gene_uniquenames_vec, transcript_uniquenames, reference: reference_uniquename, + curation_session, genotype: maybe_genotype_uniquename, genotype_background, allele_promoters, diff --git a/tests/util/mod.rs b/tests/util/mod.rs index 6a79bec4..4d7cdb33 100644 --- a/tests/util/mod.rs +++ b/tests/util/mod.rs @@ -457,6 +457,7 @@ fn make_one_detail(id: i32, gene_uniquename: &str, reference_uniquename: &str, genotype: maybe_genotype_uniquename.map(|s| s.to_shared_str()), genotype_background: None, reference: Some(reference_uniquename.into()), + curation_session: None, evidence: Some(evidence.into()), eco_evidence: Some(evidence.into()), annotation_phenotype_score: None,