comparison test-data.sh @ 9:4c485bb20e27 draft

"planemo upload for repository https://github.com/galaxyproteomics/tools-galaxyp/tree/master/tools/openms commit 6e8b69ee3aff3c93f745a5de11cc9169130f2e5e"
author galaxyp
date Thu, 24 Sep 2020 12:10:26 +0000
parents 2570414d1fd9
children 7a9d97cfe93c
comparison
equal deleted inserted replaced
8:2570414d1fd9 9:4c485bb20e27
16 export OPENMSGIT="$tmp/OpenMS$VERSION.0-git" 16 export OPENMSGIT="$tmp/OpenMS$VERSION.0-git"
17 export OPENMSPKG="$tmp/OpenMS$VERSION-pkg/" 17 export OPENMSPKG="$tmp/OpenMS$VERSION-pkg/"
18 export OPENMSENV="$tmp/OpenMS$VERSION-env" 18 export OPENMSENV="$tmp/OpenMS$VERSION-env"
19 export CTDCONVERTER="$tmp/CTDConverter" 19 export CTDCONVERTER="$tmp/CTDConverter"
20 20
21 if [[ -z "$1" ]]; then
22 autotests="/dev/null"
23 else
24 autotests="$1"
25 fi
21 26
22 if type conda > /dev/null; then 27 if type conda > /dev/null; then
23 true 28 true
24 else 29 else
25 wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh 30 wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
26 bash Miniconda3-latest-Linux-x86_64.sh -b -p "$tmp/miniconda" 31 bash Miniconda3-latest-Linux-x86_64.sh -b -p "$tmp/miniconda"
27 source "$tmp/miniconda/bin/activate" 32 source "$tmp/miniconda/bin/activate"
28 fi 33 fi
29 eval "$(conda shell.bash hook)" 34 eval "$(conda shell.bash hook)"
30 35
31 if [[ -z "$1" ]]; then
32 autotests="/dev/null"
33 else
34 autotests="$1"
35 fi
36 36
37 ############################################################################### 37 ###############################################################################
38 ## get 38 ## get
39 ## - conda environment (for executing the binaries) and 39 ## - conda environment (for executing the binaries) and
40 ## - the git clone of OpenMS (for generating the tests) 40 ## - the git clone of OpenMS (for generating the tests)
86 else 86 else
87 cd $CTDCONVERTER 87 cd $CTDCONVERTER
88 git pull origin topic/cdata 88 git pull origin topic/cdata
89 cd - 89 cd -
90 fi 90 fi
91 export PYTHONPATH=$(pwd)/CTDopts 91 # export PYTHONPATH=$(pwd)/CTDopts
92 92
93 ############################################################################### 93 ###############################################################################
94 ## copy all the test data files to test-data 94 ## copy all the test data files to test-data
95 ## most of it (outputs) will be overwritten later, but its needed for 95 ## most of it (outputs) will be overwritten later, but its needed for
96 ## prepare_test_data 96 ## prepare_test_data
97 ############################################################################### 97 ###############################################################################
98 echo "Get test data" 98 echo "Get test data"
99 find test-data -type f,l,d ! -name "*fa" ! -name "*loc" -delete
100
99 cp $(find $OPENMSGIT/src/tests/topp/ -type f | grep -Ev "third_party_tests.cmake|CMakeLists.txt|check_ini") test-data/ 101 cp $(find $OPENMSGIT/src/tests/topp/ -type f | grep -Ev "third_party_tests.cmake|CMakeLists.txt|check_ini") test-data/
100 cp -r $OPENMSGIT/share/OpenMS/MAPPING/ test-data/ 102 cp -r $OPENMSGIT/share/OpenMS/MAPPING/ test-data/
101 cp -r $OPENMSGIT/share/OpenMS/CHEMISTRY test-data/ 103 cp -r $OPENMSGIT/share/OpenMS/CHEMISTRY test-data/
102 cp -r $OPENMSGIT/share/OpenMS/examples/ test-data/ 104 cp -r $OPENMSGIT/share/OpenMS/examples/ test-data/
103 if [[ ! -f test-data/MetaboliteSpectralDB.mzML ]]; then 105 if [[ ! -f test-data/MetaboliteSpectralDB.mzML ]]; then
209 cd ./test-data || exit 211 cd ./test-data || exit
210 ../prepare_test_data_manual.sh 212 ../prepare_test_data_manual.sh
211 cd - || exit 213 cd - || exit
212 214
213 215
214 # # # exit
215
216 ############################################################################### 216 ###############################################################################
217 ## auto generate tests 217 ## auto generate tests
218 ############################################################################### 218 ###############################################################################
219 219 echo "Write test macros to $autotests"
220 echo "Write test macros to "$autotests 220 echo "<macros>" > "$autotests"
221 echo "<macros>" > $autotests
222 for i in $(ls *xml |grep -v macros) 221 for i in $(ls *xml |grep -v macros)
223 do 222 do
224 b=$(basename "$i" .xml) 223 b=$(basename "$i" .xml)
225 get_tests2 "$b" >> $autotests 224 get_tests2 "$b" >> "$autotests"
226 done 225 done
227 echo "</macros>" >> $autotests 226 echo "</macros>" >> "$autotests"
228 227
229 echo "Create test data links" 228 echo "Create test data links"
230 link_tmp_files 229 link_tmp_files
231 230
232 # tests for tools using output_prefix parameters can not be auto generated 231 # tests for tools using output_prefix parameters can not be auto generated
233 # hence we output the tests for manual curation in macros_test.xml 232 # hence we output the tests for manual curation in macros_test.xml
234 # and remove them from the autotests 233 # and remove them from the autotests
234 # -> OpenSwathFileSplitter IDRipper MzMLSplitter
235 #
236 # Furthermore we remove tests for tools without binaries in conda
237 # -> MSFragger MaRaClusterAdapter NovorAdapter
238 #
239 # not able to specify composite test data
240 # -> SpectraSTSearchAdapter
235 if [[ ! -z "$1" ]]; then 241 if [[ ! -z "$1" ]]; then
236 echo "" > macros_discarded_auto.xml 242 echo "" > macros_discarded_auto.xml
237 for i in OpenSwathFileSplitter IDRipper MzMLSplitter 243 for i in OpenSwathFileSplitter IDRipper MzMLSplitter MSFraggerAdapter MaRaClusterAdapter NovorAdapter SpectraSTSearchAdapter
238 do 244 do
239 echo "<xml name=\"manutest_$i\">" >> macros_discarded_auto.xml 245 echo "<xml name=\"manutest_$i\">" >> macros_discarded_auto.xml
240 xmlstarlet sel -t -c "/macros/xml[@name='autotest_$i']/test" macros_autotest.xml >> macros_discarded_auto.xml 246 xmlstarlet sel -t -c "/macros/xml[@name='autotest_$i']/test" macros_autotest.xml >> macros_discarded_auto.xml
241 echo "</xml>" >> macros_discarded_auto.xml 247 echo "</xml>" >> macros_discarded_auto.xml
242 xmlstarlet ed -d "/macros/xml[@name='autotest_$i']/test" macros_autotest.xml > tmp 248 xmlstarlet ed -d "/macros/xml[@name='autotest_$i']/test" macros_autotest.xml > tmp
243 mv tmp macros_autotest.xml 249 mv tmp macros_autotest.xml
244 done 250 done
245 >&2 "discarded autogenerated macros for curation in macros_discarded_auto.xml" 251 >&2 echo "discarded autogenerated macros for curation in macros_discarded_auto.xml"
246 fi 252 fi
247 conda deactivate 253 conda deactivate
248 254
249 ## remove broken symlinks in test-data 255 ## remove broken symlinks in test-data
250 find test-data/ -xtype l -delete 256 find test-data/ -xtype l -delete