new file: cell2loc.py
[GalaxyCodeBases.git] / perl / bsvf / getchecked.pl
blob4caa02c9d72baf936f5b27acf0d1b2833726dce1
1 #!/usr/bin/perl -w
2 use strict;
4 if (@ARGV < 2) {
5 die "Usage: $0 <divisor> <in> [out]\n";
8 $ARGV[2] = '-' if (@ARGV == 2);
10 open IN, $ARGV[1] or die $!;
11 open OUT, ">$ARGV[2]" or die $!;
13 while(<IN>){
14 chomp;
15 my @sp=split /\,/, $_;
16 my $len=@sp;
17 my @clum=(0,0,0,0,0,0,0,0,0,0,0,0);
18 my @one=split /\=/,$sp[0];
19 $one[0]=~/.*\"(.*)\".*/;
20 $clum[0]=$1;
21 $one[1]=~/\D+(\d+)\D+/;
22 # print $1;exit;
23 my $num=$1+1;
24 $one[2]=~/\D+(\d+)/;
25 # print $1;exit;
26 my $last=$1/$ARGV[0];
27 $clum[$num]=$last;
28 my $n=1;
29 while($n<$len){
30 my @two=split /\=/,$sp[$n];
31 $two[0]=~/\D+(\d+)\D+/;
32 my $num=$1+1;
33 #print $sp[$n];exit;
34 #print $two[1];exit;
35 $two[1]=~/\D+(\d+)/;
36 #print $1;exit;
37 my $last=$1/$ARGV[0];
38 $clum[$num]=$last;
39 $n++;
41 print OUT "$clum[0]\t$clum[1]\t$clum[2]\t$clum[3]\t$clum[4]\t$clum[5]\t$clum[6]\t$clum[7]\t$clum[8]\t$clum[9]\t$clum[10]\n";
44 close IN;
45 close OUT;
47 __END__
48 ./bsuit check j150/k150.ini |tail -n11|head -n10 | ./getchecked.pl 1 -
49 ./bsuit check sj/j90.ini |tail -n11|head -n10 > x90.txt
50 ./getchecked.pl 1 x90.txt