#!/usr/bin/perl -w
# pdsp - reading pdsp files
#  written by Tom Ray, July 7, 2004
# modified by Tom Ray, July 8, 2004
use strict;
use pdsp;

my %DrugKiHash = ();
my $Drug;
my $Receptor;
my %HashHash = ();

unless (@ARGV)
{
    print "usage: $0 FileName\n";
    print "usage: $0 AntiPsychotics.txt | less\n";
    print "usage: $0 041201EditedC.tex | less\n";
    print "usage: $0 Psychedelics0505.txt | less\n";
    exit;
}
my $FileName = $ARGV[0];
my @Data = ReadFile($FileName);

my @Drugs = MakeListOfDrugs(@Data);

# foreach $Drug (@Drugs)
# {
#     print "$Drug\n"
# }
# print "\n";

my @Receptors = MakeListOfReceptors(@Data);

# foreach $Receptor (@Receptors)
# {
#     print "$Receptor\n"
# }
# print "\n";

%DrugKiHash = MakeDrugKiHash(@Data);

# foreach $Drug (keys %DrugKiHash)
# {
#     print $Drug, "\n";
#     print $DrugKiHash{$Drug}, "\n";
# }

%HashHash = MakeDrugReceptorHashHash(\%DrugKiHash, \@Receptors);

# %HashHash = FourMinusLog(\%HashHash, \@Receptors);
# 
# %HashHash = NormalizeShiftMax(\%HashHash, \@Receptors);

%HashHash = Normalize(\%HashHash, \@Receptors);

PrintTableHashHash(\%HashHash, \@Receptors, \@Drugs);
