From cf935ca1badc0fa0e7912d2d9e1e9e46aa24bca8 Mon Sep 17 00:00:00 2001 From: preecej Date: Thu, 2 Jan 2014 23:04:34 +0000 Subject: [PATCH] swaps the GBWI ids w/ GRMZ ids for Gramene web site indexing svn path=/; revision=518 --- .../gramene/maizecyc_GRMZ_GBWI_swap.pl | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Personnel/preecej/perl_singletons/gramene/maizecyc_GRMZ_GBWI_swap.pl diff --git a/Personnel/preecej/perl_singletons/gramene/maizecyc_GRMZ_GBWI_swap.pl b/Personnel/preecej/perl_singletons/gramene/maizecyc_GRMZ_GBWI_swap.pl new file mode 100644 index 0000000..2747acf --- /dev/null +++ b/Personnel/preecej/perl_singletons/gramene/maizecyc_GRMZ_GBWI_swap.pl @@ -0,0 +1,38 @@ +#!/usr/bin/perl -w +use strict; + +my $map_file = $ARGV[0]; #GBWI::GRMZ mapping file + +# # cyc pathway dump file (generated w/ brie:/usr/local/gramene/gramene-lib/scripts/pathway/format-pathway-data.pl (see README for conventional usage)) +my $dump_file = $ARGV[1]; +my %map_hash; + +open(MAP_FILE,$map_file) or die("could not open $map_file"); +while () +{ + my $line = $_; + chomp $line; + my @line_ary = split('\t',$line); + my $key = $line_ary[0]; + $key =~ s/\s+$//; + my $val = $line_ary[1]; + $val =~ s/^\s+//; + + $map_hash{$key} = $val; +} +close(MAP_FILE); + +open(DUMP_FILE,$dump_file) or die("could not open $dump_file"); +while () +{ + my $line = $_; + chomp $line; + my @line_ary = split('\t',$line); + + if ($map_hash{$line_ary[0]}) { + print $map_hash{$line_ary[0]} . "\t" . $line_ary[1] . "\t" . $line_ary[2] . "\t" + . $line_ary[3] . "\t" . $line_ary[4] . "\t" . $line_ary[5] . "\t" . $line_ary[6] . "\n"; + } +} +close(DUMP_FILE); + -- 2.34.1