File: get-motif-counts.awk

package info (click to toggle)
tigr-glimmer 3.02-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 13,952 kB
  • ctags: 2,530
  • sloc: cpp: 24,376; awk: 232; csh: 220; makefile: 155; sh: 36
file content (28 lines) | stat: -rwxr-xr-x 646 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/awk -f
# Usage:  get-motif-counts.awk
#   Read output of  elph  program and extract the motif
#   count information.  Output it in a format suitable for
#   reading by  glimmer3 .


/^Motif counts:/  {
         state = 1;
         next;
        }

        {
         if  (state && match ($0, /^[acgt]:/))
             {
              if  (width == 0)
                  {
                   width = NF - 1;
                   print width;
                  }
              printf "%s", substr ($1, 1, 1);
              for  (i = 2;  i <= NF;  i ++)
                printf " %7d", $(i);
              printf "\n";
             }
        }