#!/usr/bin/perl -w
# pdsp - reading pdsp files
#  written by Tom Ray, July 7, 2004
# modified by Tom Ray, Sept 6, 2005
# for each drug, lists the receptors in order of affinity,
# specifies the normalized affinity

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);

my @Receptors = MakeListOfReceptors(@Data);

%DrugKiHash = MakeDrugKiHash(@Data);

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

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

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

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

