diff --git a/Scripts/DoDC.pl b/Scripts/DoDC.pl new file mode 100644 index 0000000..2dfecd7 --- /dev/null +++ b/Scripts/DoDC.pl @@ -0,0 +1,60 @@ +#!/usr/bin/perl + +use FindBin; +use lib $FindBin::Bin; +use strict ; + +#print @ARGV ; + +my $rdc="nhn.tab"; + +my $total ; +my $i ; +my $outD ; +my $pdbf ; + +my $pdb = $ARGV[0] ; +my $total = $ARGV[1] ; +$pdb =~ s/\.pdb// ; + +open(S,">$pdb.script") ; +print(S "load pdb $pdb.pdb\n"); +print(S "to xplor\n"); +print(S "split $pdb\n"); +print(S "quit\n"); +close(S); +system("/opt/software/bin/pdbstat -s < $pdb.script > $pdb.script.out"); +system("rm *Axis*"); +my $id ; + +my $Da_HN ; +my $Q ; +my $Rhomb ; +my $RMS ; +my $t1 ; +my $t2 ; + +open(OU,">DC_Summary"); +print(OU " Da_HN Rhomb Q RMS \n"); +print(OU " ======= ====== ====== ===== \n"); +for ($i = 1; $i <= $total; $i++ ) { + if ( $i < 10 ) { + $id = "0$i" ; + } else { + $id = "$i" ; + } + $pdbf = $pdb . "_" . $i . ".pdb" ; + $outD = $pdb . "_" . $id . "_" . $rdc . "_out" ; + system("/Users/tejerr/bin/DC -pdb $pdbf -inD $rdc -outD $outD") ; + open(F,"<$outD"); + while ( ) { + next if $_ !~ /DATA Q_FAC|DATA Da_HN|DATA Rhomb|DATA RMS/ ; + ($t1,$t2,$RMS) = split(' ',$_) if ( $_ =~ /RMS/ ); + ($t1,$t2,$Q) = split(' ',$_) if ( $_ =~ /Q_FACT/ ); + ($t1,$t2,$Da_HN) = split(' ',$_) if ( $_ =~ /Da_HN/ ); + ($t1,$t2,$Rhomb) = split(' ',$_) if ( $_ =~ /Rhomb/ ); + } + print(OU " $Da_HN $Rhomb $Q $RMS \n") ; + close($outD); +} +exit ; diff --git a/Scripts/Do_Avgs_DaR.pl b/Scripts/Do_Avgs_DaR.pl new file mode 100644 index 0000000..d46fd45 --- /dev/null +++ b/Scripts/Do_Avgs_DaR.pl @@ -0,0 +1,29 @@ +#!/usr/bin/perl + +use FindBin; +use lib $FindBin::Bin; +use strict ; + +my $inD = $ARGV[0] ; +my @family = (); + +open(F,"<$inD") ; +while ( ) { + next if ($_ =~ /^\s*$/); + next if ($_ =~ /Media/) ; + s/\[|\]//g ; + my @spl = split(' ', $_); + push(@family, [$spl[12],$spl[6], $spl[7]]); +} +close(F); +my $i = 0; +foreach my $l (@family) { + $i++ ; + print(" @$l " ); + #foreach (@$l) { + # print(" $_") ; + #} + print("\n"); +} + +exit ; diff --git a/Scripts/GetDaR_DC.pl b/Scripts/GetDaR_DC.pl new file mode 100644 index 0000000..9dd8268 --- /dev/null +++ b/Scripts/GetDaR_DC.pl @@ -0,0 +1,29 @@ +#!/usr/bin/perl + +use FindBin; +use lib $FindBin::Bin; +use strict ; + +my $outD = $ARGV[0] ; + +my $Da_HN ; +my $Q ; +my $Rhomb ; +my $RMS ; +my $t1 ; +my $t2 ; + +open(OU,">DC_Summary"); +print(OU " Da_HN Rhomb Q RMS \n"); +print(OU " ======= ====== ====== ===== \n"); +open(F,"<$outD"); +while ( ) { + next if $_ !~ /DATA Q_FAC|DATA Da_HN|DATA Rhomb|DATA RMS/ ; + ($t1,$t2,$RMS) = split(' ',$_) if ( $_ =~ /RMS/ ); + ($t1,$t2,$Q) = split(' ',$_) if ( $_ =~ /Q_FACT/ ); + ($t1,$t2,$Da_HN) = split(' ',$_) if ( $_ =~ /Da_HN/ ); + ($t1,$t2,$Rhomb) = split(' ',$_) if ( $_ =~ /Rhomb/ ); +} +print(OU " $Da_HN $Rhomb $Q $RMS \n") ; +close($outD); +exit ; diff --git a/Scripts/GetRPF_Scores.pl b/Scripts/GetRPF_Scores.pl new file mode 100644 index 0000000..d897460 --- /dev/null +++ b/Scripts/GetRPF_Scores.pl @@ -0,0 +1,48 @@ +#!/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 = ) { + 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 ; + + diff --git a/Scripts/GetRPF_Scores.pl.00 b/Scripts/GetRPF_Scores.pl.00 new file mode 100644 index 0000000..a7ff014 --- /dev/null +++ b/Scripts/GetRPF_Scores.pl.00 @@ -0,0 +1,47 @@ +#!/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 = ) { + 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" ; + foreach (@dp_s) { + print " $recall_s[$i] $precision_s[$i] $fmeasure_s[$i] $dp_s[$i] \n" ; + $i++ ; + } + +} +exit ; + +