-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpara_sh.sh
More file actions
51 lines (41 loc) · 1.34 KB
/
para_sh.sh
File metadata and controls
51 lines (41 loc) · 1.34 KB
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
#!/bin/bash
#$ -l mem=4G,time=4:: -N paraDemo -S /bin/bash -cwd
# This script is a demo shell script with parameters
# add file readme information here
#
# FqDir - (required) - A directory containing data files
# Type - (required) - "csv" for comma seperate, "tsv" for tab seperate
# OutNam - (optional) - A name for the output file.
# Help - H - (flag) - get usage information
#list of required tools:
# standard linux library
###############################################################
usage="
<Demo>* para_sh.sh -i <InputDirectory> -t <Type> -o <OutputName>
-i (required) - Path to directory containing fastq.gz files
-t (required) - \"csv\" for comma \"tsv\" for tab seperate files
-o (optional) - Output filename - if not provided the directory name will be used
-H (flag) - echo this message and exit
"
#get arguments
while getopts i:t:o:H opt; do
case "$opt" in
i) FqDir="$OPTARG";;
t) Type="$OPTARG";;
o) OutNam="$OPTARG";;
H) echo "$usage"; exit;;
esac
done
#check directory exists
if [[ ! -d $FqDir ]]; then
echo "Need provide a directory"
echo $usage
exit
fi
#check for csv/tsv specification
if [[ "$Type" != "PE" ]] && [[ "$Type" != "SE" ]]; then
echo "Need to specify paired-end or single-end"
echo $usage
exit
fi
### do something you want