-
Notifications
You must be signed in to change notification settings - Fork 0
/
check.sh
executable file
·28 lines (25 loc) · 1.03 KB
/
check.sh
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/bash -
#===============================================================================
#
# FILE: check.sh
#
# USAGE: ./check.sh ref.fa qry.fa R Q L
#
# DESCRIPTION: Check if MUM is a real MUM
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Julio C\'esar Garc\'ia Vizca\'ino
# COMPANY:
# CREATED: 11/10/12 19:50:03 CEST
# REVISION: ---
#===============================================================================
set -o nounset # Treat unset variables as an error
grep -v '>' $1 | tr -d '\n' | gawk -v R=$3 -v L=$5 '{print substr($0,R,L)}'|sha1sum -t
grep -v '>' $2 | tr -d '\n' | gawk -v Q=$4 -v L=$5 '{print substr($0,Q,L)}'|sha1sum -t
ref=`grep -v '>' $1 | tr -d '\n' | gawk -v R=$3 -v L=$5 '{print substr($0,R,L)}'`
qry=`grep -v '>' $2 | tr -d '\n' | gawk -v Q=$4 -v L=$5 '{print substr($0,Q,L)}'`
grep -v '>' $1 | tr -d '\n' | grep -o $ref | wc -l
grep -v '>' $2 | tr -d '\n' | grep -o $qry | wc -l