annotate crac_wrapper.sh @ 4:ac6be31420fe draft

Uploaded
author bonsai
date Fri, 13 Sep 2013 10:36:13 -0400
parents 4cf2808854bc
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
1 #!/bin/sh
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
2
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
3 # Recovering special parameters from crac.xml
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
4 ###############################################################
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
5 CRAC_BINARY=crac
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
6 INDEX_INPUT="$1"
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
7
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
8 # Getting the indexed genome value
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
9 ###############################################################
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
10 # Getting the indexed Genome name without the extension
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
11 if [ -d "$INDEX_INPUT" ]; then # If $INDEX_INPUT is a directory (that is to say an index from the history)
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
12 cpt=0
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
13 for fichier in $INDEX_INPUT/*.ssa
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
14 do
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
15 if [ $((++cpt)) -gt 1 ]; then #More than 1 '.ssa' file is not expected
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
16 echo "Warning:Multiple indexes found [$INDEX]" >&2
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
17 fi
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
18 INDEX=${fichier%%.ssa} #Getting the index from history
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
19 done
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
20 else
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
21 INDEX="$INDEX_INPUT" #Getting the prebuilt index
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
22 fi
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
23 if [ ! -f "$INDEX.ssa" -a ! -f "$INDEX.conf" ]; then #Both '.ssa' and '.conf' files are required
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
24 echo "Error:Index not found [$INDEX]" >&2
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
25 exit 1
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
26 fi
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
27
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
28 # Execution of the command line (Submiting job to the cluster)
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
29 ###############################################################
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
30 shift 2 #Avoiding index_input and output_name.extra_files_path
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
31
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
32 CRAC_CMD_LINE=""$CRAC_BINARY" -i "$INDEX" "$@""
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
33
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
34 out=`$CRAC_CMD_LINE`
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
35
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
36 exit 0
4cf2808854bc Uploaded
bonsai
parents:
diff changeset
37