File: run-mummer1

package info (click to toggle)
mummer 3.23%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 7,708 kB
  • sloc: cpp: 14,190; ansic: 7,537; perl: 4,176; makefile: 369; sh: 175; csh: 44; awk: 17
file content (45 lines) | stat: -rw-r--r-- 981 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/sh -e
#
# **SEVERELY** antiquated script for running the mummer 1 suite
# -r option reverse complements the query sequence, coordinates of the reverse
# matches will be relative to the reversed sequence
#

usage () {
    echo "Usage: `basename $0` <fasta reference> <fasta query> <prefix> [-r]"
    return 67 # EX_USAGE
}

if [ $# -ne 3 -a $# -ne 4 ] ; then
    echo "You provided $# arguments."
    usage
fi

ref="$1"
qry="$2"
pfx="$3"
rev="$4"

bindir=/usr/bin

if  [ ! -e "$ref"  ] ; then
    echo "File for fasta reference $ref does not exist."
    usage
fi

if  [ ! -e "$qry"  ] ; then
    echo "File for fasta query $qry does not exist."
    usage
fi

if [ "$pfx" = "" ] ; then
    usage
fi

echo "Find MUMs"
$bindir/mummer -mum -l 20 "$rev" "$ref" "$qry" | tail +2 > "$pfx".out
echo "Determine gaps"
$bindir/gaps "$ref" "$rev" < "$pfx".out > "$pfx".gaps
echo "Align gaps"
$bindir/mummer-annotate "$pfx".gaps "$qry" > "$pfx".align
mv witherrors.gaps "$pfx".errorsgaps