Debian Codegraph @

metastudentPkg/lib/groupB/perl/test2eval.pl

raw
1
2 use strict;
3 use warnings;
4 use diagnostics;
5
6 while (my $line = <STDIN>) {
7 if(substr($line,0,1) eq ">") {
8 chomp $line;
9
10 if($line =~ m/^>[^:]+:([0-9,]+)$/g) {
11 my $terms = $1;
12 my @t = split(/,/, $terms);
13
14 @t = map { "GO:$_" } @t;
15 print ">" . join(",", @t) . "\n";
16 } else {
17 die "Could not recognize identifier line!";
18 }
19
20 } else {
21 print $line;
22 }
23 }