#!/usr/bin/perl -w
# Usge: make-index extra-file1 extra-file2 ... < foo.ids > index.html
# Creates an html page with pointers to the extra files, then
# One pointer per line for the summary.html pages of the ids.
use lib "/projects/compbio/experiments/models.97/scripts";
use ChainIds;
sub get_e_value($);
print "\n";
print "
\n";
print "\n";
print "SAM-T02 protein structure predictions for CASP6-associated proteins\n";
print "\n";
print "\n";
print "\n";
print "\n";
print "SAM-T02 protein structure predictions for CASP6-associated proteins\n";
print "
\n";
foreach my $file (@ARGV)
{
if (! -e $file)
{ print STDERR "WARNING: $file doesn't exist--skipped.\n";
next;
}
print "$file
\n";
}
ReadIDsFH(STDIN, %ids);
foreach my $id (keys(%ids))
{ $ids{$id} = get_e_value($id);
}
print "proteins sorted by name
\n";
print "\n";
print "name | E_value of best hit |
\n";
foreach my $id (sort(keys(%ids)))
{
print "$id | ";
print "$ids{$id} | " if (defined($ids{$id}));
print "
\n";
}
print "proteins sorted by E_value
\n";
print "\n";
print "name | E_value of best hit |
\n";
foreach my $id (sort {$ids{$a} <=> $ids{$b}} (keys(%ids)))
{
print "$id | ";
print "$ids{$id} | " if (defined($ids{$id}));
print "
\n";
}
print "
\n";
print "\n";
print "\n";
sub get_e_value($)
{ my ($id) = @_;
my $file = "$id/$id.t2k.best-scores.rdb";
if (! -e $file)
{ print STDERR "WARNING: $file doesn't exist\n";
return undef;
}
print STDERR "$id\n";
open (BEST, "<$file");
# Read header line with column names
$_=;
my @field_name = split('\t');
my %colnum;
for (my $col=0; $col;
# Read first row
$_=;
close BEST;
my @fields = split('\t');
return $fields[$colnum{"Evalue"}];
}