#!/bin/csh #input: output from discom #output: reformatted matrix, with only differences above # a command line determined value shown. This matrix can be printed # with enscript -r, with one page width per file # NOTE: IF THERE IS BLANK SPACE AT THE END OF YOUR MTX FILE (AND THERE # PROBABLY IS), ONE EXTRA .fnl FILE WILL BE CREATED. JUST RM IT!!! #command line: reformatter.diff inputfile sig_value pdbfile1 pdbfile2 # inputfile is the name of the discom matrix to be reformatted # sig_value is the lower limit on differences displayed # pdbfile1 is the pdb file containing the correct residue names and numbers # for the first input to discom. The names and numbers in this file # end up as the row names # pdbfile2 is the pdb file containing the correct residue names and numbners # for the second input to discom. These names and numbers end up as # the column names #I SUGGEST PUTTING THE PDBFILE WITH NUMBERS ABOVE 100 AS pdbfile1 (ROW NAMES)-- it # looks nicer. #files needed: sig_only.gawk, reformatter.gawk, topper.gawk # two pdbfiles-- the ones with the correct residue # names and numbers from which the input to discom was generated # #WARNING!!!! THIS SCRIPT CREATES (THEN DELETES) A FILE CALLED "junk_out" # I plan to fix this eventually #M. Nelson, 4/96 #puts a space in front of all negative values, to make sure the fields are #well seperated set fix_file = $1:r.fix sed 's/-/ -/g' $1 > $fix_file #gets the number of lines in the input file set temp = `wc -l $1` set num_lines = $temp[1] #only keeps differences that are significant (i.e. greater #than or equal to the value of sig_value, the second command line argument) setenv SIG_VALUE $argv[2] set sig_file = $1:r.sig gawk -f sig_only.gawk $fix_file > $sig_file #counts the number of matrix entries in each of four bins: #non significant, significant, but less than 3, greater than or equal to 3 but #less than 5, greater than or equal to 5 but less than 8, greater than 8. set stat_file = $1:r.stats nawk -f counter.nawk $sig_file > $stat_file #replaces residue name and number with correct values (from pdbfile1) setenv PDBFILE $3 set goodres_file = $1:r.goodres gawk -f substitute.gawk $sig_file > $goodres_file #tidies up the columns, and splits into seperate files-- one page #per file. set split_file = $1:r.split setenv NAMEBASE $split_file gawk -f reformatter.gawk $goodres_file unsetenv NAMEBASE #prints top line on matrix in each file set final_file = $1:r.fnl setenv NUM_LINES $num_lines setenv PDBFILE $4 @ filenum = 1 foreach file ($split_file??) setenv FILENUM $filenum setenv NAMEBASE $final_file gawk -f diff_top.gawk $file > junk_out @ filenum++ end rm $split_file* rm $sig_file rm $fix_file rm $goodres_file rm junk_out