#!/usr/local/bin/perl # # Copyright (c) 1994 Tim Hubbard (th@mrc-lmb.cam.ac.uk) # Centre for Protein Engineering, MRC Centre, Cambridge, UK # All rights reserved. # $o="g/_out"; $cp="d/cp.anti"; $zero=0.0; $range=1.0; $c=1; # default is to find the number in the first column. eval "\$$1=\$2" while @ARGV && $ARGV[0]=~ /^(\w+)=(.*)/ && shift; $c--; # the first column is of course the zeroeth. # read scores $ns=0; open(IN,"<$o"); while(){ if ( /^\#/ ) { next ; } s/^\s*// ; # toss away blanks at start of line @splat = split ; $x = $splat[$c] ; # print $x , "\n" ; $sc[$ns] = ( $x - $zero ) / $range ; if ( $sc[$ns] < 0.0 ) { $sc[$ns] = 0.0 ; } if ( $sc[$ns] > 1.0 ) { $sc[$ns] = 1.0 ; } $ns++; } close(IN); $ns=0; # read cp file open(IN,"<$cp"); while(){ if(/(\d+) (\d+) (\d+) (\d+)/){ if($3 == 0){ printf "%4d%4d %5.2f cuw\n",$2,$1,$sc[$ns]; }else{ printf "%4d%4d %5.2f cue\n",$2,$1,$sc[$ns]; } $ns++; } } close(IN);