Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
AF-NMR/Scripts/GetRPF_Scores.pl
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
48 lines (41 sloc)
1.32 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
my $rpf = $ARGV[0] ; | |
my @recall_s ; | |
my @precision_s ; | |
my @fmeasure_s ; | |
my @dp_s ; | |
my $i = 0 ; | |
my $recsum = 0 ; | |
my $precsum = 0 ; | |
my $fmsum = 0 ; | |
my $dpsum = 0 ; | |
# extract and write out RPF scores | |
if (open(SF, "<$rpf")) { | |
my ($recall_n, $precision_n, $f_measure_n, $dp_score_n) = (0, 0, 0, 0); | |
while (my $line_s = <SF>) { | |
next if $line_s !~ (/input query structures:/ || /DP-Score:/); | |
if ($line_s =~ /Final Recall-score for input query structures:\s*(\S+)/) { | |
$recall_n = sprintf "%.3f", $1; | |
push(@recall_s, $recall_n); | |
} elsif ($line_s =~ /Final Precision-score for input query structures:\s*(\S*)/) { | |
$precision_n = sprintf "%.3f", $1; | |
push(@precision_s, $precision_n); | |
} elsif ($line_s =~ /F-score of input query structures:\s*(\S+)/) { | |
$f_measure_n = $1; | |
push(@fmeasure_s, $f_measure_n); | |
} elsif ($line_s =~ /DP-Score:\s*(\S+)/) { | |
$dp_score_n = sprintf "%.3f", $1; | |
push(@dp_s, $dp_score_n); | |
} | |
} | |
close(SF); | |
# print "Recall: $recall_n, Precision: $precision_n, F-measure: $f_measure_n, DP-Score: $dp_score_n \n" ; | |
#print " Recall Precision F-measure DP-Score \n" ; | |
print " R P F DP \n" ; | |
foreach (@dp_s) { | |
printf " %7.3f %7.3f %7.3f %7.3f \n", $recall_s[$i], $precision_s[$i], $fmeasure_s[$i], $dp_s[$i] ; | |
$i++ ; | |
} | |
} | |
exit ; | |