-
Notifications
You must be signed in to change notification settings - Fork 1
/
fisher.sh
70 lines (50 loc) · 1.04 KB
/
fisher.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#/usr/bin/env bash
<<COMMENT
Author: chenyanpeng
Date : 2020-09-17
COMMENT
function usage {
cat << EOF
$0 -- get the sequence(s) that match the given id(s) as bait(s).
SYNOPSIS:
$0 <id_file.txt> <fasta-file>
OPTIONS:
-h | --help print help message and exit
-v | --invert select non-matching lines
BUGS:
Any bugs in fastqInfo should be reported to chenyanpeng1992@outlook.com
EOF
}
# parse long command-line arguments with getopt
ARGS=$(getopt -a -n $0 -o hv --long help,invert -- "$@")
VALID_ARGS=$?
if [ "$VALID_ARGS" != "0" ]
then
usage
exit 2
fi
eval set -- "$ARGS"
while :
do
case "$1" in
-h|--help)
usage
exit 2 ;;
-v|--invert)
$INVERT=1
shift 1 ;;
--)
shift
break ;;
*)
echo "Unknown option: $1"
usage
exit 1;;
esac
done
declare -a idArray
idArray=($(cat $BAIT_FILE | sed 's/^>//' | cut -f 1))
cat $FILENAME | while read LINE
do
echo $LINE
done