File: mat-doc.sh

package info (click to toggle)
last-align 963-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,380 kB
  • sloc: cpp: 41,136; python: 2,744; ansic: 1,240; makefile: 383; sh: 255
file content (29 lines) | stat: -rwxr-xr-x 627 bytes parent folder | download | duplicates (8)
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
29
#! /bin/sh

# This generates text documentation from substitution score matrices.

cat <<EOF
LAST built-in scoring schemes
=============================

EOF

for i in "$@"
do
    name=$(basename $i .mat)
    nick=$(grep '^#nickname' $i | cut -d' ' -f2)
    test "$nick" && name="$name or $nick"
    echo $name
    echo $name | sed 's/./-/g'  # underline
    echo
    grep '^# ' $i | cut -d' ' -f2-
    echo It uses this matrix::
    echo
    grep -v '^#' $i | awk NF | sed 's/^/  /'
    echo
    grep -q '^#last' $i && {
	echo It sets these default lastal parameter values:
	grep '^#last' $i | cut -d' ' -f2-
	echo
    }
done