Awk is quite expressive with respect to the first requirement. If you want a column 11, you can just invent it and set it equal to the result of dividing column 9 by column 10.
It's possible to do the sort in awk, but it's a bit of a pain so easier just to pipe to sort. The column command makes it prettier, nothing more than that.
$ awk '{$11 = $9 / $10}1' file | sort -nr -k 11 | column -t 1 634112 . T C 125 1 . 32 89 0.359551 1 13273 . G C 563 5 . 25 128 0.195312 1 779762 . G A 675 5 . 28 187 0.149733 1 202259 . G T 675 8 . 12 130 0.0923077 1 598934 . C C 756 9 . 17 231 0.0735931
If your output needs to be tab separated, you can set the OFS variable (and forget about the column command):
$ awk -v OFS='\t' '{$11 = $9 / $10}1' file | sort -nr -k 11 1 634112 . T C 125 1 . 32 89 0.359551 1 13273 . G C 563 5 . 25 128 0.195312 1 779762 . G A 675 5 . 28 187 0.149733 1 202259 . G T 675 8 . 12 130 0.0923077 1 598934 . C C 756 9 . 17 231 0.0735931
Finally, you can use sprintf to format that last column as in your sample output:
$ awk -v OFS='\t' '{$11 = sprintf("%.3f", $9 / $10)}1' file | sort -nr -k 11 1 634112 . T C 125 1 . 32 89 0.360 1 13273 . G C 563 5 . 25 128 0.195 1 779762 . G A 675 5 . 28 187 0.150 1 202259 . G T 675 8 . 12 130 0.092 1 598934 . C C 756 9 . 17 231 0.074
UPDATE:
As Ed Morton shows in his answer, the ternary operator ?: can be used to protect against dividing by zero. Here I've put "UND" in column 11 to indicate "undefined", but of course you can just leave it blank or put some different value.
$ awk -v OFS='\t' '{$11 = ($10 != 0) ? sprintf("%.3f", $9 / $10) : "UND"}1' file | sort -nr -k 11 1 634112 . T C 125 1 . 32 89 0.360 1 13273 . G C 563 5 . 25 128 0.195 1 779762 . G A 675 5 . 28 187 0.150 1 202259 . G T 675 8 . 12 130 0.092 1 598934 . C C 756 9 . 17 0 UND
At some point you might decide that the awk program is getting complicated enough that it's better off in its own file with an emphasis more on readability than compactness.
$ cat div.awk file BEGIN { OFS="\t"} { if ($10 != 0) { quotient = $9 / $10 $11 = sprintf("%.3f", quotient) } else { $11 = "UND" } print } $ awk -f div.awk file | sort -nr -k 11 1 634112 . T C 125 1 . 32 89 0.360 1 13273 . G C 563 5 . 25 128 0.195 1 779762 . G A 675 5 . 28 187 0.150 1 202259 . G T 675 8 . 12 130 0.092 1 598934 . C C 756 9 . 17 0 UND