Mercurial > repos > abossers > mummer_toolsuite
comparison MUMmer/mummerplot_tool.sh @ 2:479eb076cd23
Add revised mummer toolshed files to testtoolshed
author | abossers |
---|---|
date | Tue, 28 Oct 2014 16:59:33 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
1:c1c38335322e | 2:479eb076cd23 |
---|---|
1 #!/bin/bash | |
2 | |
3 ## simple bash to generate mummerplot of MATCH file | |
4 ## | |
5 ## Galaxy wrapper by Alex Bossers, CVI of Wageningen UR, Lelystad, NL | |
6 ## alex_dot_bossers_at_wur_dot_nl | |
7 ## | |
8 ## | |
9 ## needs a rename of the fixed name to something recognised by galaxy | |
10 ## needs cleanout of temp files | |
11 ## | |
12 ## call is mummerplot $format $in_match $out_file $cmd_extra | |
13 ## $0 $1 $2 $3 $4 | |
14 ## | |
15 ## since mummerplot uses some deprecated syntax which can be fixed in the source | |
16 ## we redirect STDERR to dev/null to circumvent errorstatus in galaxy | |
17 ## io redirects 0=stdin 1=stdout 2=stderr to dev/null (or &-) | |
18 | |
19 # Function to send error messages. | |
20 log_err() { echo "$@" 1>&2; } | |
21 | |
22 # path to where mummer suite is installed | |
23 # adjust this for your machine | |
24 # this is the only hard coded path in the scripts | |
25 mum_path="" | |
26 | |
27 if [ $num_path"$(which mummer)" == "" ] && [ "$num_path" == "" ]; then | |
28 log_err "mummer is not available in system path and not declarated in mum_path. Please install mummer." | |
29 exit 127 | |
30 fi | |
31 | |
32 # some default options to generate a LARGE fixed PNG/POSTSCRIPT image and not an interactive one. | |
33 | |
34 if [ "$1" = "png" ]; then | |
35 extension="png" | |
36 else | |
37 extension="ps" | |
38 fi | |
39 | |
40 eval "$mum_path mummerplot --large --$1 $2 1>&- 2>&-" | |
41 if [ -f "out.$extension" ]; then | |
42 #conditional move to something known by galaxy | |
43 mv out.$extension $3 | |
44 #remove gnuplot file | |
45 rm out.gp | |
46 fi | |
47 | |
48 ## clean up | |
49 rm out.fplot | |
50 rm out.rplot | |
51 | |
52 #end script |