From: preecej Date: Wed, 9 Feb 2011 00:04:01 +0000 (+0000) Subject: temp script for correcting a curatorial data problem in the AraCyc v7.0 X-Git-Url: http://gitweb.planteome.org/?a=commitdiff_plain;h=ac9e079915d50954e98e2351c5769c7ff7d04d93;p=old-jaiswallab-svn%2F.git temp script for correcting a curatorial data problem in the AraCyc v7.0 (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 --- 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 index 0000000..a3c7023 --- /dev/null +++ b/preecej/perl_singletons/aracyc_to_reactome_conversion/convert_bad_pub_authors_to_years.pl @@ -0,0 +1,44 @@ +#!usr/bin/perl -w +use strict; + +system 'clear'; + +# temp script used to fix elements that mistakenly refer to years in +# parentheses. replaces those elements with . + +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 () +{ + $i++; + + # read the next line of the file + my $line = $_; + chomp $line; + + # is it a bad author? + if ($line =~ /\(/) + { + 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;