#!/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.same inputfile sig_value # inputfile is the name of the discom matrix to be reformatted # sig_value is the lower limit on differences displayed #files needed: sig_only.gawk, reformatter.gawk, topper.gawk # #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 unsetenv SIG_VALUE #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 gawk -f counter.gawk $sig_file > $stat_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 $sig_file unsetenv NAMEBASE #prints top line on matrix in each file set final_file = $1:r.fnl setenv NUM_LINES $num_lines @ filenum = 1 foreach file ($split_file??) setenv FILENUM $filenum setenv NAMEBASE $final_file gawk -f topper.gawk $file @ filenum++ end rm $split_file* #rm $sig_file rm $fix_file