-
Notifications
You must be signed in to change notification settings - Fork 1
/
CreateUniqueFasta
executable file
·53 lines (47 loc) · 1.47 KB
/
CreateUniqueFasta
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
#! /bin/bash
#**************************************************************
# EPPIC Pre-Computation Script
# Author : Kumaran Baskaran
# Date : 05/07/2013
#***************************************************************
set -e
help="\t\tUsage : $0 \n
\t\t [-s <path> : Sifts Connection file path \n
\t\t -n <name> : database name (usually uniprot relese name)\n
\t\t -o <dir-path> : Output dire\n
\t\t -j <jar-path> : Eppic jar file path]\n"
if (($# == 0)); then
echo "`date +%d/%m/%y-%H:%M:%S` ERROR: Script requires arguments" >&2
echo -e $help
exit 1;
fi
while getopts :s:n:o:j:h opt
do
case $opt in
s) SIFTS=$OPTARG;;
n) DB_NAME=$OPTARG;;
o) OUTPUT=$OPTARG;;
j) EPPIC_JAR=$OPTARG;;
h) echo -e $help;;
\?) echo "`date +%d/%m/%y-%H:%M:%S` ERROR: Invalid option: -$OPTARG" >&2
exit 1;;
:) echo "`date +%d/%m/%y-%H:%M:%S` ERROR: Option -$OPTARG requires an argument." >&2
exit 1;;
esac
done
if [ -z $SIFTS ] || [ -z $DB_NAME ] || [ -z $OUTPUT ]
then
echo -e "\n `date +%d/%m/%y-%H:%M:%S` ERROR: ---- SOME OPTIONS NOT SPECIFIED CORRECTLY ---- "
echo -e $help
exit 1
fi
# Create fasta files using java program WriteUniqueUniprots
if [ ! -d $OUTPUT ]
then
mkdir -p $OUTPUT
fi
maxmem=512m
echo "`date +%d/%m/%y-%H:%M:%S` INFO: Creating unique Fasta seq"
# Execute Command
java -Xmx$maxmem -cp $EPPIC_JAR tools.WriteUniqueUniprots -s $SIFTS -u $DB_NAME -o $OUTPUT/ > $OUTPUT/write-fasta.log
echo "`date +%d/%m/%y-%H:%M:%S` INFO: Unique Fasta seq created"