changeset 2:2920630b4d02 draft

Uploaded
author dereeper
date Wed, 11 Aug 2021 15:53:11 +0000
parents 3b78dc3c36df
children 269130fc81f6
files boxplots.pl
diffstat 1 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/boxplots.pl	Tue Aug 10 20:22:21 2021 +0000
+++ b/boxplots.pl	Wed Aug 11 15:53:11 2021 +0000
@@ -30,7 +30,7 @@
 my @headers = split(/\t/,$first);
 while(<F>){
 	my $line = $_;
-	$line =~s/\n//g;$line =~s/\r//g;
+	$line =~s/\n//g;$line =~s/\r//g;$line =~s/\"//g;
 	my @infos = split(/\t/,$line);
 	my $cat = $infos[0];
 	for (my $i = 1; $i <= $#infos; $i++){
@@ -52,11 +52,17 @@
 	my %subhash = %$refhash;
 	foreach my $header(@categories){
 		my $values = $hash{$cat}{$header};
-		open(F,">inforcalc");print F $values;close(F);
-		my $cmd = `Rscript $dirname/calc.r <inforcalc`;
-		unlink("infocalc");
-		my ($min,$max,$quantile1,$quantile2,$quantile3,$quantile4,$quantile5) = split(";",$cmd);	
-		$series{$cat} .= " [$min,$quantile2,$quantile3,$quantile4,$max],\n";
+		$values =~s/;/\n/g;
+		if ($values =~/\d+/){
+			open(F,">inforcalc");print F $values;close(F);
+			my $cmd = `Rscript $dirname/calc.r <inforcalc`;
+			unlink("infocalc");
+			my ($min,$max,$quantile1,$quantile2,$quantile3,$quantile4,$quantile5) = split(";",$cmd);	
+			$series{$cat} .= " [$min,$quantile2,$quantile3,$quantile4,$max],\n";
+		}
+		else{
+			$series{$cat} .= " [0,0,0,0,0],\n";
+		}
 	}
 }