File: get-motif-counts.awk

package info (click to toggle)
tigr-glimmer 3.02b-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 13,928 kB
  • ctags: 2,492
  • sloc: cpp: 24,416; awk: 232; csh: 220; makefile: 156; sh: 61
file content (28 lines) | stat: -rwxr-xr-x 646 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
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";
             }
        }