From 0ef9039b296e80a0328d0a925ab98c9108f67bb2 Mon Sep 17 00:00:00 2001 From: preecej Date: Fri, 2 Sep 2011 01:32:04 +0000 Subject: [PATCH] Added provenance for Gene Synonyms, Ontologies svn path=/; revision=173 --- .../semantic_wiki/paw_TransformForImport.pl | 57 +++++++++++++------ 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/preecej/semantic_wiki/paw_TransformForImport.pl b/preecej/semantic_wiki/paw_TransformForImport.pl index 370ec02..32864e0 100644 --- a/preecej/semantic_wiki/paw_TransformForImport.pl +++ b/preecej/semantic_wiki/paw_TransformForImport.pl @@ -730,16 +730,6 @@ sub transform_gaf 'Gene Type', 'Chromosome', 'Has Phenotype' - ], - Gene_Synonym_Repeater => [ - 'Gene Synonym' - ], - Ontological_Reference_Repeater => [ - 'Ontology', - 'Term ID', - 'Aspect', - 'Evidence Code', - 'Evidence' ] }; @@ -819,9 +809,10 @@ sub transform_gaf foreach my $ont_term (keys %{$annotations{$annotation}{"Ontological References"}}) { - # TODO: gather PMID's for separate REf Publication page creation (avoid dupes) + + # TODO: gather PMID's for separate Ref Publication page creation (avoid dupes) - $writer->startTag("Template",Name=>"Ontological_Reference_Repeater"); + $writer->startTag("Template",Name=>"$ontology_info{$curr_ontology_type}{name} Reference Repeater"); $writer->dataElement("Field", $ontology_info{$curr_ontology_type}{"name"}, Name=>"Ontology"); $writer->dataElement("Field", $ont_term, Name=>"Term ID"); $writer->dataElement("Field", $annotations{$annotation}{"Ontological References"}{$ont_term}{"Aspect"}, Name=>"Aspect"); @@ -849,17 +840,49 @@ sub transform_gaf $writer->dataElement("Field", "Annotation:$annot_title_count", Name=>"Annotation Page"); $writer->endTag("Template"); - # TODO: make further use of template map here to create provenance for SIO's - - foreach (@{@$template_field_map{"Annotation"}}) + # items on the Annotation page + foreach (@{@$template_field_map{"Annotation"}}) + { + $writer->startTag("Template",Name=>"Provenance_Repeater"); + $writer->dataElement("Field", $_, Name=>"Source Field or Object"); + $writer->dataElement("Field", "Annotations", Name=>"Source Category"); + $writer->dataElement("Field", $annotations{$annotation}{"Accession ID"}, Name=>"Source Accession ID"); + $writer->dataElement("Field", "Source:$SOURCE_TITLE_SEED", Name=>"Source"); + $writer->endTag("Template"); + } + + # items on the Gene Synonyms subpage + if (scalar keys (%{$annotations{$annotation}{'Gene Synonyms'}}) > 0) + { + foreach my $synonym (keys %{$annotations{$annotation}{'Gene Synonyms'}}) + { + $writer->startTag("Template",Name=>"Provenance_Repeater"); + $writer->dataElement("Field", $synonym, Name=>"Source Field or Object"); + $writer->dataElement("Field", "Gene Synonyms", Name=>"Source Category"); + $writer->dataElement("Field", $annotations{$annotation}{"Accession ID"}, Name=>"Source Accession ID"); + $writer->dataElement("Field", "Source:$SOURCE_TITLE_SEED", Name=>"Source"); + $writer->endTag("Template"); + } + } + + # items on the Ontologies subpage + if (scalar keys (%{$annotations{$annotation}{"Ontological References"}}) > 0) + { + my $ont_count = 0; + foreach my $ont_term (keys %{$annotations{$annotation}{"Ontological References"}}) { + $ont_count++; + $writer->startTag("Template",Name=>"Provenance_Repeater"); - $writer->dataElement("Field", $_, Name=>"Source Field"); - $writer->dataElement("Field", "Annotation", Name=>"Source Template"); + $writer->dataElement("Field", "Ontologies#$ont_count", Name=>"Source Field or Object"); + $writer->dataElement("Field", "Ontological References", Name=>"Source Category"); $writer->dataElement("Field", $annotations{$annotation}{"Accession ID"}, Name=>"Source Accession ID"); $writer->dataElement("Field", "Source:$SOURCE_TITLE_SEED", Name=>"Source"); $writer->endTag("Template"); } + } + + $writer->endTag("Page"); $annot_title_count++; -- 2.34.1