[Bio] / FigMetagenomeTools / venn.pl Repository:
ViewVC logotype

View of /FigMetagenomeTools/venn.pl

Parent Directory Parent Directory | Revision Log Revision Log

Revision - (download) (as text) (annotate) (vendor branch)
Mon Feb 19 17:15:26 2007 UTC (12 years, 9 months ago) by olson
Branch: x, MAIN
CVS Tags: mgrast_dev_08112011, mgrast_dev_08022011, mgrast_dev_05262011, mgrast_dev_04082011, mgrast_version_3_2, mgrast_dev_12152011, mgrast_dev_06072011, mgrast_rel_2008_0806, mgrast_dev_10262011, mgrast_dev_02212011, mgrast_rel_2008_0923, mgrast_release_3_0, mgrast_dev_03252011, mgrast_rel_2008_0924, mgrast_rel_2008_1110_v2, mgrast_rel_2008_0625, mgrast_release_3_0_4, mgrast_release_3_0_2, mgrast_release_3_0_3, mgrast_release_3_0_1, mgrast_dev_03312011, mgrast_release_3_1_2, mgrast_release_3_1_1, mgrast_release_3_1_0, mgrast_dev_04132011, mgrast_dev_04012011, mgrast_rel_2008_0919, mgrast_rel_2008_1110, myrast_33, mgrast_rel_2008_0917, mgrast_dev_04052011, mgrast_dev_02222011, y, HEAD
Changes since 1.1: +0 -0 lines
Initial import

#!/usr/bin/perl -w

# Generate some data for a venn diagram type picture

use strict;

my $count;
my %pos; my $i=1;
foreach my $f (@ARGV) {
 $pos{$f}=$i; $i++;
 open(IN, $f) || die "Can't open $f";
 while (<IN>) {
  my @a=split /\t/;

# set things to zero unless they exist
#foreach my $ss (keys %$count) {
# map { $count->{$ss}->{$_}=0 unless ($count->{$ss}->{$_}) } keys %pos;

my $cross; my $byf;
foreach my $f (keys %pos) {$cross->{$f}=0}
foreach my $ss (keys %$count) {
 my $list=join " and ", sort {$pos{$a} <=> $pos{$b}} keys %{$count->{$ss}};
 push @{$byf->{$list}}, $ss;

print map {"$_\t" . $cross->{$_} . "\n"} sort {$a cmp $b} keys %$cross;

print "\n\n\n";
foreach my $f (keys %pos, "black and red", "red and black") {
 print "$f: ", join "\t", @{$byf->{$f}}, "\n" if ($byf->{$f});

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3