Newer
Older
#!/bin/bash
#<IntronSeeker searches introns by splice-realigning reads on contigs.>
#Copyright (C) <2019> INRAE
#<Sarah Maman, Philippe Bardou, Emilien Lasguignes, Faustine Oudin, Floréal Cabanettes, Christophe Klopp>
#
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program. If not, see <https://www.gnu.org/licenses/>.
echo -e "\n### Begin installing intronSeeker...\n"
# Add the launcher and the scripts to the PATH by .bashrc
HERE=$(dirname $(realpath $0))
# Export the conda functions in the subshell
source activate
source $CONDA_PREFIX/etc/profile.d/conda.sh
# Conda environment installing
echo -e "### Conda environment installing... \n"
if [ $(conda env list | grep 'ISeeker_environment' | wc -l) = 0 ]
then
Sarah Maman-Haddad
committed
mamba env create --file $HERE/config/environment.yml
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
if [ $? = 0 ]
then
echo -e "### Conda environment installed. \n"
# Conda environment refinement
echo -e "### Conda environment configuration...\n"
conda activate ISeeker_environment
else
code=$?
echo "FAIL : Conda environment installation FAILED."
exit $code
fi
else
echo -e "Conda environment already installed. \n"
echo -e "### Conda environment configuration...\n"
conda activate ISeeker_environment
fi
if [ $? = 0 ]
then
ln -s $CONDA_PREFIX/lib/libcrypto.so.1.1 $CONDA_PREFIX/lib/libcrypto.so.1.0.0
mkdir -p $CONDA_PREFIX/etc/conda/activate.d/
cp config/set_env_config.sh $CONDA_PREFIX/etc/conda/activate.d/
echo -e "export PATH=$HERE:$HERE/scripts/:\$PATH" >> $CONDA_PREFIX/etc/conda/activate.d/set_env_config.sh
mkdir -p $CONDA_PREFIX/etc/conda/deactivate.d/
cp config/unset_env_config.sh $CONDA_PREFIX/etc/conda/deactivate.d/
cp -a $HERE/bin/assemblathon_stats.pl $CONDA_PREFIX/bin/
cp -a $HERE/bin/FAlite.pm $CONDA_PREFIX/bin/
sed -i 's#/tmp/build/80754af9/perl_1527832170752/_build_env/#'"$CONDA_PREFIX"'/#g' $CONDA_PREFIX/lib/5.26.2/x86_64-linux-thread-multi/Config.pm
sed -i 's#/tmp/build/80754af9/perl_1527832170752/_build_env/#'"$CONDA_PREFIX"'/#g' $CONDA_PREFIX/lib/5.26.2/x86_64-linux-thread-multi/Config_heavy.pl
sed -i 's#/tmp/build/80754af9/perl_1527832170752/_build_env/#'"$CONDA_PREFIX"'/#g' $CONDA_PREFIX/lib/5.26.2/x86_64-linux-thread-multi/CORE/config.h
conda deactivate
else
code=$?
echo "FAIL : Conda environment activation FAILED."
exit $code
fi
if [ $? = 0 ]
then
echo -e "### Conda environment configured.\n"
echo -e "### Grinder Installation...\n"
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
else
code=$?
echo "FAIL : Conda environment configuration FAILED."
exit $code
fi
if [ $? = 0 ]
then
mkdir $CONDA_PREFIX/tmp
cd $CONDA_PREFIX/tmp/
echo -e "\n###\tGetOpt::Euclid Installation...\n"
wget https://cpan.metacpan.org/authors/id/F/FA/FANGLY/Getopt-Euclid-0.4.5.tar.gz
else
code=$?
echo "FAIL : Conda environment activation FAILED."
exit $code
fi
if [ $? = 0 ]
then
tar -xzf Getopt-Euclid-0.4.5.tar.gz
cd Getopt-Euclid-0.4.5
perl Makefile.PL
make
make install
else
code=$?
echo "FAIL : Perl lib (GetOpt::Euclid) downloading FAILED."
exit $code
fi
if [ $? = 0 ]
then
cd ..
echo -e "\n###\tGetOpt::Euclid Installed\n"
echo -e "\n###\tTest::Number::Delta Installation...\n"
wget https://cpan.metacpan.org/authors/id/D/DA/DAGOLDEN/Test-Number-Delta-1.06.tar.gz
else
code=$?
echo "FAIL : Perl lib (GetOpt::Euclid) installation FAILED."
exit $code
fi
if [ $? = 0 ]
then
tar -xzf Test-Number-Delta-1.06.tar.gz
cd Test-Number-Delta-1.06
perl Makefile.PL
make
make install
else
code=$?
echo "FAIL : Perl lib (Test::Number::Delta) download FAILED."
exit $code
fi
if [ $? = 0 ]
then
cd ..
echo -e "\n###\tTest::Number::Delta Installed\n"
echo -e "\n###\tMath::Random::MT Installation...\n"
wget https://cpan.metacpan.org/authors/id/F/FA/FANGLY/Math-Random-MT-1.17.tar.gz
else
code=$?
echo "FAIL : Perl lib (Test::Number::Delta) installation FAILED."
exit $code
fi
if [ $? = 0 ]
then
tar -xzf Math-Random-MT-1.17.tar.gz
cd Math-Random-MT-1.17
perl Makefile.PL
make
make install
else
code=$?
echo "FAIL : Perl lib (Math::Random::MT) download FAILED."
exit $code
fi
if [ $? = 0 ]
then
cd ..
echo -e "\n###\tMath::Random::MT Installed\n"
wget https://sourceforge.net/projects/biogrinder/files/latest/download
else
code=$?
echo "FAIL : Perl lib (Math::Random::MT) installation FAILED."
exit $code
fi
if [ $? = 0 ]
then
tar -xzf download
cd Grinder-0.5.4
perl Makefile.PL
make
make install
else
code=$?
echo "FAIL : Grinder download FAILED."
exit $code
fi
cd ..
cd $HERE
chmod -R 777 $CONDA_PREFIX/tmp/
rm -r $CONDA_PREFIX/tmp/
echo -e "\n### Grinder Installed\n"
echo -e "### Installation done.\n"