Hello!

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

Note that updates take place every 10 minutes, commits may not be seen immediately.
temp script for correcting a curatorial data problem in the AraCyc v7.0
authorpreecej <preecej@localhost>
Wed, 9 Feb 2011 00:04:01 +0000 (00:04 +0000)
committerpreecej <preecej@localhost>
Wed, 9 Feb 2011 00:04:01 +0000 (00:04 +0000)
(BioPax, lvl-2) file
-This line, and those below, will be ignored--

A    perl_singletons/aracyc_to_reactome_conversion
A    perl_singletons/aracyc_to_reactome_conversion/convert_bad_pub_authors_to_years.pl

svn path=/; revision=87

preecej/perl_singletons/aracyc_to_reactome_conversion/convert_bad_pub_authors_to_years.pl [new file with mode: 0644]

diff --git a/preecej/perl_singletons/aracyc_to_reactome_conversion/convert_bad_pub_authors_to_years.pl b/preecej/perl_singletons/aracyc_to_reactome_conversion/convert_bad_pub_authors_to_years.pl
new file mode 100644 (file)
index 0000000..a3c7023
--- /dev/null
@@ -0,0 +1,44 @@
+#!usr/bin/perl -w
+use strict;
+
+system 'clear';
+
+# temp script used to fix <bp:AUTHORS> elements that mistakenly refer to years in
+# parentheses. replaces those elements with <bp:YEAR>.
+
+my $dir = "/home/preecej/Documents/projects/reactome/aracyc_to_reactome_conversion/aracyc_data/";
+
+open(in_file, $dir . "test_year_swap.owl");
+open(out_file, ">>" . $dir . "test_year_swap_fixed.owl");
+
+my $i = 0; # limiter for testing
+
+while (<in_file>)
+{
+    $i++;
+
+    # read the next line of the file
+    my $line = $_;
+    chomp $line;
+    
+    # is it a bad author?
+    if ($line =~ /<bp:AUTHORS rdf:datatype="http:\/\/www.w3.org\/2001\/XMLSchema#string">\(/)
+    {
+        print "$i: $line\n";
+        # change the line to a well-formatted year tag
+        $line =~ s/AUTHORS/YEAR/g;
+        $line =~ s/\(//;
+        $line =~ s/\)//;
+        $line =~ s/string/int/;
+        print "$i: $line\n";
+    }
+    print out_file "$line\n"; 
+    #last if $i > 1000; # let's test w/ low numbers for now
+}
+
+close in_file;
+close out_file;
+
+# clean up
+exit;