-112.6 115.0 -120.8 153.7 -121.8 118.7 -118.5 142.8 -144.1 146.9 -119.7 124.5 -118.0 119.2 #### #!/usr/bin/perl use warnings; # from command line. This file is a text file of phi psi angles as selected # from ramachandran_3DplotA.pl script $input = $ARGV[0]; $output = $ARGV[1]; $n = 0; $o = 0; $v = 0; if(($ARGV[0] eq "-h") || ($ARGV[0] eq "")) { print "\n* Ramachandran_3D Plot* program\n"; print "-------------------------------------------\n"; print "Usage: perl ramachandran_3DplotB.pl \n"; print "-------------------------------------------\n"; print "Prints out file for use in Graphis plotting program\n\n"; exit(1); } open(FILE, "$input") || die "ERROR: Unable to open $input FILE for reading: $!\n"; open(OUT, ">>$output") || die "ERROR: Unable to open $output FILE for writing: $!\n"; @file = ; for($i = -180; $i < 181; $i = $i+5) { $j = $i+5; $n++; $o = 0; for($k = -180; $k < 181; $k = $k+5) { $m = $k+5; $o++; @ranges = ([$i, $j, $k, $m]); @range_counts = (0) x @ranges; for $R (0..$#ranges) { for($f = 0; $f <@file; $f++) { $phi = substr($file[$f], 0, 6); $psi = substr($file[$f], 8, 6); print "$phi $psi\n"; if ($phi >=$ranges[$R][0] and $phi < $ranges[$R][1] and $psi >= $ranges[$R][2] and $psi < $ranges[$R][3]) { ++$range_counts[$R]; } } } for $R (0..$#ranges) { if($v < 73) { printf OUT "%d, ", $range_counts[$R]; $v++; } else { print OUT "\n"; $v = 0; } } } }