File: test.sh

package info (click to toggle)
cct 20170919+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 333,956 kB
  • sloc: xml: 837,386; perl: 12,630; sh: 1,602; makefile: 17
file content (99 lines) | stat: -rwxr-xr-x 2,210 bytes parent folder | download | duplicates (2)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/bash -e

function abort_test {
  echo "
  For details see the CCT installation instructions in the 'docs' directory or
  online:

  http://stothard.afns.ualberta.ca/downloads/CCT/installation.html

  Aborting test!
" >&2
  exit 1
}

CCT_HOME=/usr/share/cct
# Check that the CCT_HOME variable is set
if [ -z $CCT_HOME ]; then
  echo "
  Please set the \$CCT_HOME environment variable to the full path to the
  cgview_comparison_tool directory.

  For example, add something like the following to your ~/.bashrc
  or ~/.bash_profile file:

     export CCT_HOME="/path/to/cgview_comparison_tool"

  After saving reload your ~/.bashrc or ~/.bash_profile file:

    source ~/.bashrc
"
  abort_test
fi

# Check for Java
if ! command -v java &>/dev/null; then
  echo "
  Java is required but it's not installed." >&2

  abort_test
fi

# Check for blast
if ! command -v blastall &>/dev/null; then
  echo "
  Blast is required but it's not installed." >&2

  abort_test
fi

# Check for ImageMagick
if   ( ! command -v convert &>/dev/null ) || ( ! command -v montage &>/dev/null ); then
  echo "
  WARNING: ImageMagick is not installed. ImageMagick is required for the build_blast_atlas_all_vs_all.sh command.
  
  For details see the CCT installation instructions in the 'docs' directory or
  online:

  http://stothard.afns.ualberta.ca/downloads/CCT/installation.html

  Testing will continue in 10 seconds...
" >&2
  sleep 10
fi

# Check for blast
if ! command -v blastall &>/dev/null; then
  echo "
  Blast is required but it's not installed." >&2

  abort_test
fi


# Check for cgview_comparison_tool
if ! command -v  cgview_comparison_tool &>/dev/null; then
  echo "
  Could not find 'cgview_comparison_tool'. Have you added the
  cgview_comparison_tool/scripts directory to your PATH?
  
  For example, add the following to your ~/.bashrc or ~/.bash_profile file:

    export PATH="\$PATH":"${CCT_HOME}"/scripts
" >&2

  abort_test
fi


# Run tests
for i in test_blastn test_blastx test_tblastx test_blastp test_tblastn test_plots test_orfs
do
  for j in project_settings.conf
  do
    cgview_comparison_tool -c ./conf/global_settings.conf -p ./sample_projects/$i -s ./sample_projects/$i/$j
  done

done