$sth=$dbh->prepare("select * from super_clust where `species` = '$species_array[0]' or `species` = '$species_array[1]' or `species` = '$species_array[2]' or `species` = '$species_array[3]' or `species` = '$species_array[4]'");
}elsif ($species_array_size == 6) {
$sth=$dbh->prepare("select * from super_clust where `species` = '$species_array[0]' or `species` = '$species_array[1]' or `species` = '$species_array[2]' or `species` = '$species_array[3]' or `species` = '$species_array[4]' or `species` = '$species_array[5]'");
+}elsif ($species_array_size == 7) {
+$sth=$dbh->prepare("select * from super_clust where `species` = '$species_array[0]' or `species` = '$species_array[1]' or `species` = '$species_array[2]' or `species` = '$species_array[3]' or `species` = '$species_array[4]' or `species` = '$species_array[5]' or `species` = '$species_array[6]'");
}
my $rv = $sth->execute();
#}
print "$key\t$id_array_size\t$gene_array_size\n";
print SUMMFILE "$key\t$id_array_size\t$gene_array_size\n";
-
+
# create the file to output the genes involved in each Venn set
$key =~ s/\t/__/g; # replace the \t in the filename with two working spaces
my $fh = "genes_$key";
my @spec_145_pos = (405,405);
my @spec_234_pos = (580,468);
my @spec_235_pos = (540,300);
+ my @spec_245_pos = (530,525);
my @spec_345_pos = (470,505);
$img->stringFT($black,'/usr/share/fonts/liberation/LiberationSans-Regular.ttf',14,0,$spec_123_pos[0],$spec_123_pos[1],"$venn_hash{spec_123_count}");
$img->stringFT($black,'/usr/share/fonts/liberation/LiberationSans-Regular.ttf',14,0,$spec_145_pos[0],$spec_145_pos[1],"$venn_hash{spec_145_count}");
$img->stringFT($black,'/usr/share/fonts/liberation/LiberationSans-Regular.ttf',14,0,$spec_234_pos[0],$spec_234_pos[1],"$venn_hash{spec_234_count}");
$img->stringFT($black,'/usr/share/fonts/liberation/LiberationSans-Regular.ttf',14,0,$spec_235_pos[0],$spec_235_pos[1],"$venn_hash{spec_235_count}");
+ $img->stringFT($black,'/usr/share/fonts/liberation/LiberationSans-Regular.ttf',14,0,$spec_245_pos[0],$spec_245_pos[1],"$venn_hash{spec_245_count}");
$img->stringFT($black,'/usr/share/fonts/liberation/LiberationSans-Regular.ttf',14,0,$spec_345_pos[0],$spec_345_pos[1],"$venn_hash{spec_345_count}");
# 4 species combinations
# convert the image to PNG and print it
-open (TESTOUT, ">test.png") || die;
+open (TESTOUT, ">venn_diagram.png") || die;
my $png_data = $img->png;
binmode TESTOUT;
print TESTOUT $png_data;