-
Notifications
You must be signed in to change notification settings - Fork 79
/
ensure-test-data.sh
executable file
·120 lines (101 loc) · 3.85 KB
/
ensure-test-data.sh
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
#!/bin/bash
set -e
set -o pipefail
# Linux readlink -f alternative for Mac OS X
function readlinkUniversal() {
targetFile=$1
cd $(dirname $targetFile)
targetFile=$(basename $targetFile)
# iterate down a (possible) chain of symlinks
while [ -L "$targetFile" ]; do
targetFile=$(readlink $targetFile)
cd $(dirname $targetFile)
targetFile=$(basename $targetFile)
done
# compute the canonicalized name by finding the physical path
# for the directory we're in and appending the target file.
phys_dir=$(pwd -P)
result=$phys_dir/$targetFile
echo $result
}
os=$(uname)
dir=""
case $os in
Darwin)
dir=$(dirname "$(readlinkUniversal "$0")")
;;
Linux)
dir="$(dirname "$(readlink -f "$0")")"
;;
FreeBSD)
dir=$(dirname "$(readlinkUniversal "$0")")
;;
*)
echo "Unknown OS."
exit 1
;;
esac
mkdir -p $dir/src/test/resources/sequences/big/
cd $dir/src/test/resources/sequences/big/
if [ "${1}" == "unit" ];then
if [[ ! -d yf_sample_data ]]; then
curl -sS https://s3.amazonaws.com/files.milaboratory.com/test-data/yf_sample_data.tar | tar -xv
fi
elif [ "${1}" == "int" ] || [ "${1}" == "reg" ]; then
if [ "${1}" == "int" ]; then
if [[ ! -f CD4M1_test_R1.fastq.gz ]]; then
curl -sS -O https://s3.amazonaws.com/files.milaboratory.com/test-data/CD4M1_test_R1.fastq.gz
fi
if [[ ! -f CD4M1_test_R2.fastq.gz ]]; then
curl -sS -O https://s3.amazonaws.com/files.milaboratory.com/test-data/CD4M1_test_R2.fastq.gz
fi
if [[ ! -f subset_B004-7_S247_L001_I1_001.fastq.gz ]]; then
curl -sS -O https://s3.amazonaws.com/files.milaboratory.com/test-data/subset_B004-7_S247_L001_I1_001.fastq.gz
fi
if [[ ! -f subset_B004-7_S247_L001_I2_001.fastq.gz ]]; then
curl -sS -O https://s3.amazonaws.com/files.milaboratory.com/test-data/subset_B004-7_S247_L001_I2_001.fastq.gz
fi
if [[ ! -f subset_B004-7_S247_L001_R1_001.fastq.gz ]]; then
curl -sS -O https://s3.amazonaws.com/files.milaboratory.com/test-data/subset_B004-7_S247_L001_R1_001.fastq.gz
fi
if [[ ! -f subset_B004-7_S247_L001_R2_001.fastq.gz ]]; then
curl -sS -O https://s3.amazonaws.com/files.milaboratory.com/test-data/subset_B004-7_S247_L001_R2_001.fastq.gz
fi
mkdir -p regression
cd regression
files=$(cat $dir/regression/list)
for file in $files; do
if [[ ! -f $file ]]; then
curl -sS -O "https://s3.amazonaws.com/files.milaboratory.com/test-data/regression/$file"
fi
done
cd ../
fi
# if [[ ! -d pa_test_data ]]; then
# curl -sS https://s3.amazonaws.com/files.milaboratory.com/test-data/pa_test_data.tar | tar -xv
# fi
if [[ ! -f single_cell_vdj_t_subset_R1.fastq.gz ]]; then
curl -sS -O https://s3.amazonaws.com/files.milaboratory.com/test-data/single_cell_vdj_t_subset_R1.fastq.gz
fi
if [[ ! -f single_cell_vdj_t_subset_R2.fastq.gz ]]; then
curl -sS -O https://s3.amazonaws.com/files.milaboratory.com/test-data/single_cell_vdj_t_subset_R2.fastq.gz
fi
mkdir -p trees_samples
cd trees_samples
if [[ ! -f MRK_p02_Bmem_1_CGTACTAG-AAGGAGTA_L00M_R1.fastq.gz ]]; then
curl -sS -O https://s3.amazonaws.com/files.milaboratory.com/test-data/MRK_p02_Bmem_1_CGTACTAG-AAGGAGTA_L00M_R1.fastq.gz
fi
if [[ ! -f MRK_p02_Bmem_1_CGTACTAG-AAGGAGTA_L00M_R2.fastq.gz ]]; then
curl -sS -O https://s3.amazonaws.com/files.milaboratory.com/test-data/MRK_p02_Bmem_1_CGTACTAG-AAGGAGTA_L00M_R2.fastq.gz
fi
if [[ ! -f MRK_p03_Bmem_1_TCCTGAGC-GTAAGGAG_L00M_R1.fastq.gz ]]; then
curl -sS -O https://s3.amazonaws.com/files.milaboratory.com/test-data/MRK_p03_Bmem_1_TCCTGAGC-GTAAGGAG_L00M_R1.fastq.gz
fi
if [[ ! -f MRK_p03_Bmem_1_TCCTGAGC-GTAAGGAG_L00M_R2.fastq.gz ]]; then
curl -sS -O https://s3.amazonaws.com/files.milaboratory.com/test-data/MRK_p03_Bmem_1_TCCTGAGC-GTAAGGAG_L00M_R2.fastq.gz
fi
cd ../
else
echo "Data pre-processing skipped for: ${1}"
exit 0
fi