new file: cell2loc.py
[GalaxyCodeBases.git] / perl / etc / WoodyMiaoLin / Tiger / rearrange.pl
blobf2ed66cc807a7c6fbaf8f2d2baf0c950800bbe04
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
5 my @ra;
6 while (<>) {
7 chomp;
8 my @a = split /\t/;
9 my @b;
10 $b[0] = $a[0];
11 $b[1] = $a[1];
12 foreach (4..21) {
13 my ($a1, $a2) = split /\//, $a[$_];
14 if (($a1 eq "N") and ($a2 eq "A")) {
15 push @b, "none";
16 } elsif (($a1 eq "0") and ($a2 eq "0")) {
17 push @b, $a[2];
18 } elsif (($a1 eq "1") and ($a2 eq "1")) {
19 push @b, $a[3];
20 } else {
21 push @b, "$a[2]$a[3]";
24 push @ra, \@b;
27 foreach (@ra) {
28 my $a = join "\t", @{$_};
29 print $a, "\n";
32 print O "\n</svg>\n";
33 close O;