comparison boxplots.pl @ 2:2920630b4d02 draft

Uploaded
author dereeper
date Wed, 11 Aug 2021 15:53:11 +0000
parents fff88b734caf
children
comparison
equal deleted inserted replaced
1:3b78dc3c36df 2:2920630b4d02
28 my %level; 28 my %level;
29 my $order = ""; 29 my $order = "";
30 my @headers = split(/\t/,$first); 30 my @headers = split(/\t/,$first);
31 while(<F>){ 31 while(<F>){
32 my $line = $_; 32 my $line = $_;
33 $line =~s/\n//g;$line =~s/\r//g; 33 $line =~s/\n//g;$line =~s/\r//g;$line =~s/\"//g;
34 my @infos = split(/\t/,$line); 34 my @infos = split(/\t/,$line);
35 my $cat = $infos[0]; 35 my $cat = $infos[0];
36 for (my $i = 1; $i <= $#infos; $i++){ 36 for (my $i = 1; $i <= $#infos; $i++){
37 $hash{$cat}{$headers[$i]}.= $infos[$i]."\n"; 37 $hash{$cat}{$headers[$i]}.= $infos[$i]."\n";
38 if ($order !~/$headers[$i]/){ 38 if ($order !~/$headers[$i]/){
50 foreach my $cat(keys(%hash)){ 50 foreach my $cat(keys(%hash)){
51 my $refhash = $hash{$cat}; 51 my $refhash = $hash{$cat};
52 my %subhash = %$refhash; 52 my %subhash = %$refhash;
53 foreach my $header(@categories){ 53 foreach my $header(@categories){
54 my $values = $hash{$cat}{$header}; 54 my $values = $hash{$cat}{$header};
55 open(F,">inforcalc");print F $values;close(F); 55 $values =~s/;/\n/g;
56 my $cmd = `Rscript $dirname/calc.r <inforcalc`; 56 if ($values =~/\d+/){
57 unlink("infocalc"); 57 open(F,">inforcalc");print F $values;close(F);
58 my ($min,$max,$quantile1,$quantile2,$quantile3,$quantile4,$quantile5) = split(";",$cmd); 58 my $cmd = `Rscript $dirname/calc.r <inforcalc`;
59 $series{$cat} .= " [$min,$quantile2,$quantile3,$quantile4,$max],\n"; 59 unlink("infocalc");
60 my ($min,$max,$quantile1,$quantile2,$quantile3,$quantile4,$quantile5) = split(";",$cmd);
61 $series{$cat} .= " [$min,$quantile2,$quantile3,$quantile4,$max],\n";
62 }
63 else{
64 $series{$cat} .= " [0,0,0,0,0],\n";
65 }
60 } 66 }
61 } 67 }
62 68
63 my $javascript = qq~ 69 my $javascript = qq~
64 <script type='text/javascript'> 70 <script type='text/javascript'>