Debian Codegraph @

debian/sh-replacement-scripts/run-mummer1

raw
1 #!/bin/sh -e
2 #
3 # **SEVERELY** antiquated script for running the mummer 1 suite
4 # -r option reverse complements the query sequence, coordinates of the reverse
5 # matches will be relative to the reversed sequence
6 #
7
8 usage () {
9 echo "Usage: `basename $0` <fasta reference> <fasta query> <prefix> [-r]"
10 return 67 # EX_USAGE
11 }
12
13 if [ $# -ne 3 -a $# -ne 4 ] ; then
14 echo "You provided $# arguments."
15 usage
16 fi
17
18 ref="$1"
19 qry="$2"
20 pfx="$3"
21 rev="$4"
22
23 bindir=/usr/bin
24
25 if [ ! -e "$ref" ] ; then
26 echo "File for fasta reference $ref does not exist."
27 usage
28 fi
29
30 if [ ! -e "$qry" ] ; then
31 echo "File for fasta query $qry does not exist."
32 usage
33 fi
34
35 if [ "$pfx" = "" ] ; then
36 usage
37 fi
38
39 echo "Find MUMs"
40 $bindir/mummer -mum -l 20 "$rev" "$ref" "$qry" | tail +2 > "$pfx".out
41 echo "Determine gaps"
42 $bindir/gaps "$ref" "$rev" < "$pfx".out > "$pfx".gaps
43 echo "Align gaps"
44 $bindir/mummer-annotate "$pfx".gaps "$qry" > "$pfx".align
45 mv witherrors.gaps "$pfx".errorsgaps