6 open IA
,'<','crep_all_tsv_new.txt.up2.txt' or die $!;
7 open IB
,'<','crep_all_tsv_new.txt.up2.rev.txt' or die $!;
8 open IR
,'<','resLOC.rpratio' or die $!;
10 open OA
,'>','ricexpro.up2.clu.txt' or die $!;
11 open OB
,'>','ricexpro.up2.rev.clu.txt' or die $!;
12 open OS
,'>','ricexpro.up2.stat.txt' or die $!;
14 my (%dA,%dB,%dFlag,%cntdflag);
16 my ($id,$cnt,$value) = split /\t/;
18 $dA{$id} = log($value) / log(2);
23 my ($id,$cnt,$value) = split /\t/;
25 $dB{$id} = log($value) / log(2);
30 for my $k (keys %dFlag) {
31 push @
{ $cntdflag{$dFlag{$k}} },$k;
33 for my $k (keys %cntdflag) {
34 print "$k -> ",scalar @
{ $cntdflag{$k} },': ';
35 print "\n"; # join(',',@{ $cntdflag{$k} }),
40 my ($max,$min,$sum,$n,$ss)=(-999,999,0,0,0);
41 for my $id (@
{ $cntdflag{'101'} }) {
42 #print OS "# $id: $dA{$id}, $dB{$id}\n";
43 $sum += $dA{$id}+$dB{$id};
44 $ss += $dA{$id}*$dA{$id} + $dB{$id}*$dB{$id};
46 $max = $dA{$id} if $max < $dA{$id};
47 $min = $dA{$id} if $min > $dA{$id};
48 $max = $dB{$id} if $max < $dB{$id};
49 $min = $dB{$id} if $min > $dB{$id};
52 print "Range:[$min,$max] Mean: $mean SD:",sqrt($ss/$n - $mean*$mean)," Cnt:$n\n";
57 Range:[-5.28337053983209,5.82964609302319] Mean: -0.575308843011672 SD:1.62278420169048 Cnt:1062
64 my ($id,$acc,@dat) = split /\t/;
67 my $tmp = join('', map {my $a; if (defined $_) {$a = int($_); $a="+$a" if $_>=0; $a="-$a" if $_<0 and $a==0; $a; } } ($dA{$id},$dB{$id}));
68 my $newLOCid = $LOCid . $tmp;
69 my $newid = "${id}_${acc}$tmp";
70 if ($dFlag{$id} == '101') {
71 print OS
join("\t",$newid, $dA{$id} .';'. $dB{$id} ,@dat);
72 } elsif ($dFlag{$id} == '1') {
73 print OA
join("\t",$newid,$newLOCid,@dat);
74 } elsif ($dFlag{$id} == '100') {
75 print OB
join("\t",$newid,$newLOCid,@dat);
84 $ wc
-l crep_all_tsv_new
.txt
.up2
.*txt ricexpro
.up2
.* resLOC
.rpratio
85 8704 crep_all_tsv_new
.txt
.up2
.rev
.txt
86 5863 crep_all_tsv_new
.txt
.up2
.txt
87 4756 ricexpro
.up2
.clu
.txt
88 7344 ricexpro
.up2
.rev
.clu
.txt
89 401 ricexpro
.up2
.stat.txt
93 ./cluster
-f ricexpro
.up2
.clu
.txt
-l
-cg a
-ng
-g
2 -e
2
94 ./cluster
-f ricexpro
.up2
.rev
.clu
.txt
-l
-cg a
-ng
-g
2 -e
2