Hello!

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

Note that updates take place every 10 minutes, commits may not be seen immediately.
Separated locus and accession id vars; made each more flexible.
authorpreecej <preecej@localhost>
Fri, 5 Aug 2011 19:33:44 +0000 (19:33 +0000)
committerpreecej <preecej@localhost>
Fri, 5 Aug 2011 19:33:44 +0000 (19:33 +0000)
svn path=/; revision=140

preecej/semantic_wiki/paw_TransformForImport.pl

index 8c91c1e64b5561392f46ce1676baf4e4217aee6a..5dd0e8851240eabb6098e9b1bac09336c10616d8 100644 (file)
@@ -362,7 +362,7 @@ sub import_gaf
             {    
                 $locus = $loci[0]; 
             }
-            else # no match; attempt to use the Gene Synonym instead
+            else # no match; attempt to use the Gene Symbol instead
             {
                 if ($curr_line_hash{"db_object_symbol"} =~ /[Aa][Tt].[Gg]/)
                 {
@@ -373,10 +373,17 @@ sub import_gaf
             # chromosome = third char in locus, if it exists
             my $chromosome = ($locus ne "" ? (split('',$locus))[2] : "");
             
+            # set some sort of pseudo-unique value as the accession id, 
+            # in order of succession: locus, then symbol
+            # (note: this is dangerous; a stable identifier is preferred)
+            my $accession_id = 
+                $locus ? $locus : $curr_line_hash{"db_object_symbol"};
+            
             # set up props
             my $annotation_properties = {
+                "Accession ID"  => $accession_id,
                 "Gene Name"     => $curr_line_hash{"db_object_name"},
-                "Gene Locus"    => $locus, # also used for Source Accession ID
+                "Gene Locus"    => $locus,
                                "Chromosome"    => $chromosome,
                                "Gene Synonyms" => $curr_line_hash{"db_object_synonym"} # pipe-delimited string
                            };
@@ -730,7 +737,7 @@ sub transform_gaf
                         $writer->startTag("Template",Name=>"Provenance_Repeater");
                             $writer->dataElement("Field", $_, Name=>"Source Field");
                             $writer->dataElement("Field", "Annotation", Name=>"Source Template");
-                            $writer->dataElement("Field", $annotations{$annotation}{"Gene Locus"}, Name=>"Source Accession ID");
+                            $writer->dataElement("Field", $annotations{$annotation}{"Accession ID"}, Name=>"Source Accession ID");
                             $writer->dataElement("Field", "Source:$SOURCE_TITLE_SEED", Name=>"Source");
                         $writer->endTag("Template");
                     }