File: tandem-repeat.awk

package info (click to toggle)
mummer 3.23%2Bdfsg-7
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 8,032 kB
  • sloc: cpp: 14,190; ansic: 7,537; perl: 4,176; makefile: 362; sh: 175; csh: 44; awk: 17
file content (23 lines) | stat: -rw-r--r-- 760 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Usage:  awk -f tandem-repeat.awk
#   Outputs tandem repeat regions based on repeat matches found
#   by  repeat-match  program.  That program should be run with
#   the  -t  option (for tandem repeats) or at least the -f
#   option (fo forward strand only), and the output
#   sorted by first and then second column (with the first two
#   header lines removed).

BEGIN   {
         printf "%8s %8s %8s %10s\n", "Start", "Extent", "UnitLen", "Copies";
        }

        {
         if  ($1 + $3 < $2)
             next;
         if  ($1 == prev)
             next;
         start = $1;
         extent = $2 + $3 - $1;
         unitlen = $2 - $1;
         printf "%8d %8d %8d %10.1f\n", start, extent, unitlen, extent / unitlen;
         prev = $1;
        }