forked from sguizard/TAMA-singularity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Singularity
126 lines (101 loc) · 3.61 KB
/
Singularity
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
Bootstrap: docker
From: ubuntu:18.04
Stage: build
%environment
export LC_ALL=C
export APPS_HOME=/apps
export APP_NAME=${APPS_HOME}/tama
export APP_GIT=https://github.com/GenomeRIK/tama
export APP_COMMIT=d39bc7fedffda5b54aeae7337fe92f17ae5c1b03
%post
BUILD_DATE=`date`
export APPS_HOME=/apps
export APP_NAME=${APPS_HOME}/tama
export APP_GIT=https://github.com/GenomeRIK/tama
export APP_COMMIT=d39bc7fedffda5b54aeae7337fe92f17ae5c1b03
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true
echo "export BUILD_DATE=\"${BUILD_DATE}\"" >> $SINGULARITY_ENVIRONMENT
apt update
apt install -y perl-modules
echo "tzdata tzdata/Areas select Europe" > /tmp/preseed.txt
echo "tzdata tzdata/Zones/Europe select Paris" >> /tmp/preseed.txt
debconf-set-selections /tmp/preseed.txt
#rm /etc/timezone
#rm /etc/localtime
apt-get install -y tzdata
apt-get install -y software-properties-common
apt-add-repository universe
apt install -y dialog
apt install -y python2.7-minimal python-pip git dos2unix ncbi-blast+ bedtools samtools zlib* libbz2* liblzma-dev
pip install biopython==1.76
pip install pysam
mkdir $APPS_HOME
cd $APPS_HOME
git clone $APP_GIT
cd $APP_NAME
git checkout $APP_COMMIT
DOS_FILES=`find $APP_NAME -type f|grep -v '\.git'|grep -v 'images'`
for i in $DOS_FILES
do
dos2unix $i
done
cd /usr/local/bin
ln -s $APP_NAME/tama_collapse.py
ln -s $APP_NAME/tama_merge.py
for i in $(find /apps/tama/tama_go/ -type f -executable)
do
sed -i '1s|^|#!/usr/bin/env python\n\n|' $i
ln -s $i
done
apt purge -y git dos2unix
apt autoremove -y
apt clean
%test
#!/bin/bash
tama_collapse.py -h > /dev/null 2>&1
EXIT_CODE_TAMA_COLLAPSE=$?
tama_merge.py -h > /dev/null 2>&1
EXIT_CODE_TAMA_MERGE=$?
if [ $EXIT_CODE_TAMA_COLLAPSE -eq 0 ]; then
echo "TEST: RUNNING TAMA COLLAPSE HELP: OK"
else
echo "TEST: RUNNING TAMA COLLAPSE HELP: NOT OK"
fi
if [ $EXIT_CODE_TAMA_MERGE -eq 0 ]; then
echo "TEST: RUNNING TAMA MERGE HELP: OK"
else
echo "TEST: RUNNING TAMA MERGE HELP: NOT OK"
fi
if [ $EXIT_CODE_TAMA_COLLAPSE -eq 0 ] && [ $EXIT_CODE_TAMA_MERGE -eq 0 ]; then
echo "TEST: OK"
elif [ $EXIT_CODE_TAMA_COLLAPSE -ne 0 ] && [ $EXIT_CODE_TAMA_MERGE -eq 0 ]; then
echo "TEST: NOT OK: Cannot execute tama_collapse.py"
exit 1
elif [ $EXIT_CODE_TAMA_COLLAPSE -eq 0 ] && [ $EXIT_CODE_TAMA_MERGE -ne 0 ]; then
echo "TEST: NOT OK: Cannot execute tama_merge.py"
exit 1
elif [ $EXIT_CODE_TAMA_COLLAPSE -ne 0 ] && [ $EXIT_CODE_TAMA_MERGE -ne 0 ]; then
echo "TEST: NOT OK: Cannot execute tama_collapse.py" and tama_merge.py"
exit 1
else
echo "I Shouldn t be here ......
exit 1
fi
#%runscript
# echo "Container was created $BUILD_DATE"
# echo "Arguments received: $*"
# exec echo "$@"
%labels
Author Sebastien Guizard (Based on https://github.com/joelnitta/sqanti3-docker/commits/main)
OS Ubuntu
PROG TAMA
Version commit d39bc7fedffda5b54aeae7337fe92f17ae5c1b03
%help
This container has been built from the Ubuntu 18.04.
TAMA commit d39bc7fedffda5b54aeae7337fe92f17ae5c1b03 has been installed from github repo (https://github.com/GenomeRIK/tama).
TAMA is composed of two python scripts:
- tama_collapse.py (https://github.com/GenomeRIK/tama/wiki/Tama-Collapse)
- tama-merge.py (https://github.com/GenomeRIK/tama/wiki/Tama-Merge)
USAGE:
singularity exec TAMA.sif tama_collapse.py -h