Hello!

To see the file structure, click on "tree".

Note that updates take place every 10 minutes, commits may not be seen immediately.
Added provenance for Gene Synonyms, Ontologies
authorpreecej <preecej@localhost>
Fri, 2 Sep 2011 01:32:04 +0000 (01:32 +0000)
committerpreecej <preecej@localhost>
Fri, 2 Sep 2011 01:32:04 +0000 (01:32 +0000)
svn path=/; revision=173

preecej/semantic_wiki/paw_TransformForImport.pl

index 370ec024e230d61bee3a6b5eb3a6416ba4ce3e79..32864e056eb3afef7f4d72ba3b4af251b83416c7 100644 (file)
@@ -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++;