#!/usr/bin/perl -w # # Author: Grant Thiltgen # # This script is to collect output data from the multiple neural nets # run to test our training protocol. use strict; use English; use File::Basename; use Getopt::Long; use Pod::Usage; my $numnets=10; # Number of neural nets to look at. my $txxalign; # The alignment, for example t05-thin90 my $dataset; # The dataset, for example dunbrack-30pc-1763 my $arch; # The architecture of the neural net. my $alphaname; # The name of the alphabet used in neural net training my $data; # Data used, for example tr12 or t1c2 GetOptions( "numnets=i" => \$numnets , "txxalign=s" => \$txxalign , "dataset=s" => \$dataset , "arch=s" => \$arch , "alphaname=s" => \$alphaname , "data=s" => \$data , "help|?" => sub {pod2usage("verbose"=>1);} , "man" => sub {pod2usage("verbose"=>2);} ) or pod2usage("verbose" => 0); # Building loops to create the data file. my $line; # Information from the files brought into this. my $value; # Value of hash for foreach loop. my %trainbits; # storing training data in bits my @temp; # temporary array for storing data in the line. my ($a,$b); # temp values for sorting. my $i=0; # temp value for sorting. my $key; # value for key in hash. print STDOUT "Net\tValue\n"; print STDOUT "6S\t7N\n"; for (my $i=0; $i < $numnets; $i++) { open (TRAIN, "quality-reports/$ARGV[$i]/$dataset-$txxalign-$arch-$data-$alphaname-from-mult30.train") or print STDERR "Can't open $data training file for net$i\n"; while ($line = ) { chomp $line; if ($line =~ /^#/) { next; } else { @temp = split /\s+/, $line; $trainbits{$ARGV[$i]} = $temp[3]; } } close TRAIN; } foreach $key (sort highlow keys %trainbits) { if ($i++ > 20) { next; } print STDOUT "$key\t$trainbits{$key}\n"; } sub highlow ($$) { my ($a,$b) = @_; $trainbits{$b} <=> $trainbits{$a}; } __END__