From 2caf1e547e2e65271daf0e4706cf34c254180e9f Mon Sep 17 00:00:00 2001 From: elserj Date: Wed, 21 Apr 2021 20:06:04 +0000 Subject: [PATCH] Add ability to do 6 (won't create diagram) svn path=/; revision=681 --- interactome_scripts/create_venn_diagram.pl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/interactome_scripts/create_venn_diagram.pl b/interactome_scripts/create_venn_diagram.pl index fb94495..bacb99f 100755 --- a/interactome_scripts/create_venn_diagram.pl +++ b/interactome_scripts/create_venn_diagram.pl @@ -60,6 +60,8 @@ $sth=$dbh->prepare("select * from super_clust where `species` = '$species_array[ $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(); @@ -156,7 +158,7 @@ foreach my $key (keys %count_hash) { #} 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"; @@ -524,6 +526,7 @@ if($species_array_size == 5) { 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}"); @@ -534,6 +537,7 @@ if($species_array_size == 5) { $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 @@ -557,7 +561,7 @@ if($species_array_size == 5) { # 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; -- 2.34.1