forked from azroger/cyverse_agave_apps
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgmap_wrapper_test.sh
78 lines (69 loc) · 2.5 KB
/
gmap_wrapper_test.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
#wrapper script for gmap on Stampede
#more stuff from Roger Barthelson
#----------------------------------------------------
# Example SLURM job script to run MPI applications on
# TACC's Stampede system.
#
#----------------------------------------------------
#SBATCH -J gmaptest1 # Job name
#SBATCH -o gsq.%j.out # Name of stdout output file (%j expands to jobId)
#SBATCH -p development # Queue name
#SBATCH -N 1 # Total number of nodes requested (16 cores/node)
#SBATCH -n 16 # Total number of mpi tasks requested
#SBATCH -t 01:00:00 # Run time (hh:mm:ss) - 1.5 hours
#sequence="${sequence}"
sequence="/iplant/home/shared/iplantcollaborative/example_data/gmap/test_transcripts.fa"
#indx="${indx}"
indx="Athaliana"
directory="${indx}"
#reference="${reference}"
reference="/iplant/home/shared/iplantcollaborative/example_data/gmap/genome.fa"
reference_data="${reference_data}"
kmer="${kmer}"
basesize="${basesize}"
no_splicing="${no_splicing}"
cross_species="${cross_species}"
#Output_type="${Output_type}"
Output_type="2"
nPaths="${nPaths}"
stuffx=''
runthis=''
###
iget -fTr /iplant/home/rogerab/applications/gmap12/bin
mv bin/* ./
################
chmod a+x * ;
if [ -n "${kmer}" ]; then stuffx="$stuffx -k $kmer"; fi
if [ -n "${basesize}" ]; then stuffx="$stuffx -b $basesize"; fi
if [ -n "${reference}" ];
then
iget -fTr "${reference}"
INPUT_Ref=$(basename ${reference})
./gmap_build -B="./" "${stuffx}" -D "$directory" -d "${indx}" "${INPUT_Ref}"
else
iget -fTr "${reference_data}"
INPUT_RD=$(basename ${reference_data})
refData=$(basename ${INPUT_RD} .tar)
tar xvf "${INPUT_RD}"
directory="${refData}"
fi
################
if [ -n "${nPaths}" ]; then runthis="$runthis -n $nPaths"; fi
if [ -n "${kmer}" ]; then runthis="$runthis -n $kmer"; fi
if [ -n "${basesize}" ]; then runthis="$runthis --basesize $basesize"; fi
if [ -n "${no_splicing}" ]; then runthis="$runthis --nosplicing"; fi
if [ -n "${cross_species}" ]; then runthis="$runthis --cross-species"; fi
if [ -n "${nPaths}" ]; then runthis="$runthis -n $nPaths"; fi
if [ -n "${Output_type}" ]; then runthis="$runthis -f $Output_type"; fi
################
iget -fTr "${sequence}"
Input_seq=$(basename ${sequence});
./gmap -D "${directory}" -d "${directory}" -t 8 $runthis $Input_seq > "$Input_seq"'.out'
####################################################################
if [ -n "${reference}" ] ;
then
tar -cf "${directory}"'.tar' "${directory}"
rm -R "${directory}"
fi
######################################