Hello!

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

Note that updates take place every 10 minutes, commits may not be seen immediately.
Can now handle "Assigned By" (GAF column 15); fixed a couple of bugs;
authorpreecej <preecej@localhost>
Fri, 13 Jul 2012 17:25:58 +0000 (17:25 +0000)
committerpreecej <preecej@localhost>
Fri, 13 Jul 2012 17:25:58 +0000 (17:25 +0000)
added "Vitis vinifera" species handling

svn path=/; revision=357

planteome/paw/paw_TransformForImport.pl

index 28d66431ec0ac0e37ac3b3b4314ab48e40ae07d0..abef8c5e4e8df78483b57ad93f296dcbcb19ad06 100644 (file)
@@ -6,7 +6,7 @@ Planteome Annotation Wiki - Data Import Script
 
 =head1 VERSION
 
-0.3
+0.4
 
 =head1 DESCRIPTION
 
@@ -281,7 +281,7 @@ sub import_generic
 }
 
 # Add new ontology reference data. Aggregates add'l evidence codes, evidence, 
-# and publications for the existing term id.
+# assignations, and publications for the existing term id.
 # ---------------------------------------------------------------------------
 sub add_ontology_ref_data($$)
 {
@@ -323,6 +323,12 @@ sub add_ontology_ref_data($$)
                     {"Evidence"}{$_} = "";
     }
 
+    # assigned by
+    $annotations{$ref_data{"db_object_symbol"}}
+        {"Ontological References"}
+            {$ref_data{"term_id"}}
+                {"Assigned By"}{$ref_data{"assigned_by"}} = "";
+
     # publications
     for (@publications)
     {
@@ -366,14 +372,14 @@ sub import_gaf
 {
        #[GAF implied data structure]
     # singletons: db/Source (not really, but OK for now), taxon/Species ID, 
-    #   assigned_by, gene_type/Gene Type (later: proteins, too)
+    #   gene_type/Gene Type (later: proteins, too)
     # lower priority: db_object_id, date
     # not needed: qualifier
     # unvaried fields (gene-level): db_object_symbol/Gene Symbol, 
     #   db_object_name/Gene Name, 
     #   db_object_synonym/Gene Locus|Source Accession ID|Chromosome|Gene Synonyms (see below), 
     # varied fields (gene synonyms): db_object_synonym/Gene Synonym
-    # varied fields (ontology-level): term_id/Term ID, evidence_code/Evidence Code, 
+    # varied fields (ontology-level): term_id/Term ID, evidence_code/Evidence Code, assigned_by/Assigned By
     #   aspect/Aspect, db_reference (multi-, get PMID from here), with_or_from (multi-)
 
     # [Annotation Object Structure]
@@ -390,7 +396,8 @@ sub import_gaf
        #                           "Ontological References" => % "$Term ID" => %annotation_ontology_ref
        #                                                                                               "Aspect" => string (assumes only one)
        #                                                                                                   "Evidence Codes" => % strings
-       #                                                               "Evidence" => % strings ("with_or_from" )
+       #                                                               "Evidence" => % strings ("with_or_from")
+       #                                                               "Assigned By" => string ("assigned_by")
        #                                                               "Publications" => % PMID's from "db:reference", used to create separate Pub pages
     
        # set up a hash of ontology types and aspects to be referenced during data import
@@ -426,11 +433,10 @@ sub import_gaf
             "with_or_from"      => $curr_line_ary[7], # Evidence (data)
             "aspect"            => $curr_line_ary[8], # Aspect
             "db_object_name"    => $curr_line_ary[9], # Gene Name
-
-            # Gene Locus, Source Accession ID, Chromosome, Gene Synonyms
-            "db_object_synonym" => $curr_line_ary[10],
+            "db_object_synonym" => $curr_line_ary[10], # Gene Locus, Source Accession ID, Chromosome, Gene Synonyms
             "db_object_type"    => $curr_line_ary[11], # Gene Type
-            "taxon"             => $curr_line_ary[12] # Species ID
+            "taxon"             => $curr_line_ary[12], # Species ID
+            "assigned_by"       => $curr_line_ary[14] # Assigned By
             );
 
         if ($debug) { print "...<DEBUG: \%curr_line_hash>\n"
@@ -912,6 +918,14 @@ sub transform_gaf
                                 $writer->dataElement("Field", join(', ',@ary_evidence), Name=>"Evidence");
                             }
 
+                            my @ary_assignations;
+                            foreach my $assignation (keys %{$annotations{$annotation}{"Ontological References"}{$ont_term}{"Assigned By"}}) {
+                               push @ary_assignations, $assignation; 
+                            }
+                            if (scalar(@ary_assignations) > 0) {
+                                $writer->dataElement("Field", join(', ',@ary_assignations), Name=>"Assigned By");
+                            }
+
                         $writer->endTag("Template");
                     }
                 $writer->endTag("Page");