root/trunk/convert.pl

Revision 1429, 0.6 KB (checked in by thomas, 3 years ago)

added support for line anchors
added new template for reaction
added small perl script to convert multiple pathways (e.g. from mapp to gpml)

Line 
1use File::Find;
2use warnings;
3use strict;
4use Cwd;
5
6my $dir = shift(@ARGV);
7my $ext_in = shift(@ARGV);
8my $ext_out = shift(@ARGV);
9
10print("Converting all $ext_in files in $dir to $ext_out files\n");
11
12my $curr_dir = getcwd();
13
14find(\&edits, $dir);
15
16sub edits() {
17        my $file = $_;
18        if($file =~ /.$ext_in$/) {
19                print "File name is $_\n\t\tFull path is $File::Find::name\n";
20                my $newfile = $file;
21                $newfile =~ s/.$ext_in$/.$ext_out/;
22                my $cmd = "java -jar \"$curr_dir/pathvisio_core.jar\" \"$file\" \"$newfile\"";
23                print("Executing: $cmd\n");
24                system($cmd);
25        }
26}
Note: See TracBrowser for help on using the browser.