comparison smalt_map.sh @ 0:77cc50d982c0 draft default tip

planemo upload for repository https://sourceforge.net/projects/smalt/ commit 008f4667b70be22e9ddf496738b3f74bb942ed28
author nml
date Tue, 19 Sep 2017 16:40:17 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:77cc50d982c0
1 #/bin/bash
2
3
4 smi=$1
5 shift
6 sma=$1
7 shift
8 #get format type so we can do extra work if it is a bam file
9 format=$1
10 shift
11
12 #get working directory so we can find the output files
13 CUR_DIR=`pwd`
14
15
16 cp "$smi" "$CUR_DIR/temp.smi"
17 cp "$sma" "$CUR_DIR/temp.sma"
18
19 #determine if we have 1 or 2
20 num_inputs=$1
21 shift
22
23 inputs=()
24
25 #determine how many fasta/fastq were given. Needs to be provided by user
26 if [ $num_inputs -eq 1 ]; then
27 inputs+=$1
28 shift
29 elif [ $num_inputs -eq 2 ]; then
30 inputs+=$1
31 shift
32 inputs+=' '
33 inputs+=$1
34 shift
35 else
36 exit 1
37 fi
38
39 smaltout=$2
40
41 smalt map $@ 'temp' $inputs
42
43
44 if [ "$format" == "bam" ]; then
45 if [ $GALAXY_SLOTS ]
46 then
47 samtools sort -@ $GALAXY_SLOTS $smaltout 'temp2'
48 else
49 samtools sort $smaltout 'temp2'
50 fi
51 mv 'temp2.bam' $smaltout
52 fi
53
54 #remove index files
55 rm "$CUR_DIR/temp.smi"
56 rm "$CUR_DIR/temp.sma"
57
58 exit 0